The sensor in question - ‘sensor.Alpha ZTV123’) is something I hacked together on an ESP32 from an example temperature sensor and so it presents as a Temperature Device measuring on degrees C - my modified version measures a DC voltage. I have added the device to a History Graph Card and it presents as expected:
(Purely for interests sake - the sensor is monitoring the output voltage of a solar panel and the dip on the top graph at around 7pm was last night’s solar eclipse)
You can see that I have tried 3 different “states” lines (two commented out) and I have created a history card to show this sensor.
The first line always presents 1.234 which suggests that the attempt to change to a float is failing
The third line always presents 9.876 which suggests that the rest of the YAML is acceptable.
But using the middle line presents “unavailable” on the History Graph
I’m a bit lost as to what I need to do to make this work, any advice would be gratefully received.
PhilipJ
Try to use Settings/Tools#template , when “laborating” with templates
There you will get “another” idea what’s going on than the message you get in Card/UI
Another thing which is unclear to me , is it a temperature-sensor, or is it a volt sensor ? ( I mean you can’t take a temp-sensor and “convert it” to a volt-sensor
The “Dip” will ofcause occur either ways during Night and a Solar-eclipse
If the source sensor sometimes goes unavailable, that can also make the template show unavailable. I’d check the source entity state in Developer Tools first.
If it still acts up, post the exact HA version and how that ESP32 sensor is being created, because that bit can matter a lot.
Hi, thank you for your comment. I wasn’t aware of the templates section in tools, I was doing stuff by using the File Editor and writing my sensor directly into configuration.yaml
You have opened my eyes to a whole new area that I can explore…
regards
PhilipJ
Thanks for the pointer - I thought that was the correct name because it seemed to work fine if I put the original sensor into a history card it worked ok. However when I looked in Settings->Tools->States it was displayed as Alpha_ZTV123 so I tried that and it seems to have fixed it, My “Solar Panel Voltage” sensor now appears in my History Graph Card.