From 2b5f2284f336ce5634412896f78a83a36a3b7f50 Mon Sep 17 00:00:00 2001 From: Jason <37859597+zachowj@users.noreply.github.com> Date: Mon, 17 Aug 2020 04:48:01 -0700 Subject: [PATCH] docs: Add Using date and time entities to trigger flows --- docs/.vuepress/config.js | 1 + docs/cookbook/README.md | 1 + ...-and-time-entities-to-trigger-flows_01.png | Bin 0 -> 9017 bytes ...-and-time-entities-to-trigger-flows_02.png | Bin 0 -> 15054 bytes ...date-and-time-entities-to-trigger-flows.md | 21 ++++++++++++++++++ .../example1a.json | 1 + .../example1b.json | 1 + 7 files changed, 25 insertions(+) create mode 100644 docs/cookbook/images/using-date-and-time-entities-to-trigger-flows_01.png create mode 100644 docs/cookbook/images/using-date-and-time-entities-to-trigger-flows_02.png create mode 100644 docs/cookbook/using-date-and-time-entities-to-trigger-flows.md create mode 100644 examples/cookbook/using-date-and-time-entities-to-trigger-flows/example1a.json create mode 100644 examples/cookbook/using-date-and-time-entities-to-trigger-flows/example1b.json diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index edb6dc7dbf..f3f5090d8e 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -38,6 +38,7 @@ module.exports = { 'sun-events', 'vacation-mode', 'expiration-date-monitor', + 'using-date-and-time-entities-to-trigger-flows', ], }, ], diff --git a/docs/cookbook/README.md b/docs/cookbook/README.md index 47dc992b30..977ebb6986 100644 --- a/docs/cookbook/README.md +++ b/docs/cookbook/README.md @@ -11,6 +11,7 @@ further educate yourself in the world of Home Automation with Node-RED. - [Turn Light On/Off with Sunset/Sunrise](./sun-events.md) - [Vacation Mode](./vacation-mode.md) - [Expiration Date Monitor](./expiration-date-monitor.md) +- [Using date and time entities to trigger flows](./using-date-and-time-entities-to-trigger-flows.md) All JSON exports are also available under the examples tab in the Node-RED import menu. diff --git a/docs/cookbook/images/using-date-and-time-entities-to-trigger-flows_01.png b/docs/cookbook/images/using-date-and-time-entities-to-trigger-flows_01.png new file mode 100644 index 0000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jnSB5rMIz+;%}nSX!Q3yZR5{&2~`rsWVd|oAR(dPAcF+?SB}SV`6e*Q&_~0pFi315oe7dbaRvy%IaU(NCj|3gJj?{1>)Y4o8%=YI>+7UF0HV!f9F z4H+bSv|{(?8k`jj4Kux5H@6NBGCeoHl1U$*D&P8n2%5DD;puF2s$((}#hXRfP9aiC zm9Q6qJy>_*0Ra;x>SpyEL`O*p4P5DULEy!_?LV(SvD>LuFHApNG4T=SaQQ#l?ey+{ z&6@FOx68YK!}WFlZJHeqVscQM=?rX3`>mcUJb3x<^yI`?dZ&b#m^k{KxOeQ?Qm`fA z6Cie_a8kol9yY@XK9wx7cfY8H#0Ow!@eX~O@kfR8IUJ!zL$2@d?GPfgbWUvZS0gLB zH6TSUrjgeZwKq+a;KslV$I#OlK7fjtiagpFJ7T2)BIhP9=m;Ma>? z4pDX0sem{-*c@^f*MvEgyY@qajKd*=Lm+++6+D+^BdZF>2Xnagi7kFA>JA=h^wyT6 z2XM;tt*5``>m7g?TDUvcP-zG5r?e>4w-{%)aX&$xwa;(~TP zO2I0$C|01)8yA21pxgH=23&wFLWq~o+xQC8o%G%y_eqnCJQwP;iqSQ-;5LUoG6h7) z>G1GTwY|CGfADeg!8dt9fD;u}I{ij*=elF@0}!RcM@WIGNXnD&)%nuMKlCDWJRHJ6 zyxLS*`EJq@sQ*j~nEwDso5=vXEjY*eohqJa<&c#B-0AfF1}%cD{7NSXP&T3nNck(% z?M^|n{~UFjc69@8{|3?;U@CCr`S>0L9Gw7Hm4!lXT}CdK1B8*=65o;M|8EpS{^thF Zugl6l5NX*3yzT;0QP6l^BL@%t{{X79C&vH) literal 0 HcmV?d00001 diff --git a/docs/cookbook/images/using-date-and-time-entities-to-trigger-flows_02.png b/docs/cookbook/images/using-date-and-time-entities-to-trigger-flows_02.png new file mode 100644 index 0000000000000000000000000000000000000000..9623eae150058d6a01ad0e73692a23bc6b26ab62 GIT binary patch literal 15054 zcmY*=2RK|^)UJGjM2X&s8o>-ET7n=(?@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eRY2h({|5@n0S5p8 literal 0 HcmV?d00001 diff --git a/docs/cookbook/using-date-and-time-entities-to-trigger-flows.md b/docs/cookbook/using-date-and-time-entities-to-trigger-flows.md new file mode 100644 index 0000000000..af8361b568 --- /dev/null +++ b/docs/cookbook/using-date-and-time-entities-to-trigger-flows.md @@ -0,0 +1,21 @@ +# Using Date and Time entities to trigger flows + +## Using the Home Assistant Companion app next alarm sensor + +Here's a basic example of using the Home Assistant Companion app next alarm sensor. + +![screenshot](./images/using-date-and-time-entities-to-trigger-flows_01.png) + +<<< @/examples/cookbook/using-date-and-time-entities-to-trigger-flows/example1a.json + +### Adding an offset and togglable on and off switch + +Using the Helpers section under configuration in Home Assistant add an `input_number` and `input_boolean`. In this example they are `input_number.offset` and `input_boolean.next_alarm_enabled`. The offset will be plus or minus minutes to the alarm. The delay node will get updated when either the alarm sensor gets updated, the input boolean gets toggled, or the offset changes. + +![screenshot](./images/using-date-and-time-entities-to-trigger-flows_02.png) + +<<< @/examples/cookbook/using-date-and-time-entities-to-trigger-flows/example1b.json + +::: warning +Delay nodes can have a max timeout of around 24.8 days greater than that and weird things will happen. +::: diff --git a/examples/cookbook/using-date-and-time-entities-to-trigger-flows/example1a.json b/examples/cookbook/using-date-and-time-entities-to-trigger-flows/example1a.json new file mode 100644 index 0000000000..e3a3d53b34 --- /dev/null +++ b/examples/cookbook/using-date-and-time-entities-to-trigger-flows/example1a.json @@ -0,0 +1 @@ +[{"id":"71576a68.4c7494","type":"server-state-changed","z":"56b1c979.b2c618","name":"Next Alarm","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.pixel_next_alarm","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"unavailable","halt_if_type":"str","halt_if_compare":"is_not","outputs":2,"output_only_on_state_change":true,"x":236,"y":1456,"wires":[["17ff4332.e9872d"],["ffa8ad2e.133d4"]]},{"id":"ffa8ad2e.133d4","type":"change","z":"56b1c979.b2c618","name":"reset","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":386,"y":1504,"wires":[["664bcf1c.d25e8"]]},{"id":"17ff4332.e9872d","type":"function","z":"56b1c979.b2c618","name":"time difference","func":"const now = Date.now();\nconst alarm = new Date(msg.payload);\n\nconst timeDifference = alarm - now;\n\nmsg.delay = timeDifference;\n\n// Reset the delay node before setting the new delay\nreturn [[{reset: true},msg]];","outputs":1,"noerr":0,"initialize":"","finalize":"","x":416,"y":1456,"wires":[["664bcf1c.d25e8"]]},{"id":"664bcf1c.d25e8","type":"delay","z":"56b1c979.b2c618","name":"wait until time","pauseType":"delayv","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":608,"y":1456,"wires":[["42742068.3eb4f"]]},{"id":"42742068.3eb4f","type":"debug","z":"56b1c979.b2c618","name":"do stuff","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":780,"y":1456,"wires":[]}] diff --git a/examples/cookbook/using-date-and-time-entities-to-trigger-flows/example1b.json b/examples/cookbook/using-date-and-time-entities-to-trigger-flows/example1b.json new file mode 100644 index 0000000000..47c3af9c79 --- /dev/null +++ b/examples/cookbook/using-date-and-time-entities-to-trigger-flows/example1b.json @@ -0,0 +1 @@ +[{"id":"8a005b30.a70028","type":"change","z":"56b1c979.b2c618","name":"reset","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":1616,"wires":[["7443b388.3997bc"]]},{"id":"7443b388.3997bc","type":"delay","z":"56b1c979.b2c618","name":"wait until time","pauseType":"delayv","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1008,"y":1568,"wires":[["944beed4.7ca6c"]]},{"id":"944beed4.7ca6c","type":"debug","z":"56b1c979.b2c618","name":"do stuff","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1180,"y":1568,"wires":[]},{"id":"902c18e0.b83f08","type":"api-current-state","z":"56b1c979.b2c618","name":"enabled?","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.next_alarm_enabled","state_type":"str","state_location":"","override_payload":"none","entity_location":"","override_data":"none","blockInputOverrides":false,"x":300,"y":1568,"wires":[["819e7961.c0c5b8"],["8a005b30.a70028"]]},{"id":"88557318.dcb9","type":"function","z":"56b1c979.b2c618","name":"add offset","func":"const now = Date.now();\nconst alarm = new Date(msg.alarm);\nconst offset = msg.offset * 60000;\nconst timeDifference = alarm.getTime() + offset;\nconst delay = timeDifference - now;\n\nif(delay < 0) {\n node.status({fill: 'red', text: 'Alarm in the past'});\n node.error(\"Alarm in the past.\");\n return {reset: true};\n}\n\nnode.status({});\nmsg.delay = delay\n\n// Reset the delay node before setting the new delay\nreturn [[{reset: true},msg]];","outputs":1,"noerr":0,"initialize":"","finalize":"","x":828,"y":1568,"wires":[["7443b388.3997bc"]]},{"id":"5f5d428e.e8ed8c","type":"api-current-state","z":"56b1c979.b2c618","name":"get offset","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_number.offset","state_type":"str","state_location":"offset","override_payload":"msg","entity_location":"","override_data":"none","blockInputOverrides":false,"x":684,"y":1568,"wires":[["88557318.dcb9"]]},{"id":"6e621173.6634d","type":"server-state-changed","z":"56b1c979.b2c618","name":"Update Alarm","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.offset, input_boolean.next_alarm_enabled, sensor.pixel_next_alarm","entityidfiltertype":"substring","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":150,"y":1568,"wires":[["902c18e0.b83f08"]]},{"id":"819e7961.c0c5b8","type":"api-current-state","z":"56b1c979.b2c618","name":"get alarm time","version":1,"outputs":2,"halt_if":"unavailable","halt_if_type":"str","halt_if_compare":"is_not","override_topic":true,"entity_id":"sensor.pixel_next_alarm","state_type":"str","state_location":"alarm","override_payload":"msg","entity_location":"","override_data":"none","blockInputOverrides":false,"x":480,"y":1568,"wires":[["5f5d428e.e8ed8c"],["8a005b30.a70028"]]}]