OLED SSD1306 as HASS display


Like a lot of people I begin to learn how to deal with HASS.
I an trying to create a display from my RaspberryPi HASS to a OLED SSD1306 as display. I did not have a full screen and network ON 24h a day.

My first idea is to display temperature and humidity from a sensor but I did not have any idea from where I have to start.

But I am sure to have to create a Python script as server/MQTT listener or script called by HASS to transform de value and format them to the display.

Here my first searches:

  • Developer Add new platform
    • But I did not know how to transfer the temperature to a new platform
  • Configure a MQTT server on Rpi + HASS publish the temp and humidity
    • Code a program that will be running from start on the Rpi that read the MQTT values for display

If someone have some path to follow, I will really appreciate.

Thanks all for reading to there

I think you’re getting ahead of yourself. Why do want to write this as add-on? I’m asking because it sounds somewhat hardware specific.

What you can do is to set up a repeated automation that just calls a shell command to display the information you want on the oled. That command can be a stand alone python script, executable etc. There’s no need to integrate it directly into hass. Just pass the sensor data as command line parameter.

The only reason you’d need mqtt is if the display required it, or you wanted to set up the display on the different piece of hardware (but that may be easier).

I also want to connect the SSD1306 to the Raspberry Pi 4 that Hassio is running on. Tell me, can you to do this?

In the meantime, I put on hold that kind of architecture.
Now also, I have more knowledge of how the Home assistant runs and you can use some of the following solutions

  • One python script runing in an infinite loop that will use the Home assistant API to retrieve the sensors you want to display and need some plumbing to display as you want on the SSD1306
  • One external Python script that will be called from Home assistant in order to update display
  • Go with ESP8266 solutions that have some hosted solutions for that