I’m pulling in data to HassIO to monitor some sensors from MQTT, I’m having a problem with some of them. On the history-graph they show as “state” bars instead of a grouped line-graph.
I’m guessing without a unit HomeAssistant thinks its not numeric and won’t graph it with a line?
Is there a list of valid unit_of_measure values? These are a measurement of count of errors, they are not really “units” per say just an integer and I don’t know what to put.
unit_of_measurement string (optional, default: None)
Defines the units of measurement of the sensor, if any. This will also influence the graphical presentation in the history visualization as a continuous value. Sensors with missing unit_of_measurement are showing as discrete values.
Ah, ok - I’ll try making something up then. I expected it had to be something that HomeAssistant “understands” - like temperature is F or C and it seems to “know” how to handle that.
I think it’s mostly the device class anyway that does it… I had a template sensor that I hadn’t got around to fixing, and just added to my yaml to get the graph to display:
unit_of_measurement: goats
device_class: power
You need to add both for it to work (the NaN is just because home-assistant is still starting after the config change).