From de2a2e28a69c5896bb0719a48cf3230d1fe573c1 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Sat, 8 Jun 2019 19:15:54 +0200 Subject: [PATCH 1/2] Automations: Corrects documentation to match codebase --- source/_components/automation.markdown | 3 ++- source/_docs/automation.markdown | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/source/_components/automation.markdown b/source/_components/automation.markdown index 19adad1599b..04f3da4413b 100644 --- a/source/_components/automation.markdown +++ b/source/_components/automation.markdown @@ -26,6 +26,7 @@ Starting with 0.28 your automation rules can be controlled with the frontend. This allows one to reload the automation without restarting Home Assistant itself. If you don't want to see the automation rule in your frontend use `hide_entity: true` to hide it. + You can also use `initial_state: 'false'` so that the automation is not automatically turned on after a Home Assistant reboot. @@ -33,7 +34,7 @@ is not automatically turned on after a Home Assistant reboot. automation: - alias: Door alarm hide_entity: true - initial_state: 'true' + initial_state: true trigger: - platform: state ... diff --git a/source/_docs/automation.markdown b/source/_docs/automation.markdown index 2c21c495286..02a25294699 100644 --- a/source/_docs/automation.markdown +++ b/source/_docs/automation.markdown @@ -49,14 +49,14 @@ Actions are all about calling services. To explore the available services open t ### {% linkable_title Automation initial state %} -When you create a new automation, it will be disabled (and therefore won't trigger) unless you explicitly add `initial_state: true` to it or turn it on manually via UI/another automation/developer tools. +When you create a new automation, it will be enabled unless you explicitly add `initial_state: false` to it or turn it off manually via UI/another automation/developer tools. In case automations need to be always enabled or disabled upon Home Assistant start, then you can set the `initial_state` in your automations. Otherwise, the previous state will be restored. -In case automations need to be enabled or disabled upon Home Assistant restart, then you have to set the `initial_state` in your automations. Otherwise, the previous state will be restored. Please note that if for some reason Home Assistant cannot restore the previous state, e.g., because of an interrupted or failed startup, it will result in the automation being disabled on the next Home Assistant startup. +Please note that if for some reason Home Assistant cannot restore the previous state, it will result in the automation being enabled. ```text automation: - alias: Automation Name - initial_state: true + initial_state: false trigger: ... ``` From 0310b23c256c3046f22a208ccb37e51cfd343ada Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Sat, 8 Jun 2019 22:48:40 +0200 Subject: [PATCH 2/2] :pencil2: Language tweak --- source/_docs/automation.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/_docs/automation.markdown b/source/_docs/automation.markdown index 02a25294699..b8a1ee47167 100644 --- a/source/_docs/automation.markdown +++ b/source/_docs/automation.markdown @@ -49,7 +49,7 @@ Actions are all about calling services. To explore the available services open t ### {% linkable_title Automation initial state %} -When you create a new automation, it will be enabled unless you explicitly add `initial_state: false` to it or turn it off manually via UI/another automation/developer tools. In case automations need to be always enabled or disabled upon Home Assistant start, then you can set the `initial_state` in your automations. Otherwise, the previous state will be restored. +When you create a new automation, it will be enabled unless you explicitly add `initial_state: false` to it or turn it off manually via UI/another automation/developer tools. In case automations need to be always enabled or disabled when Home Assistant starts, then you can set the `initial_state` in your automations. Otherwise, the previous state will be restored. Please note that if for some reason Home Assistant cannot restore the previous state, it will result in the automation being enabled.