I want to make an MQTT sensor to monitor my pool’s temperature and send it to HA, but I also want it to send the temperature (in Celsius) to this little OLED display that will be hooked up to the sensor. I will have the unit boxed up and placed in my kitchen somewhere with the OLED visible and run the temperature probe out to the pool. I want the pool temp to be accessible both in Home assistant as well as on that display.
Is this possible and if so, can someone assist in coding it?
edit: extra points if there is some way to have the OLED cycle through other relevant data (outside temp, time, weather info, etc)
edit2: previous discussion on the topic: Pool Temperature Monitoring
I have an OLED attached to a NodeMCU that I am using as a “messageboard”.
Just have it listen for MQTT topics, then show on the screen.
Use some rules in HASS to send topics to the screen. EG if temperatures are updated, if CPU is too high, if plants need watering. I only have 3 lines of text in the oled (0.96" like yours), so setup a rolling methodology
I can post my project if anyone is interested. One caveat is that it needs rebooting every couple of days … likely my use of Strings letting memory kill the sketch over time!
I do have a sensor like yours for temp (in my box of “stuff to try one day”) … my intention was always to have that rigged up to a separate ESP8266 as my pool is too far from my house. Challenge is plumbing it in for me - want it neat, so was toying with using a gauge embedded in a flow meter … although the diameter of the meter is too small for the pool pump so I need to add some parallel plumbing before I rig it up.
I am trying to figure out how to connect the pins but can’t determine which ones you used by looking at the code. Plus, I assume my pins will be different (wemos d1 mini). Will it just work if I hook it up as per this site: http://automatedhome.party/wp-content/uploads/2017/04/WemosOLED.png?
The rest I believe I can figure out.
I have it working now! Need help with something though; I am only using it to display the pool temp and my son’s room temp, so only 2 lines, and I think the max font size is 24pt. I am trying to have it display only those two lines but I want it to take up the whole screen. Do you know the best way to accomplish this?
I have it working but for some reason the oled display stops updating after some time even though the mqtt is still sending updates. It’s not that it requires a certain threshold to be reached either because I’ve held the ds18b20 in my hand and watched the screen update instantly. It’s not so bad now because I can hit the reset switch on the wemos and it is rebooted in seconds but it does defeat the whole point of it being automated if I constantly have to reset it.
Mine freezes too - I think it is running out of memory in the arduino code.
Probably some bad String coding ot being tidy with memory.
You could use a timer to reset every xx milliseconds (about once a day) - I do intend to look at the code one day - but only know it is a bit “freezy”, not why!
I changed the automation to update the oled every 5min (before it was updating continuously), it seems to have helped but has a few hiccups every now and then and if I manually reset the wemos, I have to manually fire the automation to get it to update the first time.