- condition: sun
before: sunset
before_offset: "-00:45:00"
# so 18:00 - 00:45... meaning before 17:15
after: sunset
after_offset: "01:00:00"
# and after 18:00 + 01:00 ... so after 19:00
so it would happen only when it’s simultaneously before 17:15 and after 19:00…
Hi Armedad, sadly I was not able to continue replying as I am new and limits were applied to my profile on replies
However after a lot of searching and watching I have got a decent working solution
While I have re-read the description on the sun condition and it works I am just battling to fully understand why the AFTER SUNSET must be a negative offset and BEFORE SUNSET is a positive yet logic would denotes that its the other way around, in my head anyway. I really do appreciate all the assistance on this and the learning that comes with it. I was really pleased once I got this going last night
alias: Stairs Strip Light - Non Bed Time
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.stairs_motion
from: "off"
to: "on"
id: Stairs - Motion Detected
- platform: state
entity_id:
- binary_sensor.stairs_motion
from: "on"
to: "off"
for:
hours: 0
minutes: 2
seconds: 0
id: Stairs - No Motion
condition:
- condition: sun
before: sunset
before_offset: "00:45:00"
after: sunset
after_offset: "-01:00:00"
action:
- choose:
- conditions:
- condition: trigger
id:
- Stairs - Motion Detected
sequence:
- service: light.turn_on
metadata: {}
data:
brightness_pct: 64
target:
entity_id: light.stairs
- conditions:
- condition: trigger
id:
- Stairs - No Motion
sequence:
- service: light.turn_off
metadata: {}
data: {}
target:
entity_id: light.stairs
mode: single