Hi @Alec - it looks like your original state is ‘On’ rather than ‘on’.
Have you tried using an upper case O rather than the lower case o in the template sensor that @petro provided.
I have the same problem trying to report river levels. I have the values but am getting the bar graph. I’ve tried putting in the unit_of_measurement. Can someone please verify whether this goes into the lovelace file, or if it has to be an attribute of the entity being displayed? And can you verify the name is unit_of_measurement or unit_of_measure, or some other version of that phrase?
Also, you will need to purge your database because now it thinks it’s a string.
@chairstacker, it work because 1 or 0 are integers. The parser will attempt to convert to a number first.
If he adds a unit of measure, shuts off HA, clears database, and restarts HA, then it should show up as a graph. Assuming that automation.my_automation is the name of his automation.
I mean, if you don’t care about your history, just delete the file. That’s the easiest way. Sometimes purging the database doesn’t work with the service. And to be honest, you should probably delete the whole thing anyway because I’m not entirely sure if the item will be removed if you purge.
Thanks, I have deleted all home-assistant_v2.db files from /config and restarted which has cleared the history. Hopefully I’ll have a graph in a day or two, will report back!
Also, I just realized you are putting the unit_of_measure on the wrong object. It should be attached to your sensor, not in the configuration for history-graph.
Looks like 1 is set each time HA restarts, when all automations get set to on which I assume is normal behaviour. These are the only values that appear on the graph.
Thing is, I don’t want to record on the graph each time the automation is switched on I want to record each time the automation is triggered.
Hmm, if you want to record triggers, you may need to re-think this. Do you want this to record when it runs actions or triggers. Because conditions can stop it from running actions but the trigger will still occur.