So after I moved from AIO to hass.io my automations based on time isn’t working anymore. I can trigger them manually and they run just fine and do what they are supposed to do so there’s nothing wrong with the coding.
According to the logs hass thinks that its running the script to.
018-07-01 23:59:59 INFO (MainThread) [homeassistant.components.automation] Executing Lamp: Turn off at midnight
2018-07-01 23:59:59 INFO (MainThread) [homeassistant.helpers.script] Script Lamp: Turn off at midnight: Running script
2018-07-01 23:59:59 INFO (MainThread) [homeassistant.helpers.script] Script Lamp: Turn off at midnight: Executing step call service
Checking the automation in the frontend it says the automation is run to but the lights are still on.
If you manually trigger an automation the trigger part is skipped (obviously). And since this is the part which is not working it would be helpful if you post your automation (and script?)
Since HASS.io is based on Docker - I’d take a long look at the time on the machine you’re running Hass.io on. I had a similar issue with Node Red running in Docker not kicking off things on time and the Docker container time was off (wrong time zone…) and I had to map to /etc/timezone to get things straightened out. Try an automation that just sends you a notification of local time from the HASS.io instance and see what it sends. You might find the issue there. Or try getting into the console on the Docker container running HASS.io and seeing if you can find a way to issue a time command to see what time it shows and what timezone it shows.
Maybe you where running a very old version of HA? Anyway I can not check right now but I think this automation will through some errors in the log (did you check?). Try this;
- alias: 'Lamp: Turn off at midnight'
trigger:
platform: time
at: '23:59:59'
action:
service: switch.turn_off
entity_id: light.livingroom_ambient_lights
I think it would be better not to trigger on seconds as even a small delay will cause the automation not to trigger.