Update tado docs; added default for float in example (#20843)

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
balk77 2021-12-27 10:15:37 +01:00 committed by GitHub
parent a29b3b4983
commit 56f33bf2c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -178,13 +178,13 @@ automation:
- sensor.temp_sensor_room
- sensor.tado_temperature
# Check if the room temp is more than 0.5 higher than the tado thermostat reading
# Check if the room temp is more than 0.5 away from the tado thermostat reading condition. The sensors default to room temperature (20) when the reading is in error:
condition:
- condition: template
value_template: >
{% set tado_temp = states('sensor.tado_temperature')|float %}
{% set room_temp = states('sensor.temp_sensor_room')|float %}
{{ (tado_temp - room_temp) > 0.5 }}
{% set tado_temp = states('sensor.tado_temperature')|float(20) %}
{% set room_temp = states('sensor.temp_sensor_room')|float(20) %}
{{ (tado_temp - room_temp) | abs > 0.5 }}
# Work out what the new offset should be (tado temp less the room temp but add the current offset value) and turn that to a negative value for setting as the new offset
action:
@ -193,9 +193,9 @@ automation:
entity_id: climate.tado
data:
offset: >
{% set tado_temp = states('sensor.tado_temperature')|float %}
{% set room_temp = states('sensor.temp_sensor_room')|float %}
{% set tado_temp = states('sensor.tado_temperature')|float(20) %}
{% set room_temp = states('sensor.temp_sensor_room')|float(20) %}
{% set current_offset = state_attr('climate.tado', 'offset_celsius') %}
{{ (-(tado_temp - room_temp) + current_offset)|round }}
{{ (-(tado_temp - room_temp) + current_offset)|round(1) }}
```
{% endraw %}