NodeMCU based MQTT multi-sensor with OLED display

Tags: #<Tag:0x00007fe052ecc4c8> #<Tag:0x00007fe052ecd350> #<Tag:0x00007fe052ece200>

(Neelam Rani) #51

Its showing the empty graphs.Don’t know where i am doing mistake.

(B K) #52

Make sure you’re using the correct persistence service (I’ve been using rrd4j, which can store a series of values over time) and not something like mapDB persistence (which can only save a single point - the last value).

Also, make sure you add the chart group to your Temp/Humidity item definitions, so they’re actually tied to the Chart element.

(Neelam Rani) #53

Thank you sir. Yes i have installed mapDB. I am just installing rrd4j.

(Neelam Rani) #54

Sir I have installed rrd4j and uninstall mapDB but not getting any results on my graph.
Can you please suggest how you wrote in this?

Strategies {
// for rrd charts, we need a cron strategy
everyMinute : “0 0/1 * * ?”

    default = everyChange


Items {
// additionally persist weather info every minute
gHistory* : strategy = everyUpdate, everyMinute

Will it be same or i have to do some changes in it?

(Neelam Rani) #55

Sir i need your help in one more thing. We are doing hard coding of our esp8266 and writing the ssid and password into the code. But if the ssid and password of our network changes after some months or years then we have only one option. We have to hard code it again.
I read regarding a concept Access point below one of your video. I want to do something like that so that we can change that from our phone or PC.
Please help in that as well.

(B K) #56

Use code fences around all your posted code, so we can read it easier :wink:

Here’s my persistence strategy for the Temp_Chart group (all my sensors items belong to this group):

Items {
Temp_Chart* : strategy = everyMinute, restoreOnStartup
Temp_Chart_Period : strategy = everyChange, restoreOnStartup

Please post your items & sitemap definition files so we can take a look and see what’s wrong.

For this, I have started to use ESPEasy with these sensors. ESPEasy makes it easy to create an access point, but also allows me to change the configuration of the sensor using webpages, and add new sensors very easily too :slight_smile:

I haven’t made a full video about setting these up with ESP Easy, but I did show how to do it during my last live stream. You can watch it (it’s towards the end of the video where I show how I load/use ESPEasy), and hopefully it helps you!

(Neelam Rani) #57

Thank you BK for your help and yes i will try to use code fences:grinning: Actually i am new to these things. Here are my bindings and sitemaps files:-


Text label="Temperature Chart" icon="line"
       Switch item=Temp_Chart_Period label="Temp Chart Period" mappings=[0="Hour", 1="Day", 2="Week", 3="Off"] icon="line"
       Chart item=Temp_Chart period=h refresh=6000 visibility=[Temp_Chart_Period==0, Temp_Chart_Period=="Uninitialized"]
       Chart item=Temp_Chart period=D refresh=30000 visibility=[Temp_Chart_Period==1]
       Chart item=Temp_Chart period=W refresh=30000 visibility=[Temp_Chart_Period==2]

Text label="Humidity Chart" icon="line"
      Switch item=Hum_Chart_Period label="Hum Chart Period" mappings=[0="Hour", 1="Day", 2="Week", 3="Off"] icon="line"
      Chart item=Hum_Chart period=h refresh=6000 visibility=[Hum_Chart_Period==0, Hum_Chart_Period=="Uninitialized"]
      Chart item=Hum_Chart period=D refresh=30000 visibility=[Hum_Chart_Period==1]
      Chart item=Hum_Chart period=W refresh=30000 visibility=[Hum_Chart_Period==2]



Group Temp_Chart(all)
Number Temp_Chart_period "Temp Chart Period"
//Group Temp_Chart_2 (all)
//Number Temp_Chart_Period_2 "Temp Chart Second Floor Period"
Group Hum_Chart (all)
Number Hum_Chart_period "Hum Chart Period"

Number Temperature_kube "kube Temp [%.1f °C]" <temperature> (FF_kube,Temp_Chart) {mqtt="<[broker:home/kube/temperature:state:default]"}
Number Humidity_kube "kube Hum [%.1f %%]" <humidity> (FF_kube,Hum_Chart) {mqtt="<[broker:home/kube/humidity:state:default]"}

I have changed the persistence strategy but still not getting any results on my graph.

(Neelam Rani) #58

Thanks a lot BK. Learning many things from you.
Finally i learned how to use code fences.:grinning:

(B K) #59

Ok - so your sitemaps/items look alright, but there’s one thing missing from teh Chart line in the sitemap -the “service” option. Add it so that your Chart knows which persistence service to use. It’s described here: and you need it for your specific case when running more than one persistence service (mapdb and rrd4j). Just add a service=“rrd4j” to your Chart line and see what happens!

Also - are you definitely getting good values in your items from the Kube sensor? I.e. if you add those Number items to your sitemap - do you see temperature/humidity values?

(Inis) #60

BK do you have a PDF instructions for this? I think I want to try this but instead of using a case designing it to fit into a wall box with wall plate so its less noticeable in a room. Is there any way to dim or turn off the screen at night?

(B K) #61

@Jarred_Youngblood - I wrote up detailed instructions on my Thingiverse page and the Github repo. Fitting it into the wall box shouldn’t be too much of an issue, but you’d probably want to design your own PCB to house an AC/DC converter for power, and put the DHT sensor up front so it can get proper airflow for measurement.

You definitely can dim the screen, either based on a lux sensor input, or based on time (if you use ESPEasy like I have been doing lately, you can also write time-based rules) or based on an MQTT command from openHAB (based on an Astro sunset event).

That said, for a wall box based controller (with touchscreen), check out this project i found and adapted for openHAB recently (Home Automation Switch Plate) - it’s a fully functional display/controller that fits into a 1-gang wall box, and has a pre-designed PCB for a Wemos D1 and the AC/DC converter. The only thing it’s really missing is a DHT sensor, but you could potentially have a “dumb” sensor hidden somewhere else in the room, and display its temperature/humidity on the HASP (as a bonus, you also get touchscreen control and status display for other openHAB functions).

(Inis) #62

I had thought of something like you linked but I decided with kids, maybe I just want temp/humidity/motion…something they can’t break lol! I’ve integrated a pi touchscreen in the main hallway wall for larger control and have a wife friendly sitemap for our phones.

My goal with this to tell motion/temp/humidity and then work towards individual room duct control to even out the house. A year ago i started going room to room in the house pulling walls down and replacing insulation with spray-in foam. When I did that I ran all of my electrical in conduit and the main switch is a double gang and one side has a blank plate. I had thought of the AC/DC converter but being that stuff is so cheap and iffy to prevent a house fire i might just run a usb cable up through the conduit and put a outlet in the basement joyce. I don’t need my hobby burning down the house because i used a $3 ebay converter from china.

Do you have a oshpark version of the board? That pcb site I can’t get to work, has an error on country selection. Even tried remoting to my workstation desktop and no luck.

oh and also I did find your github and thingiverse sites. When I get my blank wall plate designed and fitted I’ll send you a link to it.

(B K) #63

Good idea with the kids - the touchscreen would have to be pretty locked down to prevent them from making your house go crazy :slight_smile:

Awesome! We’re thinking alike! ^ That is precisely the reason I designed this thing in the first place, and why I added the external sensor/connector in a servo pinout. I’m hoping to eventually control my registers based on some room-balancing, too. If you haven’t seen it already, there’s a great write-up of a solution on this forum, which uses H-bridges and old ventmiser registers (basically replacing the ventmiser controller with a pre-wired ESP8266/Arduino, while keeping the original motor). As you’ve probably heard from anyone you’ve told this idea, you’ll want to monitor the differential pressure on your blower motor when closing vents (the “SAT” range varies, but for my motor, I don’t want it to get past 0.5 inHg. I’ll save you the trouble of finding a good sensor and dealing with analog pins on ESP8266 (don’t bother! :stuck_out_tongue: ) - the MPXV7002DP sensor with an ADS1115 ADC is the way to go!

I share your concerns, but the IRM-03-5 supply aderusha uses in his HASP project is actually a very good unit made by a good brand (used all over the place in household electronics), so I’m not worried about it being in my walls. Much easier than pulling DC cable to every place I’d want to put these :slight_smile:

I’ve shared my breakout board files on Github, including the Eagle .brd file you’ll want to use for OSHPark. Use the v1.1 files for now, as I’m still testing v1.2 - and the version posted doesn’t include the latest changes I made - waiting for those boards now, if they pass my testing, I’ll update the repo.

Awesome - looking forward to seeing what you come up with!!

(scott dee) #64

Plus long runs of dc lose voltage so then you’re guessing at what voltage to supply in the basement so that you get the right voltage at the room. The irm is a very safe component and the HASP is a great place to start. I’m heading towards removing walls to get to ducting to seal mine up and make my solution more effective. I would love to spray foam, too. That’s awesome, keep it up.

With espeasy and openhab you can do nearly anything imaginable! I went a different way for the phones, making little habpanels that almost resemble apps

(Neelam Rani) #65

Okay BK i will do that. And yes i am getting temp and humidity values in my openhab dashboard. I have done the testing of it by changing the temperature of sensor and its showing the change as well.I am facing problem in the graphical part only.

(Neelam Rani) #66

Still not getting any value in graph bk. I don’t know where i am wrong but really want to do this.Please help.

(B K) #67

Are you using the Habpanelviewer app for this? I haven’t given it a try yet, thinking Habpanel layouts are too big for the phone screen, but yours looks actually usable.

This tells me you’ve got an issue with either persistence or your sitemap/item definition still. Let’s try this - post all three of your config files (.items, .sitemap and .persistence) on Pastebin or something like that (keep your private info out of them), and let us have a look at that. I’m sure it’s something simple like a typo in the configuration or something.

(scott dee) #68

Just a chrome shortcut saved on the desktop with kiosk mode on. I didn’t figure on hp being usable on the phone either. I started setting up imperihome but at the time it broke Google home and I never got off the ground with it. I’m a little surprised it looks as well as it does too! :blush:

(Inis) #69

Anyway to integrate the IRM-03-5 into the backside of your breakout board? I did get some ordered from Oshpark. Should be here in a week.

(Neelam Rani) #70

Hello Bk,

Kindly check the link for the sitemaps, items and persist files.

I have not added the service option to the sitemaps file because I have installed only one persistence service( rrd4j). Please help where I am wrong and what changes are required.