tetienne / veolia-custom-component

Home Assistant custom component to retrieve information from Veolia
MIT License
9 stars 9 forks source link

Energy dashboard integration #46

Open leauhiic opened 4 months ago

leauhiic commented 4 months ago

Hi, The plugin is awesome. The only missing part for me is the availability to add the sensor in the EnergyDashboard.

Do you think it is possible? Or maybe, you have a solution to easily create a sensor which has the correct parameters and take the value of your sensor?

Thank you for your help!

bbadrignans commented 2 months ago

You can create a template sensor like this :

template:
  - sensor:
      - name: "water_monthly"
        state: >
          {{ ( ( states("sensor.veolia_monthly_consumption") | float ) ) }}
        unit_of_measurement: "L" 
        icon: mdi:water
        state_class: total_increasing
        unique_id: "water_monthly"
        device_class: "water"
        attributes:
           last_reset: '1970-01-01T00:00:00+00:00'

Then you can add it to your energy dashboard. However, Veolia data comes with a delay of 2 or 3 days. So your dashboard will not display the data with the correct date (for instance, it shows today my water consumption from June 29th). This may be fixed by using this project, and by modifying veolia-custom-component code.