Aohzan / ipx800

IPX800 V4 integration for Home-Assistant
Apache License 2.0
20 stars 12 forks source link

Water - Energy support #41

Closed anktababa closed 10 months ago

anktababa commented 10 months ago

Hi,

First, i am not sure used to HA yet so i might be wrong, if that's the case, sorry :)

I am using IPX800V4 to count the water consumption. Using the GCE Pulse counter, 1 Pulse = 1 Liter Thanks to your integration, i have in HA the entities (sensor.compteur_eau, type : counter, unit_of_measurement: "L")

I am trying to add Water to the energy tab of HA but it is not possible to use it ;

"No matching statistics found"

Open an issue with the author of the integration and link them to (https://developers.home-assistant.io/docs/core/entity/sensor#long-term-statistics).

is it something that is possible ?

Thank you.

Aohzan commented 10 months ago

Hello You have to use a template, like

---
template:
  - sensor:
      - name: "Compteur eau Total"
        unit_of_measurement: "m³"
        device_class: water
        state_class: total_increasing
        state: "{{ (states('sensor.compteur_eau') | int) / 1000 }}"
        unique_id: compteur_eau_total

in my example, I have to divide by 1000

anktababa commented 10 months ago

Hello,

You made my day, nothing else to add.

You fixed my issue and allow me to discover template on HA. Now this is working. Sorry as it was not an issue on your side.

Bonne journée.