Page 1 of 1

rules: send GPIO state by HTTP parameter

Posted: 18 Nov 2020, 20:07
by _Cyber_
hello,

I am using ESP_Easy_mega_20201102_normal_ESP8266_4M1M on a wemos d1, on GPIO5 I have attached a wemos relay shield.

I am struggling with rules. who can help me finishing the last parameter, the GPIO state, of the http request?

Code: Select all

On System#Boot do
  timerSet,1,10
endon

On Rules#Timer=1 do
  SendToHTTP,192.168.0.250,80,/apcucollector.php?smartswitch=%sysname%&uptime=%uptime%&load=%sysload%&freeram=%sysheap%&rssi=%rssi%&relay=[gpio#5]
  timerSet,1,10
endon
the &relay=[gpio#5] gives a "&relay=" as request URI.
instead of [gpio#5] I tried [port#5] - I guessed that from log:

18070: HTTP: GPIO,5,1
18076: GPIO : port#5: set to 1

as soon as I call /control?cmd=GPIO,5,1

Thanks in advance!

Best regards
Alois

Re: rules: send GPIO state by HTTP parameter

Posted: 18 Nov 2020, 20:54
by TD-er
Have you tried this:

Code: Select all

[Plugin#GPIO#Pinstate#5]
See the example here https://espeasy.readthedocs.io/en/lates ... ore-events
(monitor command)

Re: rules: send GPIO state by HTTP parameter

Posted: 18 Nov 2020, 21:04
by _Cyber_
this works. thanks. :-)

that's why I made this feature request: https://github.com/letscontrolit/ESPEasy/issues/3375 :-)

thanks for your work and your responsiveness @TD-er

Best regards