Sending HTTP with Rules

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
erasor2010
Normal user
Posts: 1
Joined: 04 Dec 2019, 20:19

Sending HTTP with Rules

#1 Post by erasor2010 » 04 Dec 2019, 20:47

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?

TD-er
Core team member
Posts: 1922
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Sending HTTP with Rules

#2 Post by TD-er » 04 Dec 2019, 21:39

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

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests