Skip to content

Commit

Permalink
Manually handle availability
Browse files Browse the repository at this point in the history
  • Loading branch information
golles committed Sep 11, 2023
1 parent 961e1f3 commit 1ed9be3
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions packages/climate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,21 +146,13 @@ template:
| map(attribute="attributes.current_temperature")
| sort
%}
{% if -1 < temps[0] - temps[-1] < 1 %}
{% if temps | count < 2 %}
unknown
{% elif -1 < temps[0] - temps[-1] < 1 %}
{{ temps[-1] ~ " °C" }}
{% else %}
{{ temps[0] ~ " - " ~ temps[-1] ~ " °C" }}
{% endif %}
availability: >-
{{
states.climate
| selectattr('attributes.current_temperature', 'defined')
| map(attribute="attributes.current_temperature")
| list
| count
| default(0)
> 2
}}
automation:
- id: tado_auto_home_and_away_mode
Expand Down

0 comments on commit 1ed9be3

Please sign in to comment.