help about a rule

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
reza
Normal user
Posts: 87
Joined: 13 Jun 2017, 21:14

help about a rule

#1 Post by reza » 18 Aug 2021, 01:32

hi guys
i want have a rule for when espeasy is connect to wifi.
i am using this code but dont work :

Code: Select all

on WiFi#Connected do
SendToHTTP 192.168.1.201,8080,/json.htm?type=command&param=switchlight&idx=25&switchcmd=On
SendToHTTP 192.168.1.142,80,/control?cmd=EXTGPIO,2,1
endon
i want every time my esp connect to my network , so sent 2 http command for 2 devices.
means this rule and this device is a "ping sensor" for me.
can you help me for found problem of this rule ?

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

Re: help about a rule

#2 Post by TD-er » 18 Aug 2021, 01:49

Two ideas of what might be going on here:
- Maybe you need to start some short timer here (1 or 2 seconds) before trying to send out data.
- Check the checkbox on Tools->Advanced to wait for an acknowledgement for sendToHttp

Also double check to see if you need to include credentialswhen using Domoticsz (as it seems to be a Domoticz call on the first line)
You may also want to consider using MQTT for Domoticz as that's way more reliable and responsive.

reza
Normal user
Posts: 87
Joined: 13 Jun 2017, 21:14

Re: help about a rule

#3 Post by reza » 18 Aug 2021, 11:17

TD-er wrote: 18 Aug 2021, 01:49 Two ideas of what might be going on here
please let me i remove line about domoticz , and just a connection between 2 espeasy nodes with a router(access point) . this code :

Code: Select all

on WiFi#Connected do
SendToHTTP 192.168.1.142,80,/control?cmd=EXTGPIO,2,1
endon
also i test with a timer but dont work. this code :

Code: Select all

on WiFi#Connected do
timerSet,1,3
endon

On Rules#Timer=1 do
SendToHTTP 192.168.1.142,80,/control?cmd=EXTGPIO,2,1
endon
but this strange because after reset, this code work:

Code: Select all

on System#Boot do
SendToHTTP 192.168.1.142,80,/control?cmd=EXTGPIO,2,1
endon
but with"on WiFi#Connected do" dont work after reset !
i am using espeasy v2.0.0 . thank you for help

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

Re: help about a rule

#4 Post by Ath » 18 Aug 2021, 11:46

ESPEasy 2.0.0 isn't very conclusive as a version, best would be to name the Binary Filename like ESP_Easy_mega_<builddate>_normal_ESP8266... that is installed on the unit, you can find that about half-way down the Info page.
/Ton (PayPal.me)

Post Reply

Who is online

Users browsing this forum: No registered users and 24 guests