Page 1 of 1
send value from one OSP to OLED of another ESP
Posted: 07 Feb 2021, 18:42
by tparvais
Hello
I'm trying toi send some values from one ESP mesauring temperature etc... to the oled screen of another ESP
The command
http://192.168.0.63/control?cmd=OLEDFRAMEDCMD,1,'Hello World'
is working well
now, I want to update temperature from another ESP
I create the following rule
on Temperature#Temperature do
SendToHTTP,192.168.0.63,80,/control?cmd=OLEDFRAMEDCMD,2,Sauna=[Temperature#Temperature]
endon
I suppose that for any change of Temperature, the SentToHTTP will be called to send the temperature. but nothing happen
I tried by using a dummy variable in ESP_OLED and TaskValueSet command
SendTo,13,'TaskValueSet,10,1,Sauna=[Temperature#Temperature]'
My problem is to add a measurement in the command to send
Thomas
Re: send value from one OSP to OLED of another ESP
Posted: 07 Feb 2021, 19:08
by Ath
You need to quote arguments containing commas or spaces paased to SendToHTTP or SendTo, as it sees those as separators, and won't glue them together itself. Quotes can be ", " or `, just use one pair that is not used in the list of arguments you're quoting.
Re: send value from one OSP to OLED of another ESP
Posted: 07 Feb 2021, 20:45
by TD-er
Yep.
Code: Select all
SendToHTTP,192.168.0.63,80,"/control?cmd=OLEDFRAMEDCMD,2,Sauna=[Temperature#Temperature]"
See also:
https://github.com/letscontrolit/ESPEasy/issues/2724
Re: send value from one OSP to OLED of another ESP
Posted: 07 May 2021, 00:14
by namxcap
Hello, can someone help me ?
i have this rule, but it doesn't work... where 'fumo' is the device's name.
On [fumo]#State do
If [fumo]#State=0
SendToHTTP,192.168.1.129,80,"/control?cmd=NEXTION,sleep=1"
Else
SendToHTTP,192.168.1.129,80,"/control?cmd=NEXTION,sleep=0"
Endif
Endon
Thankyou for your help
namxcap
Re: send value from one OSP to OLED of another ESP
Posted: 07 May 2021, 00:36
by TD-er
namxcap wrote: ↑07 May 2021, 00:14
Hello, can someone help me ?
i have this rule, but it doesn't work... where 'fumo' is the device's name.
On [fumo]#State do
If [fumo]#State=0
SendToHTTP,192.168.1.129,80,"/control?cmd=NEXTION,sleep=1"
Else
SendToHTTP,192.168.1.129,80,"/control?cmd=NEXTION,sleep=0"
Endif
Endon
Thankyou for your help
namxcap
The syntax should be [taskname#varname], not [taskname]#varname
Re: send value from one OSP to OLED of another ESP
Posted: 07 May 2021, 07:57
by namxcap
I don't know why but it's no working ......
Re: send value from one OSP to OLED of another ESP
Posted: 07 May 2021, 08:44
by Ath
namxcap wrote: ↑07 May 2021, 00:14
i have this rule, but it doesn't work... where 'fumo' is the device's name.
This is the correct syntax:
Code: Select all
On fumo#State do
If [fumo#State]=0
SendToHTTP,192.168.1.129,80,"/control?cmd=NEXTION,sleep=1"
Else
SendToHTTP,192.168.1.129,80,"/control?cmd=NEXTION,sleep=0"
Endif
Endon
- the line "on fumo#state do" should
not have [] included, here it is the event-name to be handled, not a value
- the line "if [fumo#state]=0"
should have [] included, now it is the value that needs to be checked; when having these [] it is replaced by the value (if that taskname/value is available)
Re: send value from one OSP to OLED of another ESP
Posted: 07 May 2021, 17:38
by namxcap
YES !!! Now it works .... i learned one more thing !!!
Thankyou very much