rules: send GPIO state by HTTP parameter

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
_Cyber_
Normal user
Posts: 113
Joined: 20 Oct 2019, 09:46

rules: send GPIO state by HTTP parameter

#1 Post by _Cyber_ » 18 Nov 2020, 20:07

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

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

Re: rules: send GPIO state by HTTP parameter

#2 Post by TD-er » 18 Nov 2020, 20:54

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)

_Cyber_
Normal user
Posts: 113
Joined: 20 Oct 2019, 09:46

Re: rules: send GPIO state by HTTP parameter

#3 Post by _Cyber_ » 18 Nov 2020, 21:04

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

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 16 guests