send value from one OSP to OLED of another ESP

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
tparvais
Normal user
Posts: 99
Joined: 28 Oct 2015, 23:13

send value from one OSP to OLED of another ESP

#1 Post by tparvais » 07 Feb 2021, 18:42

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

User avatar
Ath
Normal user
Posts: 891
Joined: 10 Jun 2018, 12:06
Location: NL

Re: send value from one OSP to OLED of another ESP

#2 Post by Ath » 07 Feb 2021, 19:08

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.
/Ton

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

Re: send value from one OSP to OLED of another ESP

#3 Post by TD-er » 07 Feb 2021, 20:45

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

namxcap
Normal user
Posts: 7
Joined: 06 May 2021, 23:57

Re: send value from one OSP to OLED of another ESP

#4 Post by namxcap » 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

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

Re: send value from one OSP to OLED of another ESP

#5 Post by TD-er » 07 May 2021, 00:36

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

namxcap
Normal user
Posts: 7
Joined: 06 May 2021, 23:57

Re: send value from one OSP to OLED of another ESP

#6 Post by namxcap » 07 May 2021, 07:57

I don't know why but it's no working ...... :shock:

User avatar
Ath
Normal user
Posts: 891
Joined: 10 Jun 2018, 12:06
Location: NL

Re: send value from one OSP to OLED of another ESP

#7 Post by Ath » 07 May 2021, 08:44

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)
/Ton

namxcap
Normal user
Posts: 7
Joined: 06 May 2021, 23:57

Re: send value from one OSP to OLED of another ESP

#8 Post by namxcap » 07 May 2021, 17:38

YES !!! Now it works .... i learned one more thing !!!

Thankyou very much

Post Reply

Who is online

Users browsing this forum: No registered users and 23 guests