I have an ESP that reads the data from my inverter, and when the inverter turns off, the ESP also turns off. In HA, I then see ‘Unavailable’ for the sensors. For at least two sensors, I want the last value to be displayed. Can I solve this in ESPHome, or do I need to build something for this in HA?
I don’t believe you will be able to solve this with esphome (with the current behavior, I would power the esp independently and the you can solve it with esphome).
Yes, why? (how is this pollution? It is more data than the absolute minimum necessary.)
You have a set of “requirements” that are likely contradictory. This is what it sounds like to me.
I want every detail saved
I don’t want extra data
The thing that generates the data I want is not available sometimes
When the data is not available I want the last value that was available
There was an HA system that operated that way that I used a decade ago (OpenHAB). I hated it, since I could never tell (for sure) when a sensor went offline.
You need to be clear about the relative priority of your conflicting requirements. Most HA data is incredibly boring, but there are nuggets of value/interest in it. For my system, I am more than happy to have many GB of boring (semi-duplicated) data as long as it allows me to find the moderately interesting thing I want.
replying because my issue is kind of related, opposite of what OP wants.
I’m using power monitor smart switch with openbeken flashed.
the smart switch doesn’t have backup power. homeassistant server has backup power.
it shows the last available value when the smart switch looses powere/goes offline. and continues to put that same value in the graph until power comes back.
I don’t want that. I want it to say offline/unavailable when it is offline. and enter null data or something in the graph.
It used to be like that, but I updated home assistant a few days ago from 2025.4.x to 2026.x it started doing that after the update.
sorry again for hijackiing OP’s thread, posted here just because it is very relavent.
What exactly are you trying to say, and how are you helping?
I used to ‘run’ my home on a Raspberry Pi 2 using Bash and Python, and I wrote my code in the Arduino IDE. Until I got pushed into using Home Assistant ;-). Only later did I realize how easy ESPHome actually is. That said, with the rules built into Home Assistant, it sometimes feels less logical to me than Python and Bash. I still get stuck on that from time to time and end up asking for help here.
You asked if it was possible to solve with esphome or of you needed to use HA. I said I didn’t believe it was possible to solve with just esphome (since the device loses power).
I then asked clarifying questions, because your statements didn’t make sense to me.