I’m curious to know what you are using that sorted your automation’s YAML statements? It made action first, trigger last, and everything else somewhere in between. Like trying to read a novel sorted by its chapter titles.
This also doesn’t work. The intention is that the boost action does not execute if the condition is false. According to the documentation this seems to be supported.
You’re mixing the condition field up with actual conditions that go inside it. When putting conditions inside the action list, you do not include the main condition field.
BTW, I checked the contents of automations.yaml and all of the automations created by the Automation Editor are not sorted. So I still don’t understand why yours is. Are you using a recent version of Home Assistant?
unfortunately, that leads to more confusion as then people don’t add the condition field in automation. It’s a double edged sword and it’s gotten to this point based on past experiences beginners had.
Whatever “tools” they might be, they needlessly sorted the YAML statements and failed to provide you with guidance for composing valid YAML (i.e. allowing for the malformed condition). I suggest you use the Automation Editor or, if you prefer a text editor, VS Code with the Config Helper plug-in.
I intentionally wrote it like this based on the documentation. I have programmed in 30+ languages. If I can’t write a condition the first time correctly, it’s a problem with Home Assistant.
The “script” syntax also uses this "script:" syntax. I have absolutely no idea whether it’s wrong to use it there too. I think it would help if there would be complete examples including the automation: toplevel element. A formal semantics would be better, however, but I believe the people involved in this project are not exactly PL experts, so I guess I can’t expect that.
I think you should familiarize yourself with integrations as that seems to be the disconnect here. An integration has a specific configuration, and that configuration changes based on the integration. Script is the script integration. The action section of an automation shares the same functionality as the sequence in a script.
Can you show me examples in the documentation where the YAML statements are sorted alphabetically in automations?
The overwhelming majority of examples that I have found in the documentation and in this community forum are in a ‘cause and effect’ order (trigger/condition/action).
Your syntax errors are always Home Assistant’s fault?
At most I’d say the syntax errors you created (malformed condition) were allowed by whatever unnamed tools you used. Ultimately, it’s your responsibility to supply Home Assistant with a syntactically correct automation.
They considered trigger/condition/action ordering important enough to store it that way for automations created via the Automation Editor (even though it’s not required for the YAML interpreter, just for improved legibility).
I rarely make mistakes while programming. I wrote it based on how I interpreted the documentation.
Also, let’s be fair. The condition syntax is completely awful and redundant compared to how it would be done in e.g. Lisp.
I have not claimed anything about the order of the properties in the documentation. It’s unfortunate that you talk about things I haven’t said.
The order is created by tooling and that tooling could potentially use a Home Assistant specific backend, but you are literally the only one that is concerned about the order.
The Automation Editor is something nobody is going to use for anything remotely complicated.