Ok, I’ve combed through the examples here and here and I can get the “Hello World” to show on the OLED screen (SSD1306 128x64). However, when I try to pull in temp/humidity info from homeassistant, the screen is blank. Has anyone done this successfully, can you take a look or share your code?
Here’s my yaml for this file. I will actually have the DHT22 sensor connected to the same NodeMCU as the SSD1306, so if anyone can offer code that would allow me to capture that info, that would work too.
I’ve never used has_state(). But comparing a float to itself will also return false if the float is NaN. And I print something on screen in the else as well, so that I always have something on screen even if the rest isn’t working.
swiftlyfalling, I used your code, it compiled and uploaded but the screen is still blank. I’ve double checked my entity_id to make sure it is correct and it is. I know the display works because I can use the “hello world” code and it shows on the screen.
Does it matter if the sensor is connected to the same NodeMCU as the display? Eventually, I want to add the display to a nodemcu that also has a DHT22, PIR, and light sensor, and I want the display to show temp and humidity and when there’s motion
It’s still not clear to me how this should function. Is the nodemcu firmware going to send the temp and humidity data to homeassistant and then the same nodemcu will pull it back down to display it on the OLED? Is that what will happen?
Ok, I tried your suggestion and I do have the word “waiting” now. I took out the textalign and the degree symbol. I waited for several minutes but nothing appears. I don’t think it’s pulling down the entity_id data.
swiftlyfalling, thanks so much for hanging in there and helping me. I figured it out, it’s working now. I had been using a test nodemcu with the display attached because I didn’t want to fiddle with my sensor nodemcu. The problem was I had failed to register the test nodemcu in homeassistant. Once I registered it, it pulled the temp in immediately. Sorry, I’m a complete noob.
Sorry to hijack this thread but, I’m using same oled and have it displaying temperature and time and now want to display on or off for a switch connected to the same node mcu what’s the easiest way to get state of switch and display thanks
Sorry to hijack this thread but, I’m using same oled and have it displaying temperature and time and now want to display on or off for a switch connected to the same node mcu what’s the easiest way to get state of switch and display thanks