Manual Input for Water not working

Hi,
I’m new to Home Assistant but i’ve added what i need so far.

But, following another topic, i’ve added manual input for energy consumption like this :
https://community.home-assistant.io/t/manual-input-for-electricity-gas-and-water-consumption/451082/5

But, if i do the same for water like this :

 - sensor:
    name: "compteureau"
    unit_of_measurement: "m³"
    state_class: total_increasing
    device_class: water
    state: "{{ states('input_number.compteur_eau') }}"

i can’t see the water counter sensor in the energy dashboard setting list.

Everything is working in the main dashboard by te way.
Capture

Could someone help me please ?
Regards

Do you have any message into logs related to that sensor because it seems to be correct in term of requirements to have the entity selectable into the settings for energy dashboard ?
Just to be sure that all the values are passing correctly, cross-check in dev tools about the entity compteureau. You should see also state_class, device_class and unit.

Is the sensor actually created? I am asking since indentation above is a bit off and this could be a cause

I don’t see any log errors related to this.
This is what i have in dev tools :

About value 205133,0842 m3, i don’t know how to reset it to zero, it was because all my testings :wink:
Even if i set the state to 0 it always revert to this bad value.

This is my yaml :

template:
 - sensor:
    name: "compteurelec"
    unit_of_measurement: "kWh"
    state_class: total_increasing
    device_class: energy
    state: "{{ states('input_number.compteur_electrique') }}"
 - sensor:
    name: "compteureau"
    unit_of_measurement: "m³"
    state_class: total_increasing
    device_class: water
    state: "{{ states('input_number.compteur_eau') }}"

why don’t you add sensor.compteur_eau to the dash… this resembles my setup,
Note that I am not sure too why the compteureau *is ‘off’ but this is not for me to analyse.

For now, i don’t have any real sensor for water and electricity. So i’d like to track my consumption manually, monthly. The only way i found is what i’ve linked in my first post.
So, each month, i can set the value of my real counter in HA.
But maybe there is another way to do that ?

I don’t understand why it’s working for electricity but not for water. Configuration is the same…

I do the same (also in France) but your compteur_eau should be sufficient the way I see it
EDIT, my sensor uses the input_number the same way, representing the values on the compteur.

repeating that I have no clue why compteureau (without underscore) is showing that but this is out of my response

Ah ok :slight_smile: Je vais pouvoir parler en Français alors ^^

Bon, je vais essayer comme tu le propose.
Tu sais comment je peut remettre à zero tous les compteur déja présent ?
C’est le grand n’importe quoi dans les valeurs :wink:

I cannot continue in French as this is a English-only forum… for French-only you can try on the Home Assistant Communauté Francophone - Communauté francophone sur Home Assistant avec des tutoriels, des articles, de l’aide, du partage. (hacf.fr)

I am not sure what you mean to reset existing counters.
If you added sensors that lead to statistics then there are following options

  • use devtools > statistics … depends a bit on what you want
  • database level, more complex
  • recreate (new) sensors … easiest

EDIT:
My setup consist of follwong

  • input_number for entering state of the compteur
  • sensor (alike yours) based on the input_number
    I can add the sensor to the energy dash without any issues

I understand for english.
I’ve deleted my database, nothing important in it for now.

I’ll try your setup. I’ll tell you. Thank you.

I’ve tried your setup with only input_number and sensor based on the input_number.
I’ve added them on the energy dashboard, setup some values but graph is empty.


I don’t know what i am doing wrong :frowning:

So the sensor is accepted by the dashboard?
Then it will take up to two hours for values to appear probably only (cannot remember) after you first changed it.

In parameter - dashboard - energy
Do you added the value like mentionned or you don’t see the value appearing when click on add button ?
image

Add source:


example:
image

@zigomatic @vingerha

If i understand correctly, what i have is :

    1. One input_number i can increment to correspond to my real counter
    1. One “template” sensor in my configuration file that is incremented by the input_number
    1. One energy sensor, created in the entity page of HA based on the previous sensor

For electricity, i can add the sensor (3) to the energy dashboard and it’s wokring. The sensor (2) is available too. Everything ok here.

For water, only the sensor (2) is available, but not the sensor (3).

The only thing i would like is to be able to manually set how much electricity or water i’ve consummed each month or week, to keep track on it.

Maybe i’m doing it wrong, or there is a better way ?

Hey @vingerha, it’s working with only sensor 1 and 3 of my previous answer. Thanks a lot :wink:

But i have one last problem…
I’ve entered actual values of my counters into HA. So, actual consumption and cost are HUGE ^^
I don’t want to calculate how much i consumed each time i enter new values.
How can i do to only enter the new counters values and make HA only calculate the difference between now and the last values ?

That’s why i need to create a counter to only calculate the difference. This is that counter that i can choose for electricity but the water counter is unavailable in energy dashboard if i do that.

For example :

  • My actual real life counter for electricity is 90500
  • Next month it’s 90900

I’d like to have a input on my dashboard with 90500 and when i set it to 90900, only the difference, so 400 is reported as comsumption for the month.
I need to avoid those huge starting numbers (90500).
I don’t want to calculate each month 90900 - 90500 = 400.

You don’t need to calculate. It’s a total_increasing state_class. HA will do for you.

Let’s try for example, change the value each hour or each day (like a sensor is doing for you).

Oh ok, didn’t knew that :slight_smile:

What about the initial counter value ?
My real counter is at 91500, because the initial cost and comsuption is bad in HA.

It’s I guess because your first input was with 0 as value and then you enter the value 91500 as starting point.
The best is to go to dev_tools → statistic: modify the initial value of your entity manualy to replace 0 by 91499

Thank you to all of you.
I’ve managed to get it working with your help.

I’ve created an input number first, then set the initial value (my real counter)
After that, created the sensor tied to the input number.

And now it’s working.