Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(cookbook): Add starting a flow after HA restart example
- Loading branch information
Showing
6 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+17.1 KB
docs/cookbook/images/starting-flow-after-home-assistant-restart_01.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.77 KB
docs/cookbook/images/starting-flow-after-home-assistant-restart_02.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions
29
docs/cookbook/starting-flow-after-home-assistant-restart.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Starting a flow after a Home Assistant restart | ||
|
||
Use a Home Assistant automation to set an input boolean to `on` then from Node-RED check if that input boolean is `on` after a successful connection or at any time it changes to `on`. | ||
|
||
## Create an input boolean using the Helpers menu (Configuration -> Helpers) | ||
|
||
![screenshot](./images/starting-flow-after-home-assistant-restart_02.png) | ||
|
||
## Create the Home Assistant automation | ||
|
||
```yaml | ||
alias: Home Assistant Restart | ||
description: "" | ||
trigger: | ||
- platform: homeassistant | ||
event: start | ||
condition: [] | ||
action: | ||
- service: input_boolean.turn_on | ||
data: {} | ||
entity_id: input_boolean.home_assistant_restarted | ||
mode: single | ||
``` | ||
|
||
## Create the Node-RED flow | ||
|
||
![screenshot](./images/starting-flow-after-home-assistant-restart_01.png) | ||
|
||
<<< @/examples/cookbook/starting-flow-after-home-assistant-restart/example_01.json |
1 change: 1 addition & 0 deletions
1
examples/cookbook/starting-flow-after-home-assistant-restart/example_01.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{"id":"18e24240.85551e","type":"server-events","z":"91a80f99.6180e","name":"","event_type":"home_assistant_client","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"waitForRunning":false,"x":152,"y":3968,"wires":[["45c2480a.030d78"]]},{"id":"45c2480a.030d78","type":"switch","z":"91a80f99.6180e","name":"running?","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"running","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":364,"y":3968,"wires":[["aaf97af.8e20e88"]]},{"id":"8632ed30.bd796","type":"api-call-service","z":"91a80f99.6180e","name":"","version":1,"debugenabled":false,"service_domain":"input_boolean","service":"turn_off","entityId":"input_boolean.home_assistant_restarted","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":760,"y":3968,"wires":[["9efea94e.8901e8"]]},{"id":"aaf97af.8e20e88","type":"api-current-state","z":"91a80f99.6180e","name":"has restarted?","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.home_assistant_restarted","state_type":"str","state_location":"","override_payload":"none","entity_location":"","override_data":"none","blockInputOverrides":false,"x":528,"y":3968,"wires":[["8632ed30.bd796"],[]]},{"id":"f6b884f4.54b7b8","type":"server-state-changed","z":"91a80f99.6180e","name":"restarted?","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_boolean.home_assistant_restarted","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":false,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"x":540,"y":4016,"wires":[["8632ed30.bd796"],[]]},{"id":"aea736a5.b21058","type":"comment","z":"91a80f99.6180e","name":"Home Assistant Restarted","info":"","x":142,"y":3920,"wires":[]},{"id":"9efea94e.8901e8","type":"link out","z":"91a80f99.6180e","name":"Home Assistant Restarted","links":["8e22de6e.96a9d"],"x":1022,"y":3968,"wires":[],"l":true},{"id":"8e22de6e.96a9d","type":"link in","z":"91a80f99.6180e","name":"Home Assistant Restarted","links":["9efea94e.8901e8"],"x":142,"y":4064,"wires":[["7029511d.e34d7"]],"l":true},{"id":"7029511d.e34d7","type":"debug","z":"91a80f99.6180e","name":"do stuff","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":348,"y":4064,"wires":[]}] |