I hope this is the correctly posted.
I'm trying to create a rule where button press activates one of the four relays in the opposite state. It always works for "on", but never for "off". And when its activated for "on" it takes a few seconds and it returns to "off".
My codes for "Rules"
Code: Select all
on System#Boot do
GPIO,15,0
GPIO,12,0
GPIO,5,0
GPIO,4,0
endon
on Button1#Button do
if [GPIO12#State] = 1
GPIO,12,0
SendToHTTP 192.168.1.119,3480,/data_request?id=action&output_format=json&DeviceNum=16&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=1
else
GPIO,12,1
SendToHTTP 192.168.1.119,3480,/data_request?id=action&output_format=json&DeviceNum=16&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=0
endif
endon
log
Code: Select all
167070 : SW : Switch state 1 Output value 0
167073 : EVENT: Button1#Button=0.00
167088 : ACT : GPIO,12,1
167089 : SW : GPIO 12 Set to 1
167096 : ACT : SendToHTTP 192.168.1.119,3480,/data_request?id=action&output_format=json&DeviceNum=16&serviceId=urn:upnp-org:serviceId:S
168133 : Timeout while reading input data!
168138 : SW : GPIO 12 Set to 0
Buttons settings
Relay settings