Starting with this:
namxcap wrote: ↑02 Dec 2021, 18:45
Code: Select all
http://192.168.0.13:8841/json.htm?type=command¶m=switchlight&idx=20&switchcmd=On
with this line i can obtain the light On
I think you need to send On or Off to Domoticz, like below:
Code: Select all
on exDisplay#value do
logentry,'exDisplay: %eventvalue1%'
let,1,%eventvalue1%
if %eventvalue1% = 0 or %eventvalue1% = 1
publish domoticz/in,'{"command": "switchlight", "idx": 17, "switchcmd": "[var#1#o#c]" }'
endif
endon
That uses transformation 'o' to go from 0 -> OFF or 1-> ON, and justification 'c' to have first upper Off or On, as Domoticz expects it (AFAIK) (and the quotes are required to have valid Json).
Transformations can't be applied to %% variables, so first have to assign it to a variable using 'let'.