Data['triggers'] not allowed. Why?

I am using literally the official sample
https://docs.pi-hole.net/guides/misc/homeassistant/
but HA throws error on validation of automation data[‘triggers’] not allowed. Why?

Post how you’re trying to use that example. You’re likely putting it in the wrong spot.

I literally followed the instructions and edited files via ssh. HA was restarted, congiguration is repirted as valid.

Automation in automations list is listed as “Unavailable”. When trying to edit it via HA web UI YAML mode it shows automation as it was added in automations.yaml via SSH but throws that error.

p.s. when I debug and delete “triggers” block, it says data[“actions”] is not allowed.

Am I in some different configuration setup where arrays (triggers, actions…) are defined differently?

p.p.s. other valid automations from my automations.yaml do not use arrays for actions and triggers, but majority of samples I find online are with arrays:

I just do not get why samples are with arrays while I can not use arrays.

what version of HA are you running?

  • Core 2024.6.1
  • Supervisor 2025.05.3
  • Operating System 12.3
  • Frontend 20240605.0

The pluralized versions were introduced in 2024.10…

Either use the non-plural configuration keys (trigger, condition, action) or update Core.

Also, be aware that you will need to use service, not action inside the action block, since that update was in 2024.8

1 Like

Cool. Thanks. That explains everything. And as I read it is not a breaking change as both structures should be supported.

You should really start updating. Falling that far behind is going to cause you more pain than this sooner or later.

1 Like

That’s only for backwards compatibility.

2024.10+ will recognize both the old and new syntax (not a breaking change)

But the old version doesn’t know about the new version syntax so it sees the new syntax as an error. It’s still not a breaking change since you can’tr expect old versions to use new syntax.