Crall

Untitled

Feb 4th, 2026
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. Gör så här:
  2. Klicka på Skapa hjälpare -> Mall (Template) -> Malla en sensor.
  3. Döp den till t.ex. Varmvattenberäkning (10 l/min).
  4. I fältet Tillståndsmall (State template) klistrar du in koden nedan.
  5. Ställ in Måttenhet till min.
  6. Ställ in Tillståndsklass till Measurement.
  7. Kod att klistra in i "Tillståndsmall":
  8. ***************************************
  9.  
  10. {% set top = states('sensor.nibe_bt7_hw_top') | float(0) %}
  11. {% set bot = states('sensor.nibe_bt6_hw_load') | float(0) %}
  12.  
  13. {# Konstanter #}
  14. {% set tank_vol = 180 %}
  15. {% set flow_rate = 10 %}
  16. {% set cold_temp = 10 %}
  17. {% set target_temp = 40 %}
  18.  
  19. {# Beräkna snitt-temp #}
  20. {% set avg_temp = (top + bot) / 2 %}
  21.  
  22. {# Beräkning #}
  23. {% if avg_temp <= cold_temp %}
  24. 0
  25. {% else %}
  26. {% set v40 = tank_vol * (avg_temp - cold_temp) / (target_temp - cold_temp) %}
  27. {{ (v40 / flow_rate) | round(0) }}
  28. {% endif %}
  29.  
  30.  
  31. **************************************
  32.  
  33. till att sensor.nibe_bt7_hw_top och sensor.nibe_bt6_hw_load stämmer exakt med dina entity_id:n, annars får du 0 som resultat.
  34.  
Advertisement
Add Comment
Please, Sign In to add comment