Closed eckerse closed 2 months ago
can you please be so kind and let me know from which internal or custom integration your "other" sensors are coming from [where this unit adjustment & convert process is working]? TIA
For example I'm getting sensor data from EVCC via MQTT:
unique_id: uniqueid__evcc_pc_power_w
icon: mdi:home-lightning-bolt-outline
state_topic: "evcc/site/pvPower"
value_template: "{{ value | round(1) }}"
unit_of_measurement: "W"
device_class: "power"
state_class: measurement
availability_topic: "evcc/status"
But also the sensors from official tibber app work correctly, their settings are the same as in tibber_local - thatswhy I don't really understand the difference
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=UnitOfPower.WATT,
the difference (currently) is, that (all my) integration have it's own implementation of the state method - while default sensor state implementation will handle all the possible convert processes, they will currently not applied in my Sensor implementation - solution would be implement a different "base" method in my sensor's... -> this will take a while
Thanks for clarification, I was not so deep in this topic. This would be something 'nice to have', but currently more cosmetical. Another sideeffect would be that kWh and Wh entities would actually be the same.
solved with release 2024.9.0
Checklist
Add a description
I can not convert the unit of measurement for display e.g. from W to kW - it will show the same raw numeric value with different unit but not devide by 1k. For example for 500W, if setting the unit to kW, it will display 500kW instead of 0,5kW. For other sensors I'm using it works. I have a custom mqtt sensor where I set
unit_of_measurement: "W"
- here in lovelace the automatic conversion works.I tried to look at the sourcecode but can not really see a difference in const.py in comparison to other sensors.
native_unit_of_measurement=UnitOfPower.WATT
looks correct to me.Add your DEBUG log output