Let's assume the version: I enable socket 1 through the app, the remaining 2.3 are disabled.
When I press the button on the slat. Slot 1 will turn off, the rest will turn on.
I would like to create a rule that will send to IDX and allow all three to be included in the button.
And that when you attach the slat, it also sent home information about the attached socket.
Actual rule:
Code: Select all
On System#Boot do
gpio,3,0
endon
On WIFI#Connected do
SendToHTTP 10.10.10.254,8080,/json.htm?type=command¶m=switchlight&idx=18&switchcmd=Off ### correct?
SendToHTTP 10.10.10.254,8080,/json.htm?type=command¶m=switchlight&idx=19&switchcmd=Off ### correct?
SendToHTTP 10.10.10.254,8080,/json.htm?type=command¶m=switchlight&idx=20&switchcmd=Off ### correct?
endon
on Button1#state do
if [Relay1#state]=0 or [Relay2#state]=0 or [Relay3#state]=0
gpio,5,1
gpio,4,1
gpio,13,1
else
gpio,5,0
gpio,4,0
gpio,13,0
endif
endon
on Relay1#state do
if [Relay1#state]=0
gpio,1,1
else
gpio,1,0
endif
endon
on Relay2#state do
if [Relay3#state]=0
gpio,1,1
else
gpio,1,0
endif
endon
on Relay3#state do
if [Relay3#state]=0
gpio,1,1
else
gpio,1,0
endif
endon
GPIO 5,4,13 Relay