Hi, I have a question about the virtual devices, and how to script in Lua a response to a value change of the virtual device. My problem is this. I have the following 2 devices: P1GW AC and P1GW Power. The first one is a virtual device, the other a preset type in Domoticz (P1 Smart Meter). Both devices are updated. The below script does work for the preset type but does
not work for the virtual device. That device, when updated, will show the new value on the webpage but will
not trigger the below Lua event. How do I catch changes is a virtual device?
Below a fragment of the script_device_ALL.lua
Code: Select all
local DEV_P1GWAC = 'P1GW AC'
if (devicechanged[DEV_P1GWAC]) then
print("P1GW AC Power update")
myClass.sendUDPAC(IP_IXII)
end
local DEV_P1GWPW = 'P1GW Power'
if (devicechanged[DEV_P1GWPW]) then
print("P1GW P1 Power update")
myClass.sendUDPP1(IP_IXII)
end
Thanks for any thoughts,
DJ