alias: Ballons ter
description: Chauffe du ballon d'eau chaude en fonction de la production solaire
triggers:
  - seconds: /30
    trigger: time_pattern
conditions:
  - condition: sun
    before: sunset
    after: sunrise
actions:
  - choose:
      - conditions:
          - condition: numeric_state
            entity_id: sensor.temp_petit_ballon
            above: 56
        sequence:
          - action: switch.turn_off
            data: {}
            target:
              entity_id: switch.plug_158d00032d853a
          - delay:
              minutes: 5
      - conditions:
          - condition: numeric_state
            entity_id: sensor.sb3_6_1av_40_826_pv_power
            above: 1000
          - condition: numeric_state
            entity_id: sensor.routeur_rms_puissance_m_soutiree
            below: 50
        sequence:
          - action: switch.turn_on
            data: {}
            target:
              entity_id: switch.plug_158d00032d853a
      - conditions:
          - condition: or
            conditions:
              - condition: numeric_state
                entity_id: sensor.sb3_6_1av_40_826_pv_power
                below: 900
              - condition: numeric_state
                entity_id: sensor.routeur_rms_puissance_m_soutiree
                above: 150
        sequence:
          - action: switch.turn_off
            data: {}
            target:
              entity_id: switch.plug_158d00032d853a
mode: single
