How to read/set GPIO on ESP8266 with ESP Easy firmware?
Moderators: leecollings, remb0
-
- Posts: 10
- Joined: Wednesday 24 April 2019 15:06
- Target OS: Windows
- Domoticz version:
- Location: Canada
- Contact:
How to read/set GPIO on ESP8266 with ESP Easy firmware?
I'm new to Domiticz. I'm wondering if Domoticz is the best way (on a windows PC or old android tablet) to control an ESP8266 module. I just want to be able to set or read the state of a few GPIO lines. The 8266 can have either the factory AT firmware, or ESPEasy, or NODE-MCU (which-ever is most compatible with Domoticz). Let me know if there are any instructions or guides on this. Thanks.
-
- Posts: 536
- Joined: Friday 23 December 2016 16:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: Netherlands Purmerend
- Contact:
Re: How to read/set GPIO on ESP8266 with ESP Easy firmware?
With the ESPeasy you can sent command or ready status with direct url's from the ESP8266.
If you have Domoticz the ESP8266 can report status directly into the Domoticx with a few clicks.
Commands you do with http://192.168.1.162/control?cmd=GPIO,14,0 from the action form in the switch.
Hope this does help you ?
If you have Domoticz the ESP8266 can report status directly into the Domoticx with a few clicks.
Commands you do with http://192.168.1.162/control?cmd=GPIO,14,0 from the action form in the switch.
Hope this does help you ?
-
- Posts: 10
- Joined: Wednesday 24 April 2019 15:06
- Target OS: Windows
- Domoticz version:
- Location: Canada
- Contact:
Re: How to read/set GPIO on ESP8266 with ESP Easy firmware?
I'm trying to follow this instruction: https://www.letscontrolit.com/wiki/index.php/Relais
But that is for Domoticz V2.2758. I have installed V4.10618 and I can't find that window showing the setup for a switch like it appears in the V2.2758 example. Starting with fresh new install of Domoticz I have no idea what steps to perform to get the ESP8266 with ESPEasy to work.
But that is for Domoticz V2.2758. I have installed V4.10618 and I can't find that window showing the setup for a switch like it appears in the V2.2758 example. Starting with fresh new install of Domoticz I have no idea what steps to perform to get the ESP8266 with ESPEasy to work.
-
- Posts: 536
- Joined: Friday 23 December 2016 16:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: Netherlands Purmerend
- Contact:
Re: How to read/set GPIO on ESP8266 with ESP Easy firmware?
Start with the basics first does the http://<ESP IP address>/control?cmd=GPIO,<pin>,0 and Start with the basics first does the http://<ESP IP address>/control?cmd=GPIO,<pin>,1 work for you? work for you?
Then you create a switch, take an on/off switch in the http field you use
http://<ESP IP address>/control?cmd=GPIO,<pin>,0
http://<ESP IP address>/control?cmd=GPIO,<pin>,1
It is not related to a version of domoticz.
Then you create a switch, take an on/off switch in the http field you use
http://<ESP IP address>/control?cmd=GPIO,<pin>,0
http://<ESP IP address>/control?cmd=GPIO,<pin>,1
It is not related to a version of domoticz.
-
- Posts: 10
- Joined: Wednesday 24 April 2019 15:06
- Target OS: Windows
- Domoticz version:
- Location: Canada
- Contact:
Re: How to read/set GPIO on ESP8266 with ESP Easy firmware?
Yes, the http commands work and the relay switches on and off.
To add the ESP8266 to the Domoticz setup, I can either select Setup, Devices or I can select Switches (from the main options). I assume I select Switches. At Switches, I can select Learn Light/Switch, or Manual Light/Switch. I assume I select Manual. I now have small window with drop-downs that contain no options. Hardware dropdown is empty when selected. I can't do anything in that window.
I restart Domoticz. I see No favorite devices defined. Please setup your hardware. Ok, I select Hardware. I see a data entry form. Name - I call it ESP8266. Type. No idea what to select. I don't see "Generic ESP8266 device" in the list. I see HTTP/HTTPS poller, and I see "Dummy" - virtual switch. Those are the only 2 possibilities that stand out for me. I create the virtual switch. I go back to Switches, Manual, in hardware I see ESP8266. I can type something for Device Name. Switch type - I select On/Off. Under Type, there is a long list. Nothing is obvious to me. I select GPIO. Next (under Type) is a GPIO drop-down list. It has "N/A" and nothing else. Then there is a Test button, and under that is "As (main device) or (sub/slave device). I see no where to enter URL's for the commands to the 8266 to turn on /off the relay. That is why I was asking how to get them?
To add the ESP8266 to the Domoticz setup, I can either select Setup, Devices or I can select Switches (from the main options). I assume I select Switches. At Switches, I can select Learn Light/Switch, or Manual Light/Switch. I assume I select Manual. I now have small window with drop-downs that contain no options. Hardware dropdown is empty when selected. I can't do anything in that window.
I restart Domoticz. I see No favorite devices defined. Please setup your hardware. Ok, I select Hardware. I see a data entry form. Name - I call it ESP8266. Type. No idea what to select. I don't see "Generic ESP8266 device" in the list. I see HTTP/HTTPS poller, and I see "Dummy" - virtual switch. Those are the only 2 possibilities that stand out for me. I create the virtual switch. I go back to Switches, Manual, in hardware I see ESP8266. I can type something for Device Name. Switch type - I select On/Off. Under Type, there is a long list. Nothing is obvious to me. I select GPIO. Next (under Type) is a GPIO drop-down list. It has "N/A" and nothing else. Then there is a Test button, and under that is "As (main device) or (sub/slave device). I see no where to enter URL's for the commands to the 8266 to turn on /off the relay. That is why I was asking how to get them?
-
- Posts: 536
- Joined: Friday 23 December 2016 16:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: Netherlands Purmerend
- Contact:
Re: How to read/set GPIO on ESP8266 with ESP Easy firmware?
Hi Sum
You are making your life too difficult
Just create a dummy switch, name it after the function of the first relais "Floorlamp?" type is an on/off switch
The goto the switch in the switch page and put in the url's
You are making your life too difficult

Just create a dummy switch, name it after the function of the first relais "Floorlamp?" type is an on/off switch
The goto the switch in the switch page and put in the url's
- Attachments
-
- Capture.JPG (65.04 KiB) Viewed 8035 times
-
- Posts: 10
- Joined: Wednesday 24 April 2019 15:06
- Target OS: Windows
- Domoticz version:
- Location: Canada
- Contact:
Re: How to read/set GPIO on ESP8266 with ESP Easy firmware?
I don't know how you get to that screen showing that form. First I do this:
Then I do this:
I don't see anything like in your screen. ?!
Then I do this:
I don't see anything like in your screen. ?!
Re: How to read/set GPIO on ESP8266 with ESP Easy firmware?
You have to create a Dummy 'Virtual Sensor' Sensor Type 'Switch' and edit the switch On/Off action like Freijn said
-
- Posts: 10
- Joined: Wednesday 24 April 2019 15:06
- Target OS: Windows
- Domoticz version:
- Location: Canada
- Contact:
Re: How to read/set GPIO on ESP8266 with ESP Easy firmware?
> You have to create a Dummy 'Virtual Sensor' Sensor Type 'Switch' and edit the switch On/Off action
Where do I CREATE "Dummy Virtual Sensor" ?!
On this page: http://127.0.0.1:8080/#/Hardware ?
If it is on that page, then what Type? I do not see "Sensor" or "Virtual Sensor" in the Type drop-down list !!!
The only place I see Virtual or Dummy is "Dummy (Does nothing, used for virtual switches only)"
Where do I CREATE "Dummy Virtual Sensor" ?!
On this page: http://127.0.0.1:8080/#/Hardware ?
If it is on that page, then what Type? I do not see "Sensor" or "Virtual Sensor" in the Type drop-down list !!!
The only place I see Virtual or Dummy is "Dummy (Does nothing, used for virtual switches only)"
-
- Posts: 10
- Joined: Wednesday 24 April 2019 15:06
- Target OS: Windows
- Domoticz version:
- Location: Canada
- Contact:
Re: How to read/set GPIO on ESP8266 with ESP Easy firmware?
Ah...
I did not notice that "Create Virtual Sensors" was a clickable item on the Hardware screen. And I wouldn't have thought that I would have to click it anyways, because it refers to "sensors" and not a switch. I would suggest a different way to handle this - it was not intuitive.
I did not notice that "Create Virtual Sensors" was a clickable item on the Hardware screen. And I wouldn't have thought that I would have to click it anyways, because it refers to "sensors" and not a switch. I would suggest a different way to handle this - it was not intuitive.
Re: How to read/set GPIO on ESP8266 with ESP Easy firmware?
Maybe it should be replaced with "Virtual Devices" instead of "Virtual Sensors"
-
- Posts: 536
- Joined: Friday 23 December 2016 16:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: Netherlands Purmerend
- Contact:
Re: How to read/set GPIO on ESP8266 with ESP Easy firmware?
but........is it working now ?????? 

-
- Posts: 10
- Joined: Wednesday 24 April 2019 15:06
- Target OS: Windows
- Domoticz version:
- Location: Canada
- Contact:
Re: How to read/set GPIO on ESP8266 with ESP Easy firmware?
Yes it is working. When I click the light-bulb icon on the Devices screen I can turn the relay on and off. I am now trying to figure out what to do next with Domoticz to make this function more usable.
Re: How to read/set GPIO on ESP8266 with ESP Easy firmware?
Search the forum and dive into dzVentz (scripts), there are numerous projects which make domoticz a very nice Home Automation project. Add some sensors (Temp/Hum) and intelligently control your bathroom fan, add door/window sensors and create your own alarm system, add motion sensors (PIR), add presence detection to see who is at home and enable/disable your alarm system, add weather information and so on and so on. I am using Domoticz since 2013 and still busy adding functionality to it.
-
- Posts: 10
- Joined: Wednesday 24 April 2019 15:06
- Target OS: Windows
- Domoticz version:
- Location: Canada
- Contact:
Re: How to read/set GPIO on ESP8266 with ESP Easy firmware?
One project I have in mind is to control an animal trap (like this one: https://cdn.domyown.com/images/thumbnai ... 4x1023.jpg) by rigging it with a solenoid so I can activate the trap manually, as well as have it change a GPIO input to indicate the animal has tripped the latch and is caught. Right now I have my traps under video observation but would like more manual control and more timely indication that animal has been caught. I bet that integrating a cage trap as part of a home automation system hasn't been done yet eh?
Who is online
Users browsing this forum: No registered users and 1 guest