Open mfarad opened 1 year ago
You told that you converted a value to kW. But according to your pictures, it was in kW (left picture) -> then became something x1000 (right picture) w/o a unit. Seems some info is clipped since you preferred to display the card with a narrow width.
Anyway, see not issues here:
1) Sensor with device_class: power
& UoM="W":
state is shown in "W", graph is shown in "W":
type: custom:mini-graph-card
entities:
- sensor.testing_device_class_power
points_per_hour: 480
hours_to_show: 0.083333
lower_bound: 0
line_width: 3
smoothing: false
show:
labels: true
2) UoM changed to "kW": state is shown in "kW", graph is shown in "kW":
Ofc data in DB (numbers) are still same w/o conversion to the new UoM.
The very same happens with a standard history-graph
:
If we consider this behaviour as a bug - then we should consider a behaviour of history-graph
also incorrect.
https://github.com/home-assistant/frontend/issues/19468
So, let's wait for a feedback from HA dev team. If they say that this is an intended behaviour - then probably we will have to suspend this issue as well.
Imho a recalculation of previous points should only be done for sensor
entities with defined UoM (belonging to the device_class
). For other entities & when no device_class
is specified - no recalculation should be done.
If we have an entity providing value in watts and we change his unit of measurement (by ex: in kW), the value displayed in the card is correct (kW) but the graph (+color_thresholds) is still based on the original value (watts).
Card:
Entity: