Hello,
I have a Zigbee sensor connected to the pulse output of my gaz meter (following french article Home Assistant: récupération Gazpar - AutoDomo).
I get a ‘gaz_counter’ entity that increments every 0.1 m3.
I have template configured as follow:
template:
- sensor:
- name: Gaz Energy
unit_of_measurement: "m³ "
state: "{{ states('input_number.gaz_counter') | int / 1000 | round(3) }}"
device_class: gas
state_class: total_increasing
When I add the ‘gaz_energy’ template to the Energy dashboard, I get an error saying that the sensor has an unexpected unit. I don’t really get why this is happening.
You can check this sensor in Developer tools states to see what does this provide.
Are you sure you don’t need to put in template.yaml for this sensor something like
It is not necessary but open that entity and you will see.
It takes some time for energy dashboard to pick up state of that sensor. I think it should. Leave it for 2 hours. If it doesnt maybe you put wrong one in energy dashboard.
I’m not exactly sure how I can make sure to insert a m3 as UTF-8 character. For this, I copied the 3 from an online website (something like “³” U+00B3 Superscript Three Unicode Character) and when I pasted it got the space.
I tried removing it but I still get the same error message about the unit even after reboot of Home Assistant.
Go to Developer Tool – Statistics and look it up there to see if it gives any errors. You may have past data (either that space or something else) that’s got the wrong or different unit.