Automations not running?

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?)

no script so not sure why it says that in the log… This is for turning off:

- alias: 'Lamp: Turn off at midnight'
  trigger:
  - at: '23:59:59'
    hours: 23
    minutes: 59
    platform: time
    seconds: 59
  action:
    - service: switch.turn_off
      entity_id:
        - light.livingroom_ambient_lights

And this is for turning on at the evening that doesn’t work either

- alias: 'Lamp: Turn on at sun set'
  trigger:
  - event: sunset
    offset: -00:45:00
    platform: sun
  action:
  - service: switch.turn_on
    entity_id:
      - group.bedroom
      - light.livingroom_ambient_lights

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.

I have a sensor for time & date and that’s showing the correct time for me?

These automations can never work. As the docs state;

When ‘at’ is used, you cannot also match on hour, minute, seconds.

And check your formatting as it seems to be off as well. It’s all in the docs.

strange, it worked earlier without a problem! But then this should work as expected:

- alias: 'Lamp: Turn off at midnight'
  trigger:
    platform: time
    at: '23:59:59'
  action:
    - service: switch.turn_off
      entity_id:
        - light.livingroom_ambient_lights

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.

Is it possible to just skip the seconds then. ie using it like this

- alias: 'Lamp: Turn off at midnight'
  trigger:
    platform: time
    at: '23:59'
  action:
    service: switch.turn_off
    entity_id: light.livingroom_ambient_lights

Oh and I just realized… should I maybe be using light.turn_offinstead of switch.turn_off?