I want to use an ESP8266 based temperature sensor, mainly for Room temperature logging. No Actions or other home automation planned at all. Thinking about running OpenHab and MQTT on my Synology NAS (should work… right?) and Logging the temperature every 1-2 Minutes, but only activating WiFi and sending all stored results every 10-30 Minutes, because i want to use a Battery powered sensor. This should decrease batterydrain by quite a bit… if it’s possible. is it ?
But then again ESP32 with BLuetooth Low Energy might be a better option. BUT this would mean you need a Host/Control Unit (Not Battery Powered preferably) somewhere which does the Redirection BLE -> Network/WiFi.
I’m Certain someone has done something similar before. Are my google skills just too bad?
Use the ESP32/8266 as an NRLF2301 receiver publishing to MQTT and the sensors are NRLF2301 based senders running off of coin batteries (2301). Lost of tutorials online for the NRLF2301.
As said before wifi is not designed for battery powered sensors, even if the esp8266 is easy to program and to connect to the hub that 95% of people have (a router). If you go to sub ghz techno; 433mhz or 868mhz and want to diy, you will find possibilities with less consumptions and sensors that last years, Take a look at:
-jeenode http://jeelabs.net/projects/hardware/wiki/JeeNode
-moteino https://lowpowerlab.com/guide/moteino/
Or even with some basic arduino board you will have far better duration compared to a wifi sensor on battery.
Ok NRLf24L01 as the remote sensor on coin batteries works for me…lower freq ~ lower ah consumption get it…the NRLF24l01 consumption when not awake is minimal so a life of a year on battery along with the cost makes it a throw away no brainer for me. YMMV. No religion just experience.
Can someone edit the above code and include a sleep state of the esp8266 while there is no measuring?
Battery consumption doesn´t matter, my problem with this is, i don´t want to measure the own heat of the esp8266. So if it is sleeping all the time and only wakes up all 5 minutes, there will not be much own heat of it.
I have KNX Installation and so i have wires all around the house, with the two free wires of the knx cable, i will provide 12V or whatever i will need. Only problem i see is the self heating of the esp8266 and so i could get wrong temperature measurements.
If i want to go the 12V way, what do i need to get a lower voltage for my esp? I think i need 3,3 volt? What is the best solution for this - with lowest self heating? linear power regulator? Can someone give me the right name of that?
@rockster
What kind of batteries do you use? 2 x AA ?
Can you provide your complete esp-code? I´m a noob in esp or arduino programming
Do i have a benefit, if i use mqtt? I think, with rest interface i will get the same data into openhab with less work? I only want to get temp/humidity and maybe with another sensor board co2 and VOC.
Do you have a picture of your sensor? Maybe where i can see the whole sensor-board and a second picture where i can see, how you installed it in your home? Did you flash mount it in the wall?
sorry, i have no picture avaiable. i recommend not use a development board and to remove the led to save battery. I have placed the sensor on top off furniture (rack, wardrobe, etc)
I am on a learning curve …
I read that the REST API is for controlling openhab2 and MQTT to update items in openhab2 from external sensors.
In your ESP code above you post data to openhab2 with the REST API?
What items have you created to receive the data?
Good day, everyone. Digging this old thread up, it’s the most relevant that I could find.
I have a few NodeMCU ESP-12P development boards and AM2302 (DHT22) sensors and the goal is to get them inputting via my Mosquitto MQTT. An added handicap is that I’ve done very little with Arduino and don’t quite get many of those programming commands yet.
I found a very simple program to load into the board and via serial monitor can get it to show output values. But when I get to the point of configuring values to feed to openhab via MQTT…it’s gets very fuzzy for me. Does someone have a good workable example I can use to learn? The code examples above are old and I’m having trouble getting them to work at all.
Thanks in advance for the help.
Another solution available recently is an LYWSD03MMC + an ESP32, no soldering required, you will have a cheap, durable, low power solution to get temperature and humidity.
More info below:
Huh. I hadn’t thought of that. I have a few Sonoff Basics laying around and I may try this. I’d still like to get the NodeMCU work as well, it will help me learn some of those programming skills. But I have been successful in getting the Sonoff/Tasmotas on my system to work. Thanks, great suggestion!