Integration (Riemann sum) - value only updating when source sensor updates

Adding a dummy attribute-template that changes on every update (time based) to the sensor will at least cause an update on every interval:

  - trigger:
      - platform: time_pattern
        minutes: "/1"
    sensor:
      - name: home_calc_base_power
        unique_id: home_calc_base_power
        unit_of_measurement: "W"
        device_class: power
        state_class: measurement
        icon: mdi:flash
        state: |
          {% set consumer = {
              'fridge':0.4,
              'boiler':0.6,
              'media':0.0,
              'network':0.0,
              'ventilator':0.0,
              'sculpture':1.3,
              'shelly1':4*0.0,
              'shelly25':2*0.0,
              'shellyRGBW':1*0.0,
              'shellyDimmer':2*0.0,
              'sonoff':2*0.0
             } 
          %}
          {{ (consumer.values()|map('float',0)|sum)|round(2) }}
        attributes: 
          triggered_at: "{{ now() }}"

Not sure if this will be enough for the integration-sensor to reevaluate thou, as the state did not change.

2 Likes