Possible for a numeric sensor to also show unavailable state?

I’m new to writing home assistant integrations. I’m working on one for a device that only pushes sensor data such as temperatures and fan speed if they change. So on a home assistant restart these get whatever value I set as the default and some may not change for days depending on the device activity. Is there any way to get these sensors to report themselves as unavailable until they get a posted value such that someone putting the value in a dashboard would get something compact (e.g. not a long text string where a number was expected) to indicate this state in a reasonably clear manner?

I think all sensors have the ability to have state unknown and unavailable, but you might want to also ask in the development forum.

1 Like

Thanks. Was posting on my phone so I missed there was a separate development forum.

I found this one.

Thanks. I missed that section on generic properties. ‘available’ seems a likely candidate but I can’t find a description for what, if any, generic UX treatment this causes for sensors. I guess I’ll work out how to plumb that through and see.

I suspected it might - it replaces the value with the text ‘Unavailable’. Not terrible but would be nice to replace it with something less scary like ‘–’ or ‘N/A’ that’s more similarly sized to the available sensor number representation.

You will probably have to talk to a real developer then. :slight_smile:
I mainly just use Google-Fu to find some answers. :smiley: