ariston-aqua-remotethermo-home-assistant icon indicating copy to clipboard operation
ariston-aqua-remotethermo-home-assistant copied to clipboard

How make energy Use readable for home assistant

Open uowis opened this issue 2 years ago • 10 comments

Is there a way to put the value of consumption into Hass energy dashboard ? Thanks for your plugin working since 2 year now and fully use !

uowis avatar Jul 26 '22 08:07 uowis

I've opened a while ago request for more nice energy measurement but it's a bit of hassle to implement in the code. So I thought how to do it on HA template level and this is what I figured out for the daily energy:

 - platform: template
   sensors:
     boiler_daily_energy:
        friendly_name: "Boiler daily energy"
        value_template: >-
            {% if is_state('binary_sensor.aqua_ariston_online', 'on') %}
                {% set ns = namespace(total = 0) %}
                {% for count in range(0,12) %}
                    {% set count = count+1 %}
                    {% set current =  state_attr('sensor.aqua_ariston_energy_use_in_the_last_day','Period' + count|string)  %}
                    {% set ns.total = ns.total + current  %}
                {% endfor %}
                {{ns.total| round(2)}}
            {% endif %}
        availability_template: "{{ state_attr('sensor.aqua_ariston_energy_use_in_the_last_day','Period1') != None}}"
        unit_of_measurement: "kWh"

The other entities (weekly, monthly) can be made with another sensors as well if wanted. The purpose of this template is to have historical data which can be reset at midnight and have a real energy measurement for a day and not like now the 24h interval energy consumption (which in my opinion is useless for data gathering).

surenz avatar Jul 26 '22 08:07 surenz

Oh ty ! I will test this template sensor !

uowis avatar Aug 06 '22 11:08 uowis

In another integration (https://github.com/chomupashchuk/ariston-remotethermo-home-assistant-v2/blob/master/custom_components/ariston/sensor.py) you may see different class being specified for energy use and that class works better with energy statistics like "today". I do not maintain this integration, but if someone would make updates on separate branch and make a pull request, I could approve it.

chomupashchuk avatar Sep 08 '22 14:09 chomupashchuk

I have a Lydos Wifi 100. I'll check this out, maybe adding state_class and last_reset to the sensors would help.

ZsBT avatar Oct 05 '22 19:10 ZsBT

I finally choose to create te entity with caclul with time to heat :

  - trigger:
      - platform: time_pattern
        # This will update every minutes
        minutes: "*"
    sensor:
      - name: "Ariston Velis Energy Timebased"
        state:  >
          {% if is_number(states("sensor.ariston_velis_energy_timebased")) %}
            {{ states("sensor.ariston_velis_energy_timebased") | float + is_state("binary_sensor.aqua_ariston_heating", "on") | abs * 1/60 * 1.5  }}
          {% endif %}
        unit_of_measurement: 'kWh'    
        device_class: energy 
        state_class: total_increasing

uowis avatar Oct 28 '22 13:10 uowis

I've opened a while ago request for more nice energy measurement but it's a bit of hassle to implement in the code. So I thought how to do it on HA template level and this is what I figured out for the daily energy:

 - platform: template
   sensors:
     boiler_daily_energy:
        friendly_name: "Boiler daily energy"
        value_template: >-
            {% if is_state('binary_sensor.aqua_ariston_online', 'on') %}
                {% set ns = namespace(total = 0) %}
                {% for count in range(0,12) %}
                    {% set count = count+1 %}
                    {% set current =  state_attr('sensor.aqua_ariston_energy_use_in_the_last_day','Period' + count|string)  %}
                    {% set ns.total = ns.total + current  %}
                {% endfor %}
                {{ns.total| round(2)}}
            {% endif %}
        availability_template: "{{ state_attr('sensor.aqua_ariston_energy_use_in_the_last_day','Period1') != None}}"
        unit_of_measurement: "kWh"

The other entities (weekly, monthly) can be made with another sensors as well if wanted. The purpose of this template is to have historical data which can be reset at midnight and have a real energy measurement for a day and not like now the 24h interval energy consumption (which in my opinion is useless for data gathering).

Hey there, sorry to resurrect this. Thanks for sharing this. Although, I did try to add it to the energy consumption without any success. Is there something else you had to do aside from adding this to the configuration.yaml?

davidrpfarinha avatar Jul 07 '23 22:07 davidrpfarinha

Nope, it should count the kWh for the current day starting at midnight. The only thing to do is to enter the entity in your preferred card. I'm using it in apexchart-card image

surenz avatar Jul 12 '23 12:07 surenz

Nope, it should count the kWh for the current day starting at midnight. The only thing to do is to enter the entity in your preferred card. I'm using it in apexchart-card image

Thanks, @surenz. Now the data makes more sense, although it is not 100% accurate with what their app reports.

Nevertheless, I was trying to add these details to the Energy Dashboard, but that type of info needed to be corrected. I need to review the code to see if I can make it report just that wanted data.

davidrpfarinha avatar Jul 12 '23 13:07 davidrpfarinha

Their app has no week report but this integration has this entity and the graphics here (daily consumption) correlate with the data from the weekly energy metering entity.

surenz avatar Jul 12 '23 13:07 surenz

Actually, @surenz, the one that I'm using (Ariston NET) does have it, see screenshot below. image

This is my chart, based on your details. image

davidrpfarinha avatar Jul 12 '23 14:07 davidrpfarinha