Template sensor: multiple and AND or conditions
0
value_template: >-
{% if is_state('input_boolean.bewasserung_ein', 'on') and is_state('sensor.wetter_sensor_rain', 'not raining') %}
{% if is_state('sensor.season', 'spring') or is_state('sensor.season', 'summer') %}
{% if states('sensor.wetter_sensor_condition')|regex_search("regen", ignorecase=True) %}
True
{% endif %}
{% endif %}
{% endif %}
value_template: >
{{ states('input_boolean.bewasserung_ein') == 'on'
and states('sensor.wetter_sensor_rain') != 'raining'
and ('Regen' not in states('sensor.wetter_sensor_condition'))
and ('summer' in states('sensor.season') or 'spring' in states('sensor.season'))
}}
action:
- alias: Living room toilet/01
if:
- condition: and
conditions:
- condition: template
value_template: |-
{{ (as_timestamp(now()) -
as_timestamp(states.binary_sensor.aqara_motion_sensor_t1_cn_version_rtcgq12lm_no3.last_changed))
> 60 *5 }}
- condition: template
value_template: |-
{{ (as_timestamp(now()) -
as_timestamp(states.binary_sensor.aqara_high_accuracy_sensor_cn_version_rtcgq13lm.last_changed))
> 60 *5 }}
{# Living room toilet 5分钟未检测到人,关灯 #}
then:
- service: light.turn_off
metadata: {}
data: {}
target:
entity_id: light.aqara_hub_m1s_edb6_lightbulb
- alias: Zeit/02