send commands from one ESP to another
Moderators: grovkillen, Stuntteam, TD-er
send commands from one ESP to another
Evening,
I have an ESP measuring several temperatures, another in another place in the house with at the moment an LED to test and later a relay to switch an input on my heating. I can switch the led using
http://192.168.1.205/control?cmd=GPIO,2,0 or 1
from my browser so all good there. Now I want to switch this through a rule in the ESP measuring the temperatures.... I tried all variants from the tutorial http://www.letscontrolit.com/wiki/index ... rial_Rules but can't get it to work.
Any suggestions ??
Thanks !
I have an ESP measuring several temperatures, another in another place in the house with at the moment an LED to test and later a relay to switch an input on my heating. I can switch the led using
http://192.168.1.205/control?cmd=GPIO,2,0 or 1
from my browser so all good there. Now I want to switch this through a rule in the ESP measuring the temperatures.... I tried all variants from the tutorial http://www.letscontrolit.com/wiki/index ... rial_Rules but can't get it to work.
Any suggestions ??
Thanks !
Re: send commands from one ESP to another
Under advandced tab activate global sync and Set udp Port to the same value on both Devices. Then you can use the sendTo command.
Code: Select all
on RFID#Switch=1 do
sendTo 2,pulse,14,1,2000
//timerSet 1,5 //
if [Licht_TH#Lux<10]
gpio,13,1
timerSet 2,30
endon
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8
Re: send commands from one ESP to another
Ok, done that.
Can see the command being activated from the sending ESP ACT : sendto 243,event, vrijgave
on the receving end however, with the unit set to 243 nothing.. rule in the sender
and in the receiver
Can see the command being activated from the sending ESP ACT : sendto 243,event, vrijgave
on the receving end however, with the unit set to 243 nothing.. rule in the sender
Code: Select all
on System#Boot do
event,cvaan
endon
on temp_vloer_uit#Temperature_3<25 do
event,cvaan
endon
on temp_vloer_uit#Temperature_3>27 do
event,cvuit
endon
on cvaan do
sendto 243,event,vrijgave
endon
on cvuit do
sendto 243,event,blokkering
endon
and in the receiver
Code: Select all
on vrijgave do
GPIO,2,1
endon
on blokkering do
GPIO,2,0
endon
Re: send commands from one ESP to another
Unit number must be within 0-31.
I prefer SendToHTTP over sendto (TCP vs. UDP). Correct syntax is
SendToHTTP 192.168.1.205,80,/control?cmd=GPIO,2,0
I prefer SendToHTTP over sendto (TCP vs. UDP). Correct syntax is
SendToHTTP 192.168.1.205,80,/control?cmd=GPIO,2,0
Re: send commands from one ESP to another
Ok, tried that, same result... nothing
I have both ESP's setup as Domoticz HTTP, ip of the Domoticz server and port 8080... so I changed the command to SendToHTTP 192.168.1.205,8080,/control?cmd=GPIO,2,0
anything wrong there ? I can see again in the log of the sender that it is sending the command aparrently but nothing the reveive ris not getting any commands in by the looks of the log.
And the global sync.. leave it on or off ? Bit lost here
Also tried the UDP and globalsync roure again, can see both ESP's in the node list. Again, in the sender log can see the command being generarted, receiver log... no joy....
I have both ESP's setup as Domoticz HTTP, ip of the Domoticz server and port 8080... so I changed the command to SendToHTTP 192.168.1.205,8080,/control?cmd=GPIO,2,0
anything wrong there ? I can see again in the log of the sender that it is sending the command aparrently but nothing the reveive ris not getting any commands in by the looks of the log.
And the global sync.. leave it on or off ? Bit lost here
Also tried the UDP and globalsync roure again, can see both ESP's in the node list. Again, in the sender log can see the command being generarted, receiver log... no joy....
Re: send commands from one ESP to another
Global Sync is a bit special.
I tested it following http://www.letscontrolit.com/wiki/index ... GlobalSync
for driving a remote LCD display (Sensor on one ESP, display connected to another LCD).
It should be possible to make use of rules to switch a LED / relay from remote values.
Regards
Shardan
I tested it following http://www.letscontrolit.com/wiki/index ... GlobalSync
for driving a remote LCD display (Sensor on one ESP, display connected to another LCD).
It should be possible to make use of rules to switch a LED / relay from remote values.
Regards
Shardan
Regards
Shardan
Shardan
Re: send commands from one ESP to another
If you address an espeasy unit directly you must use the default port for http: 80
It doesn't care what port your broker is listening on.
It doesn't care what port your broker is listening on.
Re: send commands from one ESP to another
Got it to work now with HTTP commandon port 80, thanks !!
Now it keeps sending the command every cycle.. ok but... I would like to change this to somehtin like
and
to make it send only at change of temperature. Would that be possible ??
Code: Select all
on System#Boot do
SendToHTTP 192.168.1.205,80,/control?cmd=GPIO,2,1
endon
on vloer_uit#Temperature<25 do
event,cvaan
endon
on vloer_uit#Temperature>27 do
event,cvuit
endon
on cvaan do
SendToHTTP 192.168.1.205,80,/control?cmd=GPIO,2,1
endon
on cvuit do
SendToHTTP 192.168.1.205,80,/control?cmd=GPIO,2,0
endon
Code: Select all
on vloer_uit#Temperature<25 do
if cvuit=1
event,cvaan
endon
Code: Select all
on vloer_uit#Temperature>27 do
if cvaan=1
event,cvuit
endon
Re: send commands from one ESP to another
Yes you can, therefore you have to store the state in a dummy device. Or use global sync to take switch state from other unit available. Don't forget to endifyour condition.reddo wrote:Got it to work now with HTTP commandon port 80, thanks !!
Now it keeps sending the command every cycle.. ok but... I would like to change this to somehtin likeCode: Select all
on System#Boot do SendToHTTP 192.168.1.205,80,/control?cmd=GPIO,2,1 endon on vloer_uit#Temperature<25 do event,cvaan endon on vloer_uit#Temperature>27 do event,cvuit endon on cvaan do SendToHTTP 192.168.1.205,80,/control?cmd=GPIO,2,1 endon on cvuit do SendToHTTP 192.168.1.205,80,/control?cmd=GPIO,2,0 endon
andCode: Select all
on vloer_uit#Temperature<25 do if cvuit=1 event,cvaan endon
to make it send only at change of temperature. Would that be possible ??Code: Select all
on vloer_uit#Temperature>27 do if cvaan=1 event,cvuit endon
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8
Who is online
Users browsing this forum: No registered users and 133 guests