Automation wont work

Hello people,

I am new here and try to make a automation work on hassio. On motion i want to turn on a light but i dont know why it wil not turn on.
This is in my automations.yaml and i add automations.yaml in the config file.

- id: beweging licht aan
  alias: 'licht aan' 
    platform: state
    entity_id: binary_sensor.woonkamer_beweging
    from: 'off'
    to: 'on'
     service: light.turn_on
     entity_id: light.bf19b8bb789510a78eue48    

After 2 days i almost beginning to pull out some hairs.


Well, both lines under action need to be moved left one space. But if that’s not it…

Is the automation on? Does the motion sensor actually change from off to on? What do you mean by “and i add automations.yaml in the config file”? Does manually triggering the automation work?


thank you for the reply. I have change the positions under action but nothing happend. I can see that the motion sensor gets triggert that is working. i think the automation is not on, can you tell how to turn it on? I have all my device on hassio and really want to automate this.

Also forgot to ask, did you reload automations at Configuration > Server Control after creating the automation? And what do you mean by “and i add automations.yaml in the config file”?

Check if the automation is on by going to Developer Tools > States and typing automation in the entity filter field. Then look for this automation and see if it reports a state of on.

  1. Select “Unused entities” from the overflow menu (three dots) in the upper-right corner of the main Lovelace view.
  2. It will display a list of all your unused entities.
  3. Find your automation in the list and click it. It will appear like this. I have highlighted the toggle button and Trigger button in red.

The toggle should be on and if you click Trigger, it will execute the action portion of the automation.

in config.yaml i add (under default_config:)automation: !include automations.yaml. In automations.yaml i added the code. I have reloaded the automations under server props and also reboot hassio but now i see i dont have any automation in developer tools> states.

I found the problem, !include automations.yaml i set on the wrong place. know the automation works thank you al for sending me in the right direction!!!