Advertisement
KirboWnz

Sauna warm/cold

Mar 18th, 2023 (edited)
647
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.63 KB | None | 0 0
  1. alias: Sauna lämpötila triggerit
  2. mode: single
  3. trigger:
  4.   - platform: template
  5.     value_template: >-
  6.       {{ (states('sensor.ruuvitag_sauna_temperature') | float) < (states('input_number.sauna_kylma') | float) }}
  7.   - platform: template
  8.     value_template: >-
  9.       {{ (states('sensor.ruuvitag_sauna_temperature') | float) > (states('input_number.sauna_valmis') | float) }}
  10.     for:
  11.       minutes: 1
  12. action:
  13.   - choose:
  14.       - conditions:
  15.           - condition: template
  16.             value_template: >-
  17.               {{ (states('sensor.ruuvitag_sauna_temperature') | float) < (states('input_number.sauna_kylma') | float) }}
  18.         sequence:
  19.           - service: input_boolean.turn_off
  20.             target:
  21.               entity_id: input_boolean.sauna_valmiina
  22.       - conditions:
  23.           - condition: template
  24.             value_template: >-
  25.               {{ (states('sensor.ruuvitag_sauna_temperature') | float) > (states('input_number.sauna_valmis') | float) }}
  26.         sequence:
  27.           - service: input_boolean.turn_on
  28.             target:
  29.               entity_id: input_boolean.sauna_valmiina
  30.  
  31.  
  32.  
  33. alias: Sauna kylmä/kuuma
  34. mode: single
  35. trigger:
  36.   - platform: state
  37.     entity_id:
  38.      - input_boolean.sauna_valmiina
  39. action:
  40.   - choose:
  41.       - conditions:
  42.           - condition: state
  43.             entity_id: input_boolean.sauna_valmiina
  44.             state: "on"
  45.         sequence:
  46.           - service: script.sauna_lammin
  47.       - conditions:
  48.           - condition: state
  49.             entity_id: input_boolean.sauna_valmiina
  50.             state: "off"
  51.         sequence:
  52.           - service: script.sauna_kylma
  53.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement