Hello,
I have done an automation where the hallway lights should be turned off at 5:34:00 A.M, but it’s not working all the time, and many times it triggers after the defined time, please check the pics:
Hello,
I have done an automation where the hallway lights should be turned off at 5:34:00 A.M, but it’s not working all the time, and many times it triggers after the defined time, please check the pics:
Can you share the whole automation?
Go to the 3 dots in the top right of the screen, click on ‘Edit with YAML’ and copy in and paste in.
Remember to highlight the code and click on the ‘</>’ button to preserve the indentations.
here you go:
alias: Turn off the lights at 545am
description: Daily automated process to turn off all the hallway & Small lights
trigger:
- platform: time
at: '05:45:00'
action:
- data: {}
entity_id: switch.sonoff_hallway_roof_lamps
service: switch.turn_off
- device_id: 4cdea82ecf854bf59d8874a56d6e245a
domain: light
entity_id: light.office_small
type: turn_off
- device_id: b1beaa9042d7409f8a6f553d3239661d
domain: light
entity_id: light.hallway_small
type: turn_off
- device_id: e8d5764555eb4a3d85d24ec08701b703
domain: light
entity_id: light.bedroom_small
type: turn_off
- device_id: 50f08fb960c24cf8af6f0f9d7f20948a
domain: light
entity_id: light.kitchen_strip
type: turn_off
- device_id: f04189be15404a07a5fc7b89c4053080
domain: light
entity_id: light.livingroom_small
type: turn_off
mode: single
The automation is scheduled to trigger at 05:45
not 05:34
but I get your meaning (i.e. it doesn’t appear to be respecting the time you specified).
Go to Developer Tools > Template and paste the following text into the Template Editor:
Local Time:
{{ now() }}
{{ now().astimezone() }}
{{ utcnow().astimezone() }}
{{ now().now() }}
{{ now().today() }}
UTC time:
{{ now().utcnow() }}
{{ utcnow() }}
Time Zone:
{{ now().tzinfo }}
{{ now().astimezone().tzinfo }}
{{ utcnow().tzinfo }}
Confirm the reported Local Time and Time Zone information is correct. We want to make sure the system clock is set correctly before we investigate further.
FWIW, although it’s unlikely to fix the problem, you can reduce your automation to this:
alias: Turn off the lights at 545am
description: Daily automated process to turn off all the hallway & Small lights
trigger:
- platform: time
at: '05:45:00'
action:
- service: homeassistant.turn_off
entity_id:
- switch.sonoff_hallway_roof_lamps
- light.office_small
- light.hallway_small
- light.bedroom_small
- light.kitchen_strip
- light.livingroom_small
mode: single