Error Message "Message malformed: extra keys not allowed @ data['0']"

Hello,

I’m receiving the error message “Message malformed: extra keys not allowed @ data[‘0’]” when attempting to implement the provided automations. I apologize for the inconvenience, but I’m new to Home Assistant and need assistance in resolving this issue.

- alias: Smart Irrigation
  description: 'Start Smart Irrigation at 06:00 and run it only if the adjusted_run_time is >0 and run it for precisely that many seconds'
  trigger:
  - at: 06:00
    platform: time
  condition:
  - above: '0'
    condition: numeric_state
    entity_id: sensor.smart_irrigation_garten_vorne
  action:
  - data: {}
    entity_id: switch.irrigation_tap1
    service: switch.turn_on
  - delay:
      seconds: '{{states("sensor.smart_irrigation_garten_vorne")}}'
  - data: {}
    entity_id: switch.irrigation_tap1
    service: switch.turn_off
  - data: {}
    service: smart_irrigation.reset_bucket
    target:
      entity_id: sensor.smart_irrigation_garten_vorne

Where did you get this code? Try instead:

action:
  - service: switch.turn_on
    target:
      entity_id: switch.irrigation_tap1

and similarly for the others.

Also, where have you put this code?