Page 1 of 1

Sending HTTP with Rules

Posted: 04 Dec 2019, 20:47
by erasor2010
Hi,

i am trying to send a http Toggle Command to a Sonoff Basic with Tasmota.

I Made a Rule that sends the http command when a Push Button is Pressed

Code: Select all

On Button1#state do
if Button1#state=1
 SendToHTTP 192.168.1.63/cm?cmnd=Power%20TOGGLE
else
 SendToHTTP 192.168.1.63/cm?cmnd=Power%20TOGGLE
endon
When the Button is Pressed it Sends the Command But nothing Happens

Code: Select all

3064021: SW : GPIO=12 State=0 Output value=1
3064024: EVENT: Button1#State=1.00
3064043: ACT : SendToHTTP 192.168.1.63/cm?cmnd=Power%20TOGGLE
3064054: Command: sendtohttp
The HTTP alone works in WebBrowser. Where is my mistake?

Re: Sending HTTP with Rules

Posted: 04 Dec 2019, 21:39
by TD-er
The syntax of the command is wrong.

Code: Select all

 SendToHTTP 192.168.1.63,80,/cm?cmnd=Power%20TOGGLE
 
See the command reference: https://espeasy.readthedocs.io/en/lates ... nds-listed