Aohzan / ecodevices

Home Assistant custom component for GCE Eco-Devices
Apache License 2.0
14 stars 4 forks source link

Gas consumption ? #12

Closed edelans closed 2 years ago

edelans commented 3 years ago

Hello @Aohzan !

Thanks 🙏

First of all, I want to say thanks for your plugin, I'm super happy to have found it, it works like a charm.

Request

I have a "compteur gazpard" in my house, that I successfully integrated with my ecodevice :

CleanShot 2021-09-08 at 09 15 06

and into HA thanks to your plugin :

CleanShot 2021-09-08 at 09 10 49@2x

But I cannot use this entity to configure the gas consumption in the energy settings :

CleanShot 2021-09-08 at 09 06 39@2x

While I could configure the data from the linky (teleinfo) in the electricity tracking panel of the energy dashboard.

By any chance, do you know how I can make this work ?

Thanks again !

-- btw, I don't remember where I saw that (old gh profile maybe ?), but I think you live in Rennes (me too !) : if it's still the case, I'll be glad to offer you a beer 🍻

Aohzan commented 3 years ago

Hi ! I think you must set as unit of measurement for the Meter 2 Total. It's not possible to set a different unit between the daily and total sensor currently for meter entities. Temporary you can do it with https://www.home-assistant.io/docs/configuration/customizing-devices/#manual-customization I will add the feature shortly

(ok for the beer :grin:)

edelans commented 3 years ago

ok, FWIW, I made it work by creating a new sensor by adding the following lines in my configuration.yaml file :

template:
  - sensor:
      name: Gas Consumption m3
      state: >-
        {{ states('sensor.gaz')|float / 1000 }}
      icon: mdi:fire
      unit_of_measurement: "m³"
      state_class: "total_increasing"
      device_class: "gas"

I shoot you an email for the beer ;)

edelans commented 3 years ago

Improvement : as I encountered the same problem as in https://github.com/Aohzan/ecodevices/issues/13 with some zero values wreaking havoc in the gas consumption dashboard, I also embedded a filter to only keep increasing values in the new sensor :

template:
  - sensor:
      name: Gas Consumption m3 increasing only
      state: >
        {% if states('sensor.gaz') > states('sensor.gas_consumption_m3_increasing_only') %}
          {{ states('sensor.gaz') | float(states('sensor.gas_consumption_m3_increasing_only' * 1000)) / 1000 }}
        {% else %} 
          {{ states('sensor.gas_consumption_m3_increasing_only') }}
        {% endif %}
      icon: mdi:fire
      unit_of_measurement: "m³"
      state_class: "total_increasing"
      device_class: "gas"
Aohzan commented 3 years ago

Hi, You can now define a different unit of measurement for the total sensor : https://github.com/Aohzan/ecodevices/tree/2.5.0b

Aohzan commented 2 years ago

fix in last 3.0.0 version