Open Roving-Ronin opened 7 months ago
Hello @Roving-Ronin, the issue comes from utility_meter
themselves. The unit is not showed properly because the device_class: monetary
is not defined like it is for the cost entity.
The builtin utility_meter
defines only energy device class, which is defined from units:
https://github.com/home-assistant/core/blob/dev/homeassistant/components/utility_meter/sensor.py#L99-L102
I can extend the builtin utility meter to prevent that. However, I doubt it is the best way to tackle this problem. I'll try to do a PR on the main component.
As a temporary workaround, you can create a template sensor which takes the same value, but for which will be able to change the class.
Hi @zeronounours
If you could PR the main (utility meter) it would be great. Just replacing utility_meter with energy_meter would be ideal ;-)
Thanks !
Version of the custom_component
v1.1.0
-->
Configuration
Describe the bug
Hi @zeronounours / Gauthier,
Whilst the 'cost' sensor that energy_meter creates/uses correctly shows the sensor value with the $ (or as an Australian user in my case, the A$ prefix), as per:
I note that by default any energy_meter sensors are being created with a suffix of the currency (AUD), such as:
Is there any way to get the energy_meter to create these sensors (tariff rates in this case) with the correct $ or even A$ prefix ?
Assuming this a 'bug' (more of an overlooked situation), same recently added feature for 'source_type', would there be a way to add a cost_sensor or is_currency feature (default: no) so when you set it to 'is_currency: yes' it will check the default currency sign of the HA installation (i.e. $ / £ / € etc) and prefix that on the displayed sensor value?