Help, automation doesn't work how can i fix it?

I creat a automation, the yaml like this:


but it can not work automaic. So, i rewrite the yaml like :

automation:
  - alias: test
    description: ""
    triggers:
      - trigger: numeric_state
        entity_id:
          - sensor.network_scanner
        for:
          hours: 0
          minutes: 5
          seconds: 0
        attribute: devices
        below: 5
    conditions:
      - condition: sun
        before: sunset
        after: sunrise
    actions:
      - device_id: aa44a541702e96fa82b3eae1cba22b2c
        domain: button
        entity_id: ae0127887c89517179e028249f6bc803
        type: press
    mode: restart

There is a new problem: Message malformed: extra keys not allowed @ data[‘automation’]
What should I do?

Where are you placing this?

Also, please follow Guideline #11 by sharing properly formatted code.

Thanks, this first time been here.
I figure out how to quote the code, thanks again!!