fix state check
This commit is contained in:
@@ -211,11 +211,17 @@ variables:
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
{{ remote_temperature_entity_id.id }}
|
{{ remote_temperature_entity_id.id }}
|
||||||
current_remote_temperature: >
|
current_remote_temperature: >
|
||||||
{% if remote_temperature_entity and remote_temperature_entity in states %}
|
{% if remote_temperature_entity and states(remote_temperature_entity) not in ['unknown', 'unavailable', none]%}
|
||||||
{{ states(remote_temperature_entity) | float(0) }}
|
{{ states(remote_temperature_entity) | float(0) }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ 0 }}
|
{{ 0 }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
remote_temperature_last_change: >
|
||||||
|
{% if remote_temperature_entity and states(remote_temperature_entity) not in ['unknown', 'unavailable', none] %}
|
||||||
|
{{ states[remote_temperature_entity].last_changed }}
|
||||||
|
{% else %}
|
||||||
|
{{ none }}
|
||||||
|
{% endif %}
|
||||||
window_detection_entity: >
|
window_detection_entity: >
|
||||||
{% set entities = device_entities(device_id(trv)) %}
|
{% set entities = device_entities(device_id(trv)) %}
|
||||||
{% set window_detection_entity_id = namespace(id='') %}
|
{% set window_detection_entity_id = namespace(id='') %}
|
||||||
@@ -315,17 +321,11 @@ variables:
|
|||||||
0
|
0
|
||||||
{% endif %}
|
{% endif %}
|
||||||
override_last_change: >
|
override_last_change: >
|
||||||
{% if setpoint_change_source_entity and setpoint_change_source_entity in states %}
|
{% if setpoint_change_source_entity and states(setpoint_change_source_entity) not in ['unknown', 'unavailable', none] %}
|
||||||
{{ states[setpoint_change_source_entity].last_updated }}
|
{{ states[setpoint_change_source_entity].last_updated }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ none }}
|
{{ none }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
remote_temperature_last_change: >
|
|
||||||
{% if remote_temperature_entity and remote_temperature_entity in states %}
|
|
||||||
{{ states[remote_temperature_entity].last_changed }}
|
|
||||||
{% else %}
|
|
||||||
{{ none }}
|
|
||||||
{% endif %}
|
|
||||||
override_duration_exceeded: >
|
override_duration_exceeded: >
|
||||||
{% if override_last_change and override_reset_duration_seconds > 0 and setpoint_change_source_entity and states(setpoint_change_source_entity) == 'manual' %}
|
{% if override_last_change and override_reset_duration_seconds > 0 and setpoint_change_source_entity and states(setpoint_change_source_entity) == 'manual' %}
|
||||||
{% set elapsed = (now() - override_last_change).total_seconds() %}
|
{% set elapsed = (now() - override_last_change).total_seconds() %}
|
||||||
|
|||||||
Reference in New Issue
Block a user