I encounter a problem I can’t seem to be able to solve regarding units in HA. Consider my configuration :
sensor:
- platform: systemmonitor
resources:
- type: packets_in
arg: enp3s0
- platform: statistics
entity_id: sensor.packets_in_enp3s0
name: packets_daily
max_age:
days: 1
- platform: template
sensors:
packets_daily:
unit_of_measurement: "" #HERE
value_template: >-
{{ states.sensor.packets_daily_mean.attributes.change | float }}
I get the following result in the Lovelace UI and the history component :
I was wanting a graph of the evolution of it but apparently there’s a problem here.
I found out that if this is caused by the units not being recognized. I can eventually make this work using "°"
as unit but this is very ugly. I was wanting to either use "packets"
or just nothing as this value is unitless.
I couldn’t find in HA’s source code the place where the units are handled and recognized and even the list of them.
I would be very grateful for any indication of where to find more information so I can submit a fix to this.