Skip to content

Instantly share code, notes, and snippets.

@artkrz
Last active November 21, 2020 21:43
Show Gist options
  • Save artkrz/2fa58aadfb36f8aded81631a90997190 to your computer and use it in GitHub Desktop.
Save artkrz/2fa58aadfb36f8aded81631a90997190 to your computer and use it in GitHub Desktop.
TS0601 calibration based on remote sensor.
- alias: Heating office calibrate temperature
trigger:
platform: state
entity_id: sensor.multisensor_office_temperature
condition: "{{ (states('sensor.multisensor_office_temperature')|float - state_attr('climate.thermostat_office_climate','current_temperature')|float)|round(1,'half') != 0 }}"
action:
- service: mqtt.publish
data_template:
topic: 'zigbee2mqtt/thermostat_office/set/local_temperature_calibration'
payload_template: >-
{% if (states("sensor.multisensor_office_temperature")|float - state_attr("climate.thermostat_office_climate","current_temperature")|float)|round(1,"half") >= 0 %}
{{ (states("sensor.multisensor_office_temperature")|float - state_attr("climate.thermostat_office_climate","current_temperature")|float)|round(1,"half") }}
{% else %}
{{ 128 - (states("sensor.multisensor_office_temperature")|float - state_attr("climate.thermostat_office_climate","current_temperature")|float)|round(1,"half")|abs }}
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment