Home Assistant Sensor broken

I’ve had an ESP32 driving a il9xxx display with the current temperature for years - as some point recently just displays NAN for the temperatures.
Did I miss a breaking change in the esphome import from home assistant?

sensor:
  - platform: homeassistant
    id: patio
    name: patio
    entity_id: sensor.patio_temperature
    unit_of_measurement: temperature
      it.printf(it.get_width(), it.get_height()*.33, id(font2), TextAlign::BOTTOM_RIGHT  "%.1f°", id(patio).state);

Is the state of this sensor a number or a string?

You might have missed some change in an update. You can go look at the changelog and find out just like everyone else does when they need to troubleshoot a problem.

That’s bascially the same code as on my still-working system:

  - platform: homeassistant
    name: "Outside temperature"
    entity_id: sensor.outside_temperature
    id: external_temp
    internal: true
...
    it.printf(0, 34, id(med_font), "%.0f°C %s %.0f ", id(external_temp).st

Try removing the somewhat-bizarre unit_of_measurement line.

What is the state of that sensor according to HA? Paste this into Developer Tools / Template and paste the result here:

{{ states('sensor.patio_temperature') }}

Surly that should be °C or °F or were you thinking device_class: temperature ?

it should be the number (temperature)

87.4 is what that evaluates to.

thank you All. still not working
I will research it further.
I’ll try the same code but with a different display and driver to see if it’s something in the driver.

The question was more to find out the type, is it a string or a number. Put it in the template editor by itself. At the top it will tell you if it’s value is a string or a number.

It wasn’t. If it’s a state, it’s a string. It’ll be "87.4" — the template editor will tell you it’s a number but it isn’t really.

That doesn’t matter here, though. I just wanted to be sure that the referenced sensor existed and was sending something that at least looked like a number.

1 Like

Again, thank you all - I apologize for jumping to confusion and leading you all down a rabbit-hole.

When I increased the verbosity of my logging I found it was throwing an error -

[E][display:017]: Could not allocate buffer for display!

tracking that down I found: Component ili9xxx.display was marked as failed. · Issue #4315 · esphome/issues · GitHub
the combining the ili9… drivers into one ili9xxx driver requires the addition of psram to run. This occurred between esphome 2022.9.4 and 2023.3.0

Sadly, i’ve not been able to get either a docker container to go back that far or versions of wheel and pillow to allow the python3 venv to work back to esphome 2022.9.4
-j-