mirror of
https://github.com/Laxilef/OTGateway.git
synced 2025-12-11 18:54:28 +05:00
upd ha scripts
This commit is contained in:
32
assets/ha/report_temp_to_controller.yaml
Normal file
32
assets/ha/report_temp_to_controller.yaml
Normal file
@@ -0,0 +1,32 @@
|
||||
# Script for reporting indoor/outdoor temperature to the controller from any home assistant sensor
|
||||
# Updated: 28.11.2023
|
||||
|
||||
alias: Report temp to controller
|
||||
description: ""
|
||||
variables:
|
||||
# The source sensor from which we take the temperature
|
||||
source_entity: "sensor.livingroom_temperature"
|
||||
|
||||
# Target entity number where we set the temperature
|
||||
# To report indoor temperature: number.opentherm_indoor_temp
|
||||
# To report outdoor temperature: number.opentherm_outdoor_temp
|
||||
target_entity: "number.opentherm_indoor_temp"
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: "{{ source_entity }}"
|
||||
- platform: time_pattern
|
||||
seconds: /30
|
||||
condition:
|
||||
- condition: template
|
||||
value_template: "{{ has_value(source_entity) and has_value(target_entity) }}"
|
||||
action:
|
||||
- if:
|
||||
- condition: template
|
||||
value_template: "{{ (states(source_entity)|float(0) - states(target_entity)|float(0)) | abs | round(2) >= 0.01 }}"
|
||||
then:
|
||||
- service: number.set_value
|
||||
data:
|
||||
value: "{{ states(source_entity)|float(0)|round(2) }}"
|
||||
target:
|
||||
entity_id: "{{ target_entity }}"
|
||||
mode: single
|
||||
Reference in New Issue
Block a user