Advertisement
seston

home assistant soojuspumba juhtimine

Sep 18th, 2022 (edited)
1,019
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.14 KB | None | 0 0
  1. automation Soojuspumba juhtimine:
  2.     initial_state: 'on'
  3.     alias: Soojuspumba juhtimine
  4.     trigger:
  5.       - platform: state
  6.         entity_id: binary_sensor.pumba_taimer
  7.         to: 'on'
  8.       - platform: state
  9.         entity_id: binary_sensor.pumba_taimer
  10.         to: 'off'
  11.     action:
  12.       - service_template: 'switch.turn_{{trigger.to_state.state}}'
  13.         entity_id: switch.soojuspump
  14.  
  15. automation Soojuspumba juhtimine2:
  16.     alias: kontroll
  17.     trigger:
  18.       - platform: time
  19.         at:
  20.        - '00:01:00'
  21.     condition:
  22.       condition: state
  23.       entity_id: binary_sensor.pumba_taimer
  24.       state: "on"
  25.     action:
  26.       - service: 'switch.turn_on'
  27.         entity_id: switch.soojuspump
  28.   - binary_sensor:
  29.       - name: pumba taimer
  30.         unique_id: pumba taimer
  31.         state: >-
  32.           {% set l=state_attr('sensor.nordpool_mwh_ee_eur_3_10_02', 'raw_today')|sort(attribute='value') %}
  33.           {% set t = now() %}
  34.           {% for i in range(states('sensor.heatrequest')|int) %}
  35.             {% if (t >= l[i].start and t <= l[i].end) %}
  36.               {{ true }}
  37.             {% endif %}
  38.           {% endfor %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement