Hi,
I want to poll a gpio to see what the pin status is, how do I use publish to get the value or state of the gpio?
device nset in gpio 0 as a switch
Name: switch, Value: swi
I tried on the rules command: publish,/wemos01/gpio/0,[switch#sw1] but only shows "[switch#sw1] not the value.
Not much info in the docs (says to be added).
Any advice?
Thanks
How to publish to get the value or state of the gpio?
Moderators: grovkillen, Stuntteam, TD-er
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: How to publish to get the value or state of the gpio?
is not what you have here:Name: switch, Value: swi
publish,/wemos01/gpio/0,[switch#sw1]
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: How to publish to get the value or state of the gpio?
Hi,
Was a typo above, I did set:
Name:switch Value:sw1
"
Idea was to "poll" the esp (via mqtt) at any time to return a status of the gpio pin in the esp . The esp will mqtt listen(sniff) for a "poll" and response with a publish of the gpio status.
I am just not sure with the syntax of the publish command.
Thanks,
Was a typo above, I did set:
Name:switch Value:sw1
"
Idea was to "poll" the esp (via mqtt) at any time to return a status of the gpio pin in the esp . The esp will mqtt listen(sniff) for a "poll" and response with a publish of the gpio status.
I am just not sure with the syntax of the publish command.
Thanks,
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: How to publish to get the value or state of the gpio?
Then it looks correct. Please provide all settings so I can look and see what might be the problem.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Who is online
Users browsing this forum: Ahrefs [Bot] and 26 guests