Sum of four input for activation

alias: example 
description: esubero potenza di 40w di 4 linee per 10 secondi
trigger:
  - platform: template
    value_template: >-
      {{ expand('sensor.shellypro4pm_ec62609fd5b0_switch_0_power',
        'sensor.shellypro4pm_ec62609fd5b0_switch_1_power',
        'sensor.shellypro4pm_ec62609fd5b0_switch_2_power',
        'sensor.shellypro4pm_ec62609fd5b0_switch_3_power')
         | map(attribute='state') | map('float',0) | sum > 40 }}
    for: '00:00:10'
condition: []
action:
  - repeat:
      count: 2
      sequence:
        - device_id: xxxxxxxxxxxxxxxxxxx
          domain: mobile_app
          type: notify
          message: esubero potenza
          title: esubero potenza 40w
        - delay: '00:00:30'
mode: single

Reference: Repeat

1 Like