SaLvAtoOo
Supremacy Member
- Joined
- Sep 2, 2000
- Messages
- 5,815
- Reaction score
- 17
K. Tks very much! Will look into it.
An example for your reference:
Code:
- alias: Balcony Motion Turn On Light
trigger:
platform: state
entity_id: binary_sensor.motion_sensor_158d0001d90b27
from: 'off'
to: 'on'
condition:
condition: and
conditions:
- condition: state
entity_id: switch.wall_switch_ln_left_158d0002b73ca8
state: 'off'
- condition: or
conditions:
- condition: sun
after: sunset
after_offset: "-00:30:00"
- condition: sun
before: sunrise
before_offset: "00:15:00"
action:
- service: switch.turn_on
entity_id: switch.wall_switch_ln_left_158d0002b73ca8
- wait_template: "{% if states.binary_sensor.motion_sensor_158d0001d90b27.attributes['No motion since'] | int >= 180 and states.binary_sensor.motion_sensor_158d0001d90b27.state == 'off' %}True{% else %}False{% endif %}"
- condition: state
entity_id: switch.wall_switch_ln_left_158d0002b73ca8
state: 'on'
- service: switch.turn_off
entity_id: switch.wall_switch_ln_left_158d0002b73ca8