I trying to get the S2 of a Fibaro dimmer module (configured to act as a scene controller using parameter 28) to toggle a virtual switch. I want Scene ID 26 (1 x click) to toggle the status of the virtual switch. If the switch is already on it should turn off and if the switch is off if should turn on.
However, I can’t seem to work out the Logic Action. The S2 input gives a LastSceneID 26 when clicked and the Condition is true, but when using the ToggleState under HaDevice1 as a Action nothing happens. I assume this is not the right way of toggle a device status?
Is it possible to use LUA instead? I tried this LUA code I found but it do not work either:
local dID = 1420
local status = luup.variable_get("urn:upnp-org:serviceId:SwitchPower1","Status",dID)
if status == "1" then
luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{newTargetValue=0},dID)
else
luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{newTargetValue=1},dID)
end
No but the dimmers have a ToggleState command available when you crate a scene and select actions. This doesn’t appear to be accessible from the standard UI.