The project provides a MQTT-based sensor, which provides the current value of my water meter. (I have used the MQTT auto discovery to include the sensor data into home assistant.)
I have tried to add the utility meter to the energy dashboard, but the helper is not available. I am guessing, this is because of the missing device_class?
If yes, how do I add the device class to the helper?
Is there an easy way to convert the m3 to litres or do I need to set up a template sensor for that?
I ended up creating my own template sensor for my water meter. I am converting from m3 to L.
# AI on the Edge: ausgelesene Werte von m3 in L umwandeln.
- sensor:
- name: "Watermeter in l"
unique_id: watermeter_in_l
icon: "mdi:gauge"
state: "{{ states('sensor.watermeter_value')|float(default=0) * 1000 }}" # Convert 1 m3 => 1000 l
unit_of_measurement: L
device_class: water
state_class: total_increasing
availability: "{{ states('sensor.watermeter_value') not in ['unknown', 'unavailable', 'none'] }}"
As the AI-on-the-Edge-Project should provide only increasing values, I was wondering, of “state_class: total_increasing” was correct? I will keep it like this and check in a couple of days, if values are okay in HA.
Well, my solution with the conversion from m3 to L is working fine. I did not try to solve the original question anymore, as I want to have it in liters anyway.
I actually ran into another post with the same issue, and had to modify two files in HA to get it to work. I replied to that thread so if anyone is interested, check my post history.
for ease of use: in a couple of months, it will not be very easy to find the topic you found the solution in. Could you post the link to the post, that solved it for you?