No Motion Automation Issue

I seem to be having lots of issues today.

I’ve created a no motion automation to turn off lights after no motion detected for 1 minute but the lights are staying on.

Where have I gone wrong with my code?


- id: 'landing_off_day'
  alias: Landing Off Daytime
  trigger:
    platform: state
    entity_id: binary_sensor.sensor_landing_motion 
    to: 'off'
    for:
      minutes: 1
  condition:
    - condition: time
      after: '07:00'
      before: '21:00'
  action:
    service: homeassistant.turn_off
    data:
      entity_id: light.landing_light
      transition: 20
      mode: 

mode is in the wrong place (you can just delete that key, but if you want it for whatever reason align it with the service and data keys)

Other than that it looks fine to me. Have you reloaded your automations since adding it and made sure it’s switched on?

1 Like

Thanks. I’ve removed the mode.

When you say ‘reloaded’ do you mean in configuration UI? I’ve never actually done that before. Do I need to? (Total noob question :relaxed:)

So basically every time you change or add an automation the system doesn’t see it until you either restart homeassistant or ‘reload’ the automations.

Configuration > Server Controls > Reload Automations

(prior to doing this use the configuration checker at the top of the same page to ensure that the changes you made are ‘valid’)

You’ll also see the other things that can be reloaded if you make changes to them, anything else that you change whilst the system is running requires the server to be restarted, which is also on the same page (and should also be preceded with a configuration check to make sure that the system will be able to correctly use the new configuration when it comes back up).

1 Like

I always check config then restart HA after changes but check config then reloading seems better as it’s much quicker so I’ll use that instead from now on.

It seems to be working now so thank you for you help.

1 Like