Home Assistant: Difference between revisions
HAOS in Virtualbox Screenshot |
→Combine declarative and UI defined automations: Simplify section, add copy pastable example for UI, add scripts |
||
| Line 317: | Line 317: | ||
</syntaxHighlight> | </syntaxHighlight> | ||
== | == Automations, Scenes, and Scripts from the UI == | ||
These can be created from the user interface, but the files generated from it need to be included in your configuration.<syntaxhighlight lang="nixos"> | |||
{ | |||
services.home-assistant.config = | services.home-assistant.config = { | ||
"automation ui" = "!include automation.yaml"; | |||
"automation | "scenes ui" = "!include scenes.yaml"; | ||
"scripts ui" = "!include scripts.yaml"; | |||
}; | |||
}; | |||
</syntaxhighlight>It is also possible to mix declarative and generated configuration for these components, by creating multiple configuration sections with the automation, scenes, or scripts prefix: | |||
" | |||
</ | |||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
services.home-assistant.config | services.home-assistant.config = { | ||
"automation nixos" = [ | |||
]; | # YAML automations go here | ||
]; | |||
"automation ui" = "!include automations.yaml"; | |||
} | |||
</syntaxhighlight> | </syntaxhighlight> | ||