SendToHTTP rule

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Txus
Normal user
Posts: 13
Joined: 10 Apr 2018, 14:48

SendToHTTP rule

#1 Post by Txus » 10 Apr 2018, 14:58

Hello,
I try to send, from sonoff TH16, upgraded with espeasy 2.0, messages by HTTP (temp & dew)
i would like to are sure that my rule is done. Wireshark isn't log any HTTP message from sonoff to my server.
My rule :

On System#Boot do
timerSet,1,10
endon

On Rules#Timer=1 do
SendToHTTP 192.168.x.x,80,/rcgi.bin/UpdateTagForm?TagName1=T_int_sonoff&TagValue1= [Sonde#Temperature]
timerSet,1,10
endon

Maybe i forget something.
Thank you by advance for your help,

Txus

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

Re: SendToHTTP rule

#2 Post by TD-er » 10 Apr 2018, 15:04

There is a space in your URL.
Not sure if that's the issue, just noticed it.

User avatar
ManS-H
Normal user
Posts: 234
Joined: 27 Dec 2015, 11:26
Location: the Netherlands

Re: SendToHTTP rule

#3 Post by ManS-H » 10 Apr 2018, 16:54

Txus wrote:
10 Apr 2018, 14:58
Hello,
I try to send, from sonoff TH16, upgraded with espeasy 2.0, messages by HTTP (temp & dew)
i would like to are sure that my rule is done. Wireshark isn't log any HTTP message from sonoff to my server.
My rule :

On System#Boot do
timerSet,1,10
endon

On Rules#Timer=1 do
SendToHTTP 192.168.x.x,80,/rcgi.bin/UpdateTagForm?TagName1=T_int_sonoff&TagValue1= [Sonde#Temperature]
timerSet,1,10
endon

Maybe i forget something.
Thank you by advance for your help,

Txus
You missed a "," between SendToHTTP and 192.168.x.x,80,
Like this: SendToHTTP,192.168.x.x,80,

Txus
Normal user
Posts: 13
Joined: 10 Apr 2018, 14:48

Re: SendToHTTP rule

#4 Post by Txus » 11 Apr 2018, 15:08

Thank you for your answer.
I tryed with a "," between SendToFTP and ip@ with the same result.
Do you know one way to log or monitor TCP output from SONOFF ?

User avatar
ManS-H
Normal user
Posts: 234
Joined: 27 Dec 2015, 11:26
Location: the Netherlands

Re: SendToHTTP rule

#5 Post by ManS-H » 11 Apr 2018, 16:14

Txus wrote:
11 Apr 2018, 15:08
Thank you for your answer.
I tryed with a "," between SendToFTP and ip@ with the same result.
Do you know one way to log or monitor TCP output from SONOFF ?
I work with a Wemos with a switch and a Sonoff basic. On the Wemos i used a duo color led for the status of the Sonoff.
On the wemos side:
Devices: Switch input - Switch, name: button1, GPIO 0
on button1#switch do
SendToHTTP,192.168.0.126,80,/control?cmd=Event,ToggleRelay
if [button1#switch]=1 //switch on
gpio,15,0 // red led off
else
gpio,15,1 // red led on
endif
endon

On the Sonoff side:
Devices: Switch Input, name: Relay, GPIO 12
Rule on the Sonoff side:
on button1#switch do
Event,togglerelay
endon

on togglerelay do
if [relay#state]=0
gpio,12,1
SendToHTTP,192.168.0.127,80,/control?cmd=GPIO,14,1 // green led controller on
else
gpio,12,0
SendToHTTP,192.168.0.127,80,/control?cmd=GPIO,14,0 //green led controller off
endif
endon

Txus
Normal user
Posts: 13
Joined: 10 Apr 2018, 14:48

Re: SendToHTTP rule

#6 Post by Txus » 11 Apr 2018, 16:42

With the V2.0 ?

User avatar
ManS-H
Normal user
Posts: 234
Joined: 27 Dec 2015, 11:26
Location: the Netherlands

Re: SendToHTTP rule

#7 Post by ManS-H » 11 Apr 2018, 17:26

Txus wrote:
11 Apr 2018, 16:42
With the V2.0 ?
Wemos: GIT version: v2.0.0-dev13

Sonoff Pow: GIT version: (custom)

Txus
Normal user
Posts: 13
Joined: 10 Apr 2018, 14:48

Re: SendToHTTP rule

#8 Post by Txus » 12 Apr 2018, 09:06

not better...
I have downloaded to R120 and result is same.
I think than syntax off the message is not understanded by espeasy program : SendToHTTP,192.168.x.x,80,/rcgi.bin/UpdateTagForm?TagName1=T_int_sonoff&TagValue1= [sonde#temperature]

User avatar
grovkillen
Core team member
Posts: 3304
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: SendToHTTP rule

#9 Post by grovkillen » 12 Apr 2018, 10:02

You could use Fiddler or Wireshark to receive the messages and look if the sent message is correct.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Txus
Normal user
Posts: 13
Joined: 10 Apr 2018, 14:48

Re: SendToHTTP rule

#10 Post by Txus » 12 Apr 2018, 15:55

Is the problem. Wireshark don't log any message from sonoff to my server

User avatar
ManS-H
Normal user
Posts: 234
Joined: 27 Dec 2015, 11:26
Location: the Netherlands

Re: SendToHTTP rule

#11 Post by ManS-H » 12 Apr 2018, 16:52

Txus wrote:
12 Apr 2018, 09:06
not better...
I have downloaded to R120 and result is same.
I think than syntax off the message is not understanded by espeasy program : SendToHTTP,192.168.x.x,80,/rcgi.bin/UpdateTagForm?TagName1=T_int_sonoff&TagValue1= [sonde#temperature]
maybe a stupid question, but what is this: /rcgi.bin/UpdateTagForm?
Can be that that's your problem?

Txus
Normal user
Posts: 13
Joined: 10 Apr 2018, 14:48

Re: SendToHTTP rule

#12 Post by Txus » 12 Apr 2018, 22:28

This command is done when she's sended directly by firefox :roll:

sentinel
Normal user
Posts: 55
Joined: 02 Dec 2017, 17:40

Re: SendToHTTP rule

#13 Post by sentinel » 21 May 2018, 13:02

did you sort this out?
the SendToHTTP command doesn't have a comma ',' after the command. See the wiki.
If you install wireshark and apache on your computer, you can perhaps try to send the command to your computer's IP. And then use wireshark to see the command. Or try sending a simpler command with ESPEasy to your computer (eg. SendToHTTP 192.168.x.x,80,/simple)

Did you correct the space TD-er noticed?

Post Reply

Who is online

Users browsing this forum: No registered users and 37 guests