As I did not find a comprehensive description on how to work with a manual input for water consumption in the energy dashboard, this works:
An input-helper records the ever increasing total of the water meter:
A template sensor reads that input, stores the data and makes it available to the dashboard:
template:
sensor:
- name: meter_wasser_bad
state: "{{ states.input_number.meter_wasser_bad.state }}"
unit_of_measurement: "m³"
state_class: total_increasing
device_class: water
5 Likes
Menthe
(Menthe)
November 3, 2022, 7:36pm
2
I have the same helper created a few days ago and now created the same template sensor with device_class: water.
But I can’t add this to my energy dashboard. In the statistics menu are values.
Menthe
(Menthe)
November 3, 2022, 9:02pm
4
This is my template sensor:
- name: "Wasserzähler"
unit_of_measurement: "m3"
state: "{{ states.input_number.wasserzahler.state | round(3) }}"
state_class: total_increasing
device_class: water
The entity has the correct value and it shows the correct value when tried in dev-tools.
How often does the statistics job run?
Please try to switch
unit_of_measurement: "m3"
to
unit_of_measurement: "m³"
(Superscript 3)
1 Like
Menthe
(Menthe)
November 3, 2022, 9:36pm
6
Yeah… now it is available, I shouldn’t have created the sensor on my ipad
Thanks for your help
2 Likes
New-Bee
(Jan)
November 8, 2022, 1:37pm
7
Hi,
I hope you can help me too.
I made two Number-Helper (both have the same problem).
Number-Helper:
Sensor:
- name: meter_wasser_erlenbach
state: "{{ states.input_number.meter_wasser_erlenbach }}"
unit_of_measurement: "m³"
state_class: total_increasing
device_class: water
My Output in dev-tools / template:
<template TemplateState(<state input_number.meter_wasser_erlenbach=33.0004; initial=None, editable=True, min=0.0, max=99999.0, step=0.0001, mode=box, unit_of_measurement=m³, icon=mdi:water, friendly_name=meter_wasser_erlenbach @ 2022-11-08T14:29:45.677281+01:00>)>
The Number has values, the sensor has no values.
Any Ideas?
New-Bee
(Jan)
November 8, 2022, 2:45pm
8
For me, this is the correct sensor code:
- name: meter_wasser_erlenbach
state: "{{ states('input_number.meter_wasser_erlenbach') |float}}"
unit_of_measurement: "m³"
state_class: total_increasing
device_class: water
Try
state: "{{ states.input_number.meter_wasser_erlenbach.state }}"
states.input_number.meter_wasser_erlenbach
ist the complete object that is displayed in the devtools while you sensor only needs the number in .state
.
2 Likes
New-Bee
(Jan)
November 9, 2022, 7:58am
10
Sorry…I thougth I copied your code 1:1…
Marco94
(Marco)
December 30, 2022, 9:09pm
11
the value in the input sensor are added together in the energy area
Is there a solution for this?
The purpose of water in the energy dashboard seems to be to track the source utility-meters, not individual devices. For this usecase summing the sensors is the way to track your consumption.
There is no extra tracking individual devices like for electrical power.
Marco94
(Marco)
December 31, 2022, 11:20am
13
okay, i already thought so and removed it from energie, what does your solution look like?
do you use it as a history card?
like this:
Actually, I only have two source- meters so that’s no worry for me.
If I had, I’d probably use the apex-chart card from hacs. (Provided, that it can access the long term stats, didn’t check)
1 Like
I am doing something wrong… I get errors (I put this in sensors.yaml)
Besides the names but I first want the formatting right…
- platform: template
sensors:
meter_wasser_erlenbach: Missing property "value_template"
state: "{{ states('input_number.meter_wasser_erlenbach') |float}}" Property state is not allowed.
unit_of_measurement: "m³"
state_class: total_increasing
device_class: water
I’d first like to say big thanks to @elfrinjo for sharing this! This is exactly what I was looking for.
To @ehorsting1982 what if you change meter_wasser_erlenbach:
to name: "meter_wasser_erlenbach"
?
I got it right this time. Not yet seeing anything on the energy dashboard, but I will give it some time.