Advertisement
KirboWnz

Sauna valmis -template sensor

Mar 19th, 2023 (edited)
1,433
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.76 KB | None | 0 0
  1. template:
  2.   - sensor:
  3.       - name: "Sauna valmis"
  4.         unit_of_measurement: "min"
  5.         state: >-
  6.           {% set living_room_temp = states('sensor.ruuvitag_olohuone_temperature')|float|round(1, default=0) %}
  7.           {% set sauna_temp = states('sensor.ruuvitag_sauna_temperature')|float|round(1, default=0) %}
  8.           {% set target = states('input_number.sauna_valmis')|float|round(1, default=0) %}
  9.           {% set change = states('sensor.sauna_temperature_change_per_hour')|float|round(1, default=0) %}
  10.           {% set eta = ((target - sauna_temp) * 60 / change)|round(0, default=0) %}
  11.  
  12.           {% if (sauna_temp - 5) > living_room_temp and sauna_temp < target and eta < 120 %}
  13.           {{ eta }}
  14.           {% else %}
  15.           0
  16.           {% endif %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement