Automations not working since latest update

Since upgrading to the latest version of home assistant some of my automations have stopped working - specifically ones that only run after sunset… I have proven it’s this as removing the condition triggers the automation.

Has anyone else seen this problem? Below is my configuration.

- id: '1609073996248'
  alias: Hallway Motion
  description: ''
  trigger:
  - type: motion
    platform: device
    device_id: 13df5b747d514b82da959dd1e2c26bbc
    entity_id: binary_sensor.2nd_floor_hallway_motion
    domain: binary_sensor
  - type: motion
    platform: device
    device_id: 20294602c0e1740a5cd40ffa5fb32f89
    entity_id: binary_sensor.1st_floor_hallway_motion
    domain: binary_sensor
  - type: motion
    platform: device
    device_id: ac38927b93e50534b4e3cf66bfb51ea0
    entity_id: binary_sensor.ground_floor_hallway_motion
    domain: binary_sensor
  condition:
  - condition: and
    conditions:
    - condition: device
      type: is_off
      device_id: 656183ddd00b6569c388d030d1af7056
      entity_id: switch.hallway_mss550l_main_channel
      domain: switch
  - condition: sun
    after: sunset
  action:
  - type: turn_on
    device_id: 656183ddd00b6569c388d030d1af7056
    entity_id: switch.hallway_mss550l_main_channel
    domain: switch
  mode: single
  max: 10

not seeing this on 2020-12-2 Supervised.

Check your settings in Configuration -> General and make sure nothing has changed (eg lat/long and timezone) and check Logbook that the time is correct.

all seems okay - I shall monitor this evening and see if it works.

When you tested - you removed only the sun condition, or you removed the entire condition?

Hi Trevor, Just the sun condition. Left the other condition in place.

1 Like

Sweet, just double checking that it was strictly a time related issue :+1: :smile:

(Also your condition: and is redundant, simple conditions by default are AND)

As Trevor pointed out, I would try try something like this:

condition:
  - condition: state
    state: 'off'
    entity_id: switch.hallway_mss550l_main_channel
  - condition: state
    entity_id: sun.sun
    state: 'below_horizon'

You don’t need the “and conditions”, this will run when both evaluate to true, anyway I think the main issue was the indent on the sun condition was not indented enough. Are you sure it worked before? The other issue is using after sunset will only work till midnight, then it becomes before sunset because it is the next day, but it is still dark. Is that what you intended? Using below_horizon will work when its dark, until the sun is up. My 2 cents

In my case, after upgrading to 2020.12.2 none of my sensors are working.

okay, so they seem to be working after info from @Kdem and @Trevor . Thanks both!