{"id":19860497,"url":"https://github.com/smcnab1/home-assistant-config","last_synced_at":"2025-07-24T11:34:18.259Z","repository":{"id":57954244,"uuid":"529050516","full_name":"smcnab1/home-assistant-config","owner":"smcnab1","description":"Your shortcut to seamless Home Assistant setups. Elevate your smart living experience effortlessly. 🏡✨","archived":false,"fork":false,"pushed_at":"2024-06-15T10:58:38.000Z","size":161272,"stargazers_count":4,"open_issues_count":19,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-02T04:34:26.820Z","etag":null,"topics":["automation","hass","hassio","home-assistant","home-assistant-config","home-automation","homeassistant","homeautomation","internet-of-things","internetofthings","iot"],"latest_commit_sha":null,"homepage":"https://smcnab1.github.io/home-assistant-config/","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smcnab1.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":".github/SECURITY.md","support":".github/SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"ko_fi":"sammcnab1"}},"created_at":"2022-08-25T23:34:12.000Z","updated_at":"2024-07-07T15:47:19.000Z","dependencies_parsed_at":"2023-12-31T08:27:24.095Z","dependency_job_id":"eb8a47c8-4890-4277-907e-3cd1827f057c","html_url":"https://github.com/smcnab1/home-assistant-config","commit_stats":null,"previous_names":["smcnab1/home-assistant-config"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/smcnab1/home-assistant-config","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smcnab1%2Fhome-assistant-config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smcnab1%2Fhome-assistant-config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smcnab1%2Fhome-assistant-config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smcnab1%2Fhome-assistant-config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smcnab1","download_url":"https://codeload.github.com/smcnab1/home-assistant-config/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smcnab1%2Fhome-assistant-config/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266834914,"owners_count":23992279,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","hass","hassio","home-assistant","home-assistant-config","home-automation","homeassistant","homeautomation","internet-of-things","internetofthings","iot"],"created_at":"2024-11-12T15:06:04.705Z","updated_at":"2025-07-24T11:34:18.196Z","avatar_url":"https://github.com/smcnab1.png","language":"Shell","funding_links":["https://ko-fi.com/sammcnab1"],"categories":[],"sub_categories":[],"readme":"\u003c!-- TOP ROW OF BADGES --\u003e\n\n[![Contributors][contributors-shield]][contributors-url]\n[![Forks][forks-shield]][forks-url]\n[![Stargazers][stars-shield]][stars-url]\n[![Issues][issues-shield]][issues-url]\n[![MIT License][license-shield]][license-url]\n[![Kofi][kofi-badge]][kofi-url]\n\n\u003c!-- PROJECT HEADING --\u003e\n\n\u003ca name=\"readme-top\"\u003e\u003c/a\u003e\n\n\u003c!-- PROJECT LOGO --\u003e\n\u003cbr /\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/smcnab1/home-assistant-config\"\u003e\n    \u003cimg src=\"docs/my-avatar.png\" alt=\"Logo\" width=\"80\" height=\"80\"\u003e\n  \u003c/a\u003e\n\n\u003ch3 align=\"center\"\u003eHome Assistant Config\u003c/h3\u003e\n\n  \u003cp align=\"center\"\u003e\nYour shortcut to seamless Home Assistant setups. Elevate your smart living experience effortlessly. 🏡✨\n    \u003cbr /\u003e\n    \u003ca href=\"https://smcnab1.github.io/home-assistant-config/\"\u003e\u003cstrong\u003eExplore the docs »\u003c/strong\u003e\u003c/a\u003e\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/smcnab1/home-assistant-config\"\u003eView Demo\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/smcnab1/home-assistant-config/issues\"\u003eReport Bug\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/smcnab1/home-assistant-config/issues\"\u003eRequest Feature\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eView Contents\u003c/summary\u003e\n\n_Last Updated June 2024_\n\u003c!-- toc --\u003e\n\n- [About The Project](#about-the-project)\n  - [Devices](#devices)\n  - [Add-Ons](#addons)\n  - [Automations](#automations)\n- [Back Matter](#back-matter)\n  - [Roadmap](#roadmap)\n  - [Contributing](#contributing)\n  - [License](#license)\n\n\u003c!-- tocstop --\u003e\n  \n\u003c/details\u003e\n\n\u003c!-- ABOUT THE PROJECT --\u003e\n## About The Project\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/smcnab1/home-assistant-config\"\u003e\n    \u003cimg src=\"https://i.imgur.com/z3pnxzt.png\" alt=\"Logo\" width=\"100%\" height=\"auto\"\u003e\n  \u003c/a\u003e\n  \u003c/div\u003e\n  \nThis is my **first** repo on GitHub and first time utilising Home Assistant to it's fullest potential. I began with a few sensors and just playing but got bitten by the HA bug and have created a full smart home system.\n\nThis repo will be updated regularly and I am keen to make it an open \u0026 learning venture. Looking for feature suggestions and advice to increase the **wife-approval level**😎.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\u003c!-- DEVICES --\u003e\n\u003ca name=\"devices\"\u003e\u003c/a\u003e\n\n## Devices _(as at Oct 22)_\n\nThis is a list of the devices I **currently** use as part of my Home Assistant setup. Any suggestions drop them as a \u003ca href=\"https://github.com/smcnab1/home-assistant-config/issues/new?assignees=smcnab1\u0026labels=Priority%3A+Low%2C+Type%3A+Feature\u0026template=feature_request.md\u0026title=%5BFR%5D\"\u003efeature request.\u003c/a\u003e\n\u003cbr /\u003e\n\n\u003c!-- start-table --\u003e\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eView all Devices\u003c/i\u003e\u003c/b\u003e\u003c/summary\u003e\n\u003ctable\u003e\n    \u003cthead\u003e\n        \u003ctr\u003e\n            \u003cth\u003eSwitches 🎚\u003c/th\u003e\n            \u003cth\u003eQty (#)\u003c/th\u003e\n            \u003cth\u003ePrice per unit (£)\u003c/th\u003e\n            \u003cth\u003ePrice (£)\u003c/th\u003e\n        \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ca href=\"https://amzn.to/3Qw7cBb\"\u003eTP-Link Tapo P100\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e9\u003c/td\u003e\n            \u003ctd\u003e9.49\u003c/td\u003e\n            \u003ctd\u003e85.41\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ca href=\"https://amzn.to/3qtOL5D\"\u003eXiaomi Aqara Single Button\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e4\u003c/td\u003e\n            \u003ctd\u003e17.99\u003c/td\u003e\n            \u003ctd\u003e71.96\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ca href=\"https://amzn.to/3TYq6DL\"\u003eSONOFF Micro USB Smart Adapter\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e2\u003c/td\u003e\n            \u003ctd\u003e11.99\u003c/td\u003e\n            \u003ctd\u003e23.98\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ca href=\"https://amzn.to/3B41VeB\"\u003eSwitchBot Smart Switch\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e2\u003c/td\u003e\n            \u003ctd\u003e29.99\u003c/td\u003e\n            \u003ctd\u003e59.98\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ci\u003e\u003cb\u003eTotal\u003c/b\u003e\u003c/i\u003e\u003c/td\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n            \u003ctd\u003e\u003cb\u003e241.33\u003c/b\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n    \u003cthead\u003e\n        \u003ctr\u003e\n            \u003cth\u003eSensors 🌡\u003c/th\u003e\n            \u003cth\u003eUnits (#)\u003c/th\u003e\n            \u003cth\u003ePrice per unit (£)\u003c/th\u003e\n            \u003cth\u003ePrice (£)\u003c/th\u003e\n        \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ca href=\"https://amzn.to/3BGwOaB\"\u003eXiaomi Aqara Door Sensor\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e2\u003c/td\u003e\n            \u003ctd\u003e16.99\u003c/td\u003e\n            \u003ctd\u003e33.98\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ca href=\"https://amzn.to/3DguZlz\"\u003eXiaomi Aqara Temperature Sensor\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e5\u003c/td\u003e\n            \u003ctd\u003e19.99\u003c/td\u003e\n            \u003ctd\u003e99.95\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ca href=\"https://amzn.to/3DlSMAV\"\u003eXiaomi Aqara Motion Sensor\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e5\u003c/td\u003e\n            \u003ctd\u003e19.99\u003c/td\u003e\n            \u003ctd\u003e99.95\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ca href=\"https://amzn.to/3RUy13b\"\u003eXiaomi Aqara Vibration Sensor\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e2\u003c/td\u003e\n            \u003ctd\u003e19.99\u003c/td\u003e\n            \u003ctd\u003e39.98\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ca href=\"https://amzn.to/3E8ytXU\"\u003eXiaomi Aqara Magic Cube\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e1\u003c/td\u003e\n            \u003ctd\u003e19.99\u003c/td\u003e\n            \u003ctd\u003e19.99\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ca href=\"https://amzn.to/3QzIksm\"\u003eESP32 Boards\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e6\u003c/td\u003e\n            \u003ctd\u003e7.00\u003c/td\u003e\n            \u003ctd\u003e42.00\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ca href=\"https://www.thingiverse.com/thing:4125952\"\u003eESP32 Cases\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e6\u003c/td\u003e\n            \u003ctd\u003e8.00\u003c/td\u003e\n            \u003ctd\u003e48.00\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ca href=\"https://amzn.to/3BwBIXv\"\u003eBed Pressure Mats\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e4\u003c/td\u003e\n            \u003ctd\u003e11.79\u003c/td\u003e\n            \u003ctd\u003e47.16\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ci\u003e\u003cb\u003eTotal\u003c/b\u003e\u003c/i\u003e\u003c/td\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n            \u003ctd\u003e\u003cb\u003e431.04\u003c/b\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n    \u003cthead\u003e\n        \u003ctr\u003e\n            \u003cth\u003eMedia player 📺🔈\u003c/th\u003e\n            \u003cth\u003eUnits (#)\u003c/th\u003e\n            \u003cth\u003ePrice per unit (£)\u003c/th\u003e\n            \u003cth\u003ePrice (£)\u003c/th\u003e\n        \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ca href=\"https://amzn.to/3DfYOmp\"\u003eSamsung Q60AA\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e1\u003c/td\u003e\n            \u003ctd\u003e559.00\u003c/td\u003e\n            \u003ctd\u003e559.00\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ca href=\"https://amzn.to/3Qydv7u\"\u003eBLAUPUNKT 32\"\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e1\u003c/td\u003e\n            \u003ctd\u003e139.95\u003c/td\u003e\n            \u003ctd\u003e139.95\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ca href=\"https://amzn.to/3RWi2Sk\"\u003eSONOS Play 1\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e1\u003c/td\u003e\n            \u003ctd\u003e164.99\u003c/td\u003e\n            \u003ctd\u003e164.99\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ca href=\"https://store.google.com/gb/product/google_nest_mini?hl=en-GB\u0026pli=1\"\u003eGoogle Nest Hub Mini\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e2\u003c/td\u003e\n            \u003ctd\u003e27.99\u003c/td\u003e\n            \u003ctd\u003e55.98\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ca href=\"https://amzn.to/3RHybLK\"\u003eLenovo M10 Tablet with Ethernet Connection\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e1\u003c/td\u003e\n            \u003ctd\u003e79.99\u003c/td\u003e\n            \u003ctd\u003e79.99\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ca href=\"https://amzn.to/3But0J8\"\u003eXBOX One Console\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e1\u003c/td\u003e\n            \u003ctd\u003e164.97\u003c/td\u003e\n            \u003ctd\u003e164.97\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ca href=\"https://amzn.to/3RyR7Mo\"\u003eApple Mac Mini\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e1\u003c/td\u003e\n            \u003ctd\u003e629.97\u003c/td\u003e\n            \u003ctd\u003e629.97\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ca href=\"https://amzn.to/3d2Ivi6\"\u003eMacBook Air\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e2\u003c/td\u003e\n            \u003ctd\u003e949.00\u003c/td\u003e\n            \u003ctd\u003e1898.00\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ci\u003e\u003cb\u003eTotal\u003c/b\u003e\u003c/i\u003e\u003c/td\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n            \u003ctd\u003e\u003cb\u003e3,692.85\u003c/b\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n    \u003cthead\u003e\n        \u003ctr\u003e\n            \u003cth\u003eLights 💡\u003c/th\u003e\n            \u003cth\u003eUnits (#)\u003c/th\u003e\n            \u003cth\u003ePrice per unit (£)\u003c/th\u003e\n            \u003cth\u003ePrice (£)\u003c/th\u003e\n        \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ca href=\"https://amzn.to/3RKY4K6\"\u003eLepro GU10 LED RGB Bulb\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e10\u003c/td\u003e\n            \u003ctd\u003e9.00\u003c/td\u003e\n            \u003ctd\u003e90.00\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ca href=\"https://amzn.to/3RNhQEY\"\u003eLepro E14 LED Dimmable Bulb\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e2\u003c/td\u003e\n            \u003ctd\u003e8.50\u003c/td\u003e\n            \u003ctd\u003e17.00\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ca href=\"https://amzn.to/3RVTDME\"\u003eLepro LED Strip RGB 5m\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e10\u003c/td\u003e\n            \u003ctd\u003e15.99\u003c/td\u003e\n            \u003ctd\u003e159.90\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ca href=\"https://amzn.to/3U59JFI\"\u003eGovee DreamView T1 Immersion LED Kit\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e1\u003c/td\u003e\n            \u003ctd\u003e56.09\u003c/td\u003e\n            \u003ctd\u003e56.09\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ca href=\"https://amzn.to/3DgTnnb\"\u003eMathmos Astro Lava Lamp\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e1\u003c/td\u003e\n            \u003ctd\u003e82.00\u003c/td\u003e\n            \u003ctd\u003e82.00\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ci\u003e\u003cb\u003eTotal\u003c/b\u003e\u003c/i\u003e\u003c/td\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n            \u003ctd\u003e\u003cb\u003e404.99\u003c/b\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n    \u003cthead\u003e\n        \u003ctr\u003e\n            \u003cth\u003eHubs 🌎\u003c/th\u003e\n            \u003cth\u003eUnits (#)\u003c/th\u003e\n            \u003cth\u003ePrice per unit (£)\u003c/th\u003e\n            \u003cth\u003ePrice (£)\u003c/th\u003e\n        \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ca href=\"https://amzn.to/3DfZWq9\"\u003eConBee II\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e1\u003c/td\u003e\n            \u003ctd\u003e37.42\u003c/td\u003e\n            \u003ctd\u003e37.42\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ca href=\"https://amzn.to/3QC57DT\"\u003eAqara M2 Hub\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e1\u003c/td\u003e\n            \u003ctd\u003e54.99\u003c/td\u003e\n            \u003ctd\u003e54.99\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ca href=\"https://bit.ly/3rmfRvY\"\u003eTuya Zigbee 3.0 Mini Signal Repeater\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e1\u003c/td\u003e\n            \u003ctd\u003e14.15\u003c/td\u003e\n            \u003ctd\u003e14.15\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ca href=\"https://amzn.to/3DhHHRd\"\u003eSwitchBot Hub\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e1\u003c/td\u003e\n            \u003ctd\u003e35.00\u003c/td\u003e\n            \u003ctd\u003e35.00\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ci\u003e\u003cb\u003eTotal\u003c/b\u003e\u003c/i\u003e\u003c/td\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n            \u003ctd\u003e\u003cb\u003e141.56\u003c/b\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n    \u003cthead\u003e\n        \u003ctr\u003e\n            \u003cth\u003eServer \u0026 Network 🖥\u003c/th\u003e\n            \u003cth\u003eUnits (#)\u003c/th\u003e\n            \u003cth\u003ePrice per unit (£)\u003c/th\u003e\n            \u003cth\u003ePrice (£)\u003c/th\u003e\n        \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ca href=\"https://thepihut.com/collections/raspberry-pi-boards/products/raspberry-pi-4-model-b?variant=31994565689406\"\u003eRaspberry Pi 4 Model B, 8GB RAM\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e2\u003c/td\u003e\n            \u003ctd\u003e75.50\u003c/td\u003e\n            \u003ctd\u003e151.00\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ca href=\"https://thepihut.com/products/iceberry-all-in-one-cooling-case-for-raspberry-pi-4\u003c\"\u003eRaspberry Pi 4 IceBerry Cooling Case\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e2\u003c/td\u003e\n            \u003ctd\u003e16.00\u003c/td\u003e\n            \u003ctd\u003e32.00\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ca href=\"https://amzn.to/3RSLQyV\"\u003e250GB SSD in Case\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e2\u003c/td\u003e\n            \u003ctd\u003e35.00\u003c/td\u003e\n            \u003ctd\u003e70.00\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ca href=\"https://amzn.to/3evknF8\"\u003eTP-Link TL-SG1005D, 5 Port Gigabit Ethernet Network Switch\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e1\u003c/td\u003e\n            \u003ctd\u003e10.49\u003c/td\u003e\n            \u003ctd\u003e10.49\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ca href=\"https://amzn.to/3xceHXm\"\u003eCoral USB Accelerator\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e1\u003c/td\u003e\n            \u003ctd\u003e120.00\u003c/td\u003e\n            \u003ctd\u003e120.00\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ca href=\"https://amzn.to/3DxxWyD\"\u003eTP-Link TL-PA4010KIT Nano AV600 Powerline Adapter\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e3\u003c/td\u003e\n            \u003ctd\u003e23.41\u003c/td\u003e\n            \u003ctd\u003e70.23\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ci\u003e\u003cb\u003eTotal\u003c/b\u003e\u003c/i\u003e\u003c/td\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n            \u003ctd\u003e\u003cb\u003e453.72\u003c/b\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n    \u003cthead\u003e\n        \u003ctr\u003e\n            \u003cth\u003eDevice tracker 🔍\u003c/th\u003e\n            \u003cth\u003eUnits (#)\u003c/th\u003e\n            \u003cth\u003ePrice per unit (£)\u003c/th\u003e\n            \u003cth\u003ePrice (£)\u003c/th\u003e\n        \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ca href=\"https://amzn.to/3eJRXHu\"\u003eiPhone 13 Pro Max with Companion App\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e1\u003c/td\u003e\n            \u003ctd\u003e1049.00\u003c/td\u003e\n            \u003ctd\u003e1049.00\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ca href=\"https://amzn.to/3xe5HAO\"\u003eiPhone 11 with Companion App\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e1\u003c/td\u003e\n            \u003ctd\u003e429.00\u003c/td\u003e\n            \u003ctd\u003e429.00\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ca href=\"https://apple.co/3ftvkro\"\u003eApple Watch Series 8 45mm\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e1\u003c/td\u003e\n            \u003ctd\u003e449.00\u003c/td\u003e\n            \u003ctd\u003e449.00\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003ci\u003e\u003cb\u003eTotal\u003c/b\u003e\u003c/i\u003e\u003c/td\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n            \u003ctd\u003e\u003cb\u003e1,927.00\u003c/b\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n            \u003ctd\u003e\u0026nbsp;\u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n    \u003cthead\u003e\n        \u003ctr\u003e\n            \u003cth\u003eTotal of Smart Home Devices (excl Media/Device Tracker) \u003cbr /\u003e [as at Sept 22 (UK)]\u003c/th\u003e\n            \u003cth\u003e\u003c/th\u003e\n            \u003cth\u003e\u003c/th\u003e\n            \u003cth\u003e\u003cb\u003e£1,672.64\u003c/b\u003e\u003c/th\u003e\n        \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003cthead\u003e\n        \u003ctr\u003e\n            \u003cth\u003eTotal of All Devices (incl Media/Device Tracker) \u003cbr /\u003e [as at Sept 22 (UK)]\u003c/th\u003e\n            \u003cth\u003e\u003c/th\u003e\n            \u003cth\u003e\u003c/th\u003e\n            \u003cth\u003e\u003cb\u003e😳£7,282.49😳\u003c/b\u003e\u003c/th\u003e\n        \u003c/tr\u003e\n    \u003c/thead\u003e\n\u003c/table\u003e\n\u003c!-- end-table --\u003e\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\u003c/details\u003e\n\u0026nbsp;\n\u003c!-- ADD-ONS --\u003e\n\u003ca name=\"addons\"\u003e\u003c/a\u003e\n\n## Add-Ons _(as at Oct 22)_\n\nThis is a list of all of my add-ons within my setup. These also include the HACS integrations I currently use.\n\n\u003c!-- start-addons --\u003e\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eStandard Add-Ons\u003c/b\u003e\u003c/summary\u003e\n\n- [ESPHome](https://github.com/esphome/esphome) version 2022.9.2 by @esphome\n- [Frigate NVR](https://github.com/blakeblackshear/frigate) version 0.11.0 by @blakeblackshear\n- [Home Assistant Google Drive Backup](https://github.com/sabeechen/hassio-google-drive-backup) version 0.108.4 by @sabeechen\n- [Mosquitto Broker](https://github.com/home-assistant/addons/tree/master/mosquitto) version 6.1.3 by @hassio-addons\n- [Node-RED](https://github.com/hassio-addons/addon-node-red) version 13.4.0 by @hassio-addons\n- [Samba Share](https://github.com/home-assistant/addons/tree/master/samba) version 10.0.0 by @hassio-addons\n- [InfluxDB](https://github.com/hassio-addons/addon-influxdb) version 4.5.0 by @hassio-addons\n- [Studio Code Server](https://github.com/hassio-addons/addon-vscode) version 5.4.0 by @hassio-addons\n- [Terminal \u0026 SSH](https://github.com/hassio-addons/addon-ssh) version 9.6.1 by @hassio-addons\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\u003c/details\u003e\n\u003c!-- end-addons --\u003e\n\n\u003c!-- start-hacs-integrations --\u003e\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eHACS Integrations \u003ci\u003e(as at Oct 22)\u003c/i\u003e\u003c/b\u003e\u003c/summary\u003e\n\n- [HACS](https://github.com/hacs) version 1.27.1 by @ludeeus\n- [Spotcast](https://github.com/fondberg/spotcast) version 3.6.30 by @fondberg\n- [MeteoAlarm](https://github.com/kodi1/meteoalarm) version 294bc3a by @kodi1\n- [Car Wash](https://github.com/Limych/ha-car_wash) version 1.5.4 by @Limych\n- [SamsungTV Smart Component](https://github.com/ollo69/ha-samsungtv-smart) version 0.7.6 by @jaruba\n- [Browser Mod](https://github.com/thomasloven/hass-browser_mod) version 2.1.3 by @thomasloven\n- [Node-RED Companion](https://github.com/zachowj/hass-node-red) version 1.0.9 by @zachowj\n- [Sonoff LAN](https://github.com/AlexxIT/SonoffLAN) version 3.2.0 by @AlexxIT\n- [Google Home](https://github.com/leikoilja/ha-google-home) version 1.9.15 by @leikoilja\n- [GOVEE](https://github.com/LaggAt/hacs-govee) version 0.2.2 by @LaggAt\n- [Frigate](https://github.com/blakeblackshear/frigate-hass-integration) version 2.3 by @blakeblackshear\n- [Tapo Controller](https://github.com/petretiandrea/home-assistant-tapo-p100) version 1.2.15 by @petretinandrea\n- [UI Lovelace Minimalist](https://github.com/UI-Lovelace-Minimalist/UI) version 1.1.2 by @stokkie90\n- [Watchman](https://github.com/dummylabs/thewatchman#configuration) version 0.6.0 by @dummylabs\n- [LondonTfL](https://github.com/morosanmihail/HA-LondonTfL) version 0.3.1 by @morosanmihail\n- [Music Assistant](https://github.com/music-assistant/hass-music-assistant) version 2022.8.4 by @marcelveldt\n- [Mail and Packages](https://github.com/moralmunky/Home-Assistant-Mail-And-Packages) version 0.3.4 by @firstof9\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\u003c/details\u003e\n\u003c!-- end-hacs-integrations --\u003e\n\n\u003c!-- start-hacs-frontend --\u003e\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eHACS Frontend \u003ci\u003e(as at Oct 22)\u003c/i\u003e\u003c/b\u003e\u003c/summary\u003e\n\n- [Swipe Card](https://github.com/bramkragten/swipe-card) version 4.0.0 by @bramkragten\n- [Button Card](https://github.com/custom-cards/button-card) version 3.5.0 by @RomRider\n- [Decluttering Card](https://github.com/custom-cards/decluttering-card) version 0.6.3 @RomRider\n- [HASL Departure Card](https://github.com/hasl-sensor/lovelace-hasl-departure-card) version 2.5.0 by @hasl-sensor\n- [Restriction Card](https://github.com/iantrich/restriction-card) version 1.2.7 by @iantrich\n- [Mini Media Player](https://github.com/kalkih/mini-media-player) version 1.16.4 by @kalkih\n- [Light Entity Card](https://github.com/ljmerza/light-entity-card) version 5.0.0 by @ljmerza\n- [TV Remote Card](https://github.com/marrobHD/tv-card) version 0.2.0 by @marrobHD\n- [Card Mod](https://github.com/thomasloven/lovelace-card-mod) version 3.1.5 by @thomasloven\n- [Layout Card](https://github.com/thomasloven/lovelace-layout-card) version 2.4.2 by @thomasloven\n- [Apex Charts Card](https://github.com/RomRider/apexcharts-card) version 2.0.1 by @RomRider\n- [Notify Card](https://github.com/bernikr/lovelace-notify-card) version f0b8b1f\n- [Mini Graph Card](https://github.com/kalkih/mini-graph-card) version 0.11.0 by @kalkih\n- [Frigate Card](https://github.com/dermotduffy/frigate-hass-card) version 3.0.0 by @dermotduffy\n- [Atomic Calendar Revive](https://github.com/totaldebug/atomic-calendar-revive) version 7.0.1 by @totaldebug\n- [Mushroom UI](https://github.com/piitaya/lovelace-mushroom) version 2.1.3 by @piitaya\n- [Mushroom Themes](https://github.com/piitaya/lovelace-mushroom-themes) version 0.0.2 by @piitaya\n- [Weather Radar Card](https://github.com/Makin-Things/weather-radar-card) version 2.0.6 by @Makin-Things\n- [Slider Button Card](https://github.com/custom-cards/slider-button-card) version 1.10.9 by @mattieha\n- [Kiosk Mode](https://github.com/NemesisRE/kiosk-mode) version 1.7.3 by @NemesisRE\n- [My Cards Bundle](https://github.com/AnthonMS/my-cards) version 1.0.2 by @AnthonMS\n- [Auto Entities](https://github.com/thomasloven/lovelace-auto-entities) version 1.11.0 by @thomasloven\n- [Spotify Lovelace Card](https://github.com/custom-cards/spotify-card) version 2.4.0 by @fondberg\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\u003c/details\u003e\n\u003c!-- end-hacs-frontend --\u003e\n\u0026nbsp;\n\n\u003c!-- start-automations --\u003e\n\n\u003c!-- ALL AUTOMATIONS --\u003e\n\n\u003ca name=\"automations\"\u003e\u003c/a\u003e\n\n## All Automations _(as at Sept 22)_\n\n\u003c!-- SECURITY AUTOMATIONS --\u003e\n\u003ca name=\"security\"\u003e\u003c/a\u003e\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003e\u003ca href=\"https://github.com/smcnab1/home-assistant-config/tree/master/automations/alarm\"\u003eSecurity 👮🚨 Automations (10 automations)\u003c/a\u003e\u003c/b\u003e\u003c/summary\u003e\u003cblockquote\u003e\n    \n\u003c!-- 1 --\u003e\n    \n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003e\u003ca name=\"https://github.com/smcnab1/home-assistant-config/blob/master/automations/alarm/arm_notify_reminder.yaml\"\u003eAlarm Arm Notifiction Reminder\u003c/a\u003e\u003c/b\u003e\u003c/summary\u003e\n\u003cb\u003e\u003ci\u003eRemind everyone to arm the alarm when leaving the house. Only if alarm hasn't already been set.\u003c/b\u003e\u003c/i\u003e\n\n\u0026nbsp;\u0026nbsp;_which uses:_\n\n- [alarm_control_panel.home_alarm](https://github.com/smcnab1/home-assistant-config/blob/master/entities/alarm.yaml)\n- [zone.home](https://github.com/smcnab1/home-assistant-config/blob/master/entities/zone.yaml)\n- [HA Actionable Notifications](https://companion.home-assistant.io/docs/notifications/actionable-notifications/) \u003c/details\u003e\n  \n\u003c!-- 2 --\u003e\n \n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003e\u003ca name=\"https://github.com/smcnab1/home-assistant-config/blob/master/automations/alarm/arm_notify_actions.yaml\"\u003eAlarm Arm Notifiction Actions\u003c/a\u003e\u003c/b\u003e\u003c/summary\u003e\n\u003cb\u003e\u003ci\u003eThis automation arms the alarm and sends notifications to everyone to confirm it is now armed.\u003c/b\u003e\u003c/i\u003e\n\n\u0026nbsp;\u0026nbsp;_which uses:_\n\n- [alarm_control_panel.home_alarm](https://github.com/smcnab1/home-assistant-config/blob/master/automations/alarm/arm_notify_reminder.yaml)\n- [zone.home](https://github.com/smcnab1/home-assistant-config/blob/master/entities/zone.yaml)\n- [HA Actionable Notifications](https://companion.home-assistant.io/docs/notifications/actionable-notifications/) \u003c/details\u003e\n    \n\u003c!-- 3 --\u003e\n    \n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003e\u003ca name=\"https://github.com/smcnab1/home-assistant-config/blob/master/automations/alarm/disarm_notify.yaml\"\u003eAlarm Disarm Nofification\u003c/a\u003e\u003c/b\u003e\u003c/summary\u003e\n\u003cb\u003e\u003ci\u003eAutomation to disarm the alarm and notify everyone that it has been disarmed following the alarm triggering.\u003c/b\u003e\u003c/i\u003e\n\n\u0026nbsp;\u0026nbsp;_which uses:_\n\n- [alarm_control_panel.home_alarm](https://github.com/smcnab1/home-assistant-config/blob/master/automations/alarm/arm_notify_reminder.yaml)\n- [HA Actionable Notifications](https://companion.home-assistant.io/docs/notifications/actionable-notifications/) \u003c/details\u003e\n\n\u003c!-- 4 --\u003e\n    \n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003e\u003ca name=\"https://github.com/smcnab1/home-assistant-config/blob/master/automations/alarm/overnight_living_room.yaml\"\u003eAlarm Overnight Living Room\u003c/a\u003e\u003c/b\u003e\u003c/summary\u003e\n\u003cb\u003e\u003ci\u003eAutomation to send notification and camera screenshot to bedroom TV if motion detected in Living Room when everyone is asleep.\u003c/b\u003e\u003c/i\u003e\n\n\u0026nbsp;\u0026nbsp;_which uses:_\n\n- [input_boolean.sleeping](https://github.com/smcnab1/home-assistant-config/blob/master/entities/input_boolean/all_sleeping.yaml)\n- [MQTT Add-On](https://github.com/home-assistant/addons/tree/master/mosquitto)\n- [Frigate Add-On](https://github.com/blakeblackshear/frigate)\n- [Android TV Notifications Integration](https://www.home-assistant.io/integrations/nfandroidtv/)\n- [Android TV Integration](https://www.home-assistant.io/integrations/androidtv/)\u003c/details\u003e\n\n\u003c!-- 5 --\u003e\n    \n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003e\u003ca name=\"https://github.com/smcnab1/home-assistant-config/blob/master/automations/alarm/trigger.yaml\"\u003eAlarm Trigger\u003c/a\u003e\u003c/b\u003e\u003c/summary\u003e\n\u003cb\u003e\u003ci\u003eAutomation to trigger the alarm if motion is detected within the house when set to armed away and nobody home.\u003c/b\u003e\u003c/i\u003e\n\n\u0026nbsp;\u0026nbsp;_which uses:_\n\n- [alarm_control_panel.home_alarm](https://github.com/smcnab1/home-assistant-config/blob/master/automations/alarm/arm_notify_reminder.yaml) \u003c/details\u003e\n\n\u003c!-- 6 --\u003e\n  \n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003e\u003ca name=\"https://github.com/smcnab1/home-assistant-config/blob/master/automations/alarm/trigger_lighting.yaml\"\u003eAlarm Trigger Lighting\u003c/a\u003e\u003c/b\u003e\u003c/summary\u003e\n\u003cb\u003e\u003ci\u003eAutomation to trigger the lighting sequence if alarm is triggered when set to armed away and nobody home.\u003c/b\u003e\u003c/i\u003e\n\n\u0026nbsp;\u0026nbsp;_which uses:_\n\n- [alarm_control_panel.home_alarm](https://github.com/smcnab1/home-assistant-config/blob/master/automations/alarm/arm_notify_reminder.yaml) \u003c/details\u003e\n\n\u003c!-- 7 --\u003e\n  \n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003e\u003ca name=\"https://github.com/smcnab1/home-assistant-config/blob/master/automations/alarm/trigger_sound.yaml\"\u003eAlarm Trigger Sound\u003c/a\u003e\u003c/b\u003e\u003c/summary\u003e\n\u003cb\u003e\u003ci\u003eAutomation to trigger the sound sequence if alarm is triggered when set to armed away and nobody home. Includes audible siren and TTS.\u003c/b\u003e\u003c/i\u003e\n\n\u0026nbsp;\u0026nbsp;_which uses:_\n\n- [alarm_control_panel.home_alarm](https://github.com/smcnab1/home-assistant-config/blob/master/automations/alarm/arm_notify_reminder.yaml)\n- [Nabu-Casa TTS Cloud](https://www.nabucasa.com/config/tts/) \u003c/details\u003e\n\n\u003c!-- 8 --\u003e\n  \n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003e\u003ca name=\"https://github.com/smcnab1/home-assistant-config/blob/master/automations/alarm/trigger_notify.yaml\"\u003eAlarm Trigger Notify\u003c/a\u003e\u003c/b\u003e\u003c/summary\u003e\n\u003cb\u003e\u003ci\u003eAutomation to notify everyone when the alarm is triggered when set to armed away and nobody home.\u003c/b\u003e\u003c/i\u003e\n\n\u0026nbsp;\u0026nbsp;_which uses:_\n\n- [alarm_control_panel.home_alarm](https://github.com/smcnab1/home-assistant-config/blob/master/automations/alarm/arm_notify_reminder.yaml)\n- [HA Actionable Notifications](https://companion.home-assistant.io/docs/notifications/actionable-notifications/) \u003c/details\u003e\n\n\u003c!-- 9 --\u003e\n  \n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003e\u003ca name=\"https://github.com/smcnab1/home-assistant-config/blob/master/automations/alarm/disarm_tag.yaml\"\u003eAlarm Disarm Tag\u003c/a\u003e\u003c/b\u003e\u003c/summary\u003e\n\u003cb\u003e\u003ci\u003eNFC Tag used to easily disarm the alarm system\u003c/b\u003e\u003c/i\u003e\n\n\u0026nbsp;\u0026nbsp;_which uses:_\n\n- [alarm_control_panel.home_alarm](https://github.com/smcnab1/home-assistant-config/blob/master/automations/alarm/arm_notify_reminder.yaml)\n- [HA NFC Tag Integration](https://www.home-assistant.io/blog/2020/09/15/home-assistant-tags/) \u003c/details\u003e\n\n\u003c!-- 10 --\u003e\n  \n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003e\u003ca name=\"https://github.com/smcnab1/home-assistant-config/blob/master/automations/alarm/arm_tag.yaml\"\u003eAlarm Arm Tag\u003c/a\u003e\u003c/b\u003e\u003c/summary\u003e\n\u003cb\u003e\u003ci\u003eNFC Tag used to easily arm the alarm system\u003c/b\u003e\u003c/i\u003e\n\n\u0026nbsp;\u0026nbsp;_which uses:_\n\n- [alarm_control_panel.home_alarm](https://github.com/smcnab1/home-assistant-config/blob/master/automations/alarm/arm_notify_reminder.yaml)\n- [HA NFC Tag Integration](https://www.home-assistant.io/blog/2020/09/15/home-assistant-tags/) \u003c/details\u003e\n\n\u003c/blockquote\u003e\u003c/details\u003e\n\n\u003c!-- LIGHTING AUTOMATIONS --\u003e\n\u003ca name=\"lighting\"\u003e\u003c/a\u003e\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003e\u003ca href=\"https://github.com/smcnab1/home-assistant-config/tree/master/automations/lighting\"\u003eLighting 🌄🌇 Automations (42 automations)\u003c/a\u003e\u003c/b\u003e\u003c/summary\u003e\u003cblockquote\u003e\n\n\u003c!-- BATHROOM LIGHTING AUTOMATIONS --\u003e\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003e\u003ca name=\"https://github.com/smcnab1/home-assistant-config/tree/master/automations/lighting/bathroom\"\u003eBathroom 🛀 Lighting\u003c/a\u003e\u003c/b\u003e\u003c/summary\u003e\u003cblockquote\u003e\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eBathroom Motion Automation\u003c/b\u003e\u003c/summary\u003e\u003cblockquote\u003e\n\u003cb\u003e\u003ci\u003eAutomation which works with motion sensors to activate and de-activate lighting. Also depends on time of day.\u003c/b\u003e\u003c/i\u003e\n\n![Node-Red Flow](https://i.imgur.com/EY4Z9MB.png)\n\n\u003cdetails\u003e\u003csummary\u003eNode-Red Code\u003c/summary\u003e\u003cblockquote\u003e\n[{\"id\":\"3fe087dd9290cd30\",\"type\":\"subflow\",\"name\":\"Lights Motion Control\",\"info\":\"\",\"category\":\"home_assistant\",\"in\":[{\"x\":57,\"y\":162,\"wires\":[{\"id\":\"ef28eae7ed719fef\"}]}],\"out\":[{\"x\":470,\"y\":375,\"wires\":[{\"id\":\"7979d0139dcbb40b\",\"port\":0}]},{\"x\":560,\"y\":390,\"wires\":[{\"id\":\"7979d0139dcbb40b\",\"port\":1}]},{\"x\":650,\"y\":75,\"wires\":[{\"id\":\"41569ba311d53f87\",\"port\":0}]},{\"x\":890,\"y\":105,\"wires\":[{\"id\":\"dc014e6fd4f7b01b\",\"port\":0}]}],\"env\":[{\"name\":\"timeOffAfter\",\"type\":\"num\",\"value\":\"120\"},{\"name\":\"manualCooldown\",\"type\":\"num\",\"value\":\"30\"},{\"name\":\"brightness\",\"type\":\"num\",\"value\":\"100\",\"ui\":{\"type\":\"input\",\"opts\":{\"types\":[\"num\",\"bool\",\"json\",\"bin\"]}}},{\"name\":\"transitionOn\",\"type\":\"num\",\"value\":\"2\"},{\"name\":\"transitionOff\",\"type\":\"num\",\"value\":\"2\"},{\"name\":\"pause\",\"type\":\"str\",\"value\":\"5\"},{\"name\":\"controlLights\",\"type\":\"str\",\"value\":\"\"},{\"name\":\"manualLight\",\"type\":\"bool\",\"value\":\"false\"}],\"meta\":{},\"color\":\"#52C0F2\",\"icon\":\"font-awesome/fa-lightbulb-o\",\"status\":{\"x\":1027,\"y\":157,\"wires\":[{\"id\":\"67740cc1abae3f4d\",\"port\":0}]}},{\"id\":\"69b69fb47d2e171c\",\"type\":\"change\",\"z\":\"3fe087dd9290cd30\",\"name\":\"motion\",\"rules\":[{\"t\":\"set\",\"p\":\"payload\",\"pt\":\"msg\",\"to\":\"motion\",\"tot\":\"str\"}],\"action\":\"\",\"property\":\"\",\"from\":\"\",\"to\":\"\",\"reg\":false,\"x\":544,\"y\":178,\"wires\":[[\"dc014e6fd4f7b01b\"]]},{\"id\":\"dc014e6fd4f7b01b\",\"type\":\"state-machine\",\"z\":\"3fe087dd9290cd30\",\"name\":\"\",\"triggerProperty\":\"payload\",\"triggerPropertyType\":\"msg\",\"stateProperty\":\"payload\",\"statePropertyType\":\"msg\",\"initialDelay\":\"\",\"persistOnReload\":true,\"outputStateChangeOnly\":true,\"throwException\":false,\"states\":[\"switch\",\"motion-detected\",\"motion-on\",\"motion-off\",\"off\",\"on\"],\"transitions\":[{\"name\":\"motion\",\"from\":\"off\",\"to\":\"motion-detected\"},{\"name\":\"motion\",\"from\":\"motion-off\",\"to\":\"motion-detected\"},{\"name\":\"motion\",\"from\":\"motion-on\",\"to\":\"motion-on\"},{\"name\":\"off\",\"from\":\"*\",\"to\":\"off\"},{\"name\":\"on\",\"from\":\"*\",\"to\":\"on\"},{\"name\":\"switch\",\"from\":\"off\",\"to\":\"switch\"},{\"name\":\"switch\",\"from\":\"on\",\"to\":\"switch\"},{\"name\":\"switch\",\"from\":\"switch\",\"to\":\"switch\"},{\"name\":\"switch\",\"from\":\"motion-on\",\"to\":\"switch\"},{\"name\":\"motion-on\",\"from\":\"motion-detected\",\"to\":\"motion-on\"},{\"name\":\"motion-off\",\"from\":\"motion-on\",\"to\":\"motion-off\"}],\"x\":741,\"y\":157,\"wires\":[[\"7979d0139dcbb40b\",\"67740cc1abae3f4d\"]]},{\"id\":\"c0ac9957e8074a3a\",\"type\":\"change\",\"z\":\"3fe087dd9290cd30\",\"name\":\"switch\",\"rules\":[{\"t\":\"set\",\"p\":\"payload\",\"pt\":\"msg\",\"to\":\"switch\",\"tot\":\"str\"}],\"action\":\"\",\"property\":\"\",\"from\":\"\",\"to\":\"\",\"reg\":false,\"x\":541,\"y\":223,\"wires\":[[\"dc014e6fd4f7b01b\"]]},{\"id\":\"b808c7939e262898\",\"type\":\"change\",\"z\":\"3fe087dd9290cd30\",\"name\":\"stop\",\"rules\":[{\"t\":\"set\",\"p\":\"reset\",\"pt\":\"msg\",\"to\":\"true\",\"tot\":\"bool\"}],\"action\":\"\",\"property\":\"\",\"from\":\"\",\"to\":\"\",\"reg\":false,\"x\":440,\"y\":630,\"wires\":[[\"5436a3c1b895bd12\"]]},{\"id\":\"529401309069e7e5\",\"type\":\"inject\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Initial State\",\"props\":[{\"p\":\"reset\",\"v\":\"true\",\"vt\":\"bool\"},{\"p\":\"topic\",\"vt\":\"str\"}],\"repeat\":\"\",\"crontab\":\"\",\"once\":true,\"onceDelay\":\"10\",\"topic\":\"\",\"x\":665,\"y\":570,\"wires\":[[\"4060d565fc3941d1\",\"f4e6ddd8960529f3\"]]},{\"id\":\"18d112236dd3f2c6\",\"type\":\"link in\",\"z\":\"3fe087dd9290cd30\",\"name\":\"\",\"links\":[\"774c661db65310b7\",\"f95e514e2b0be219\"],\"x\":592,\"y\":120,\"wires\":[[\"dc014e6fd4f7b01b\"]]},{\"id\":\"774c661db65310b7\",\"type\":\"link out\",\"z\":\"3fe087dd9290cd30\",\"name\":\"living room state\",\"links\":[\"18d112236dd3f2c6\"],\"x\":1020,\"y\":570,\"wires\":[]},{\"id\":\"7979d0139dcbb40b\",\"type\":\"switch\",\"z\":\"3fe087dd9290cd30\",\"name\":\"State Action\",\"property\":\"payload\",\"propertyType\":\"msg\",\"rules\":[{\"t\":\"eq\",\"v\":\"motion-detected\",\"vt\":\"str\"},{\"t\":\"eq\",\"v\":\"motion-off\",\"vt\":\"str\"},{\"t\":\"eq\",\"v\":\"motion-on\",\"vt\":\"str\"},{\"t\":\"eq\",\"v\":\"switch\",\"vt\":\"str\"}],\"checkall\":\"true\",\"repair\":false,\"outputs\":4,\"x\":230,\"y\":465,\"wires\":[[\"83884d0cb7a1e2a8\",\"f9350e6c9e6be889\"],[\"ab49cdb37a246459\"],[\"d826541759debe8b\"],[\"b808c7939e262898\",\"ae931f01824e1cbc\"]]},{\"id\":\"ece9daf5e1c3fe6c\",\"type\":\"rbe\",\"z\":\"3fe087dd9290cd30\",\"name\":\"\",\"func\":\"rbe\",\"gap\":\"\",\"start\":\"\",\"inout\":\"out\",\"property\":\"payload\",\"x\":369,\"y\":223,\"wires\":[[\"c0ac9957e8074a3a\"]]},{\"id\":\"ef28eae7ed719fef\",\"type\":\"switch\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Topic Route\",\"property\":\"topic\",\"propertyType\":\"msg\",\"rules\":[{\"t\":\"regex\",\"v\":\"^config\\\\b\",\"vt\":\"str\",\"case\":false},{\"t\":\"regex\",\"v\":\"^reset\\\\b\",\"vt\":\"str\",\"case\":false},{\"t\":\"eq\",\"v\":\"light_state\",\"vt\":\"str\"},{\"t\":\"cont\",\"v\":\"sensor.\",\"vt\":\"str\"},{\"t\":\"regex\",\"v\":\"^(light|switch)\\\\.\",\"vt\":\"str\",\"case\":false}],\"checkall\":\"true\",\"repair\":false,\"outputs\":5,\"x\":175,\"y\":162,\"wires\":[[\"41569ba311d53f87\"],[\"6b80334d2b0bd4ab\"],[\"dc014e6fd4f7b01b\"],[\"5855ad1b303c6bc1\"],[\"ece9daf5e1c3fe6c\",\"8ffe714a5901d07d\"]]},{\"id\":\"41569ba311d53f87\",\"type\":\"function\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Update Configuration\",\"func\":\"// Init our Lights state while we're here\\nlet lights = flow.get('lights')\\n// Is this our start-up initialisation? (If so, reset config!)\\nlet init = msg.init || false\\nif (!lights)\\n  flow.set('lights', { state: { }, ids: [], ids_csv: '' })\\n\\n// Merge new Payload with existing config and defaults\\nlet cfg = Object.assign(\\n  // Existing Config\\n  init?flow.get('cfg')||{}:{},  // 'cfg.'+id\\n  // Updated Config\\n  msg.payload)\\n\\n// Make sure Light IDs are initted.\\n// if (!cfg.lights) cfg.lights = []\\nif (!cfg.brightness)\\n  cfg.brightness = env.get('brightness') || 100\\n\\nif (!cfg.transitionOn \u0026\u0026 cfg.transitionOn !== 0)\\n  cfg.transitionOn = env.get('transitionOn') || 2\\n  \\nif (!cfg.transitionOff \u0026\u0026 cfg.transitionOff !== 0)\\n  cfg.transitionOff = env.get('transitionOff') || 2\\n\\nif (!cfg.lights \u0026\u0026 env.get('controlLights') \u0026\u0026 env.get('controlLights').length\u003e0)\\n    cfg.lights = env.get('controlLights').split(/\\\\s*,\\\\s*/)\\n\\nflow.set('cfg', cfg)\\n\\nreturn { topic: 'config', payload: cfg, lights }\",\"outputs\":1,\"noerr\":0,\"initialize\":\"\",\"finalize\":\"\",\"libs\":[],\"x\":505,\"y\":75,\"wires\":[[]]},{\"id\":\"5855ad1b303c6bc1\",\"type\":\"switch\",\"z\":\"3fe087dd9290cd30\",\"name\":\"motion on\",\"property\":\"payload\",\"propertyType\":\"msg\",\"rules\":[{\"t\":\"eq\",\"v\":\"on\",\"vt\":\"str\"}],\"checkall\":\"true\",\"repair\":false,\"outputs\":1,\"x\":375,\"y\":178,\"wires\":[[\"69b69fb47d2e171c\"]]},{\"id\":\"8ffe714a5901d07d\",\"type\":\"function\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Track Lights\",\"func\":\"// Keep a record of all the light entity_ids coming in, for later switching\\n\\nlet lights = flow.get('lights') || { state: { }, ids: [], ids_csv: '' }\\n\\nlet [all, id] = msg.topic.match(/^light\\\\.(.*)/)\\nlet update = false\\n\\nif (id) {\\n  lights.state[id] = msg.data.new_state\\n  if (!lights.ids.includes(id)) {\\n    lights.ids.push(id)\\n    update = true\\n  }\\n  lights.ids_csv = lights.ids.join(',')\\n}\\n\\nflow.set('lights', lights)\\n\\nreturn {update}\",\"outputs\":1,\"noerr\":0,\"initialize\":\"\",\"finalize\":\"\",\"libs\":[],\"x\":389,\"y\":268,\"wires\":[[\"31b931f6b9df7e2e\"]]},{\"id\":\"83884d0cb7a1e2a8\",\"type\":\"function\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Light Cfg\",\"func\":\"let cfg = flow.get('cfg')|| {}\\nlet lights = flow.get('lights') || {}\\n// Use Light IDs from Config if defined - otherwise use detected\\nlet light_ids = cfg.lights || lights.ids\\nlet delay = env.get('pause')*1000\\n\\n// Prepare config paramters for Light On. This is\\n// an Array of Payload Data, one for each light\\nlet payload = light_ids.map(id =\u003e { return {\\n  data: {\\n    brightness: Math.floor(cfg.brightness/100*255),\\n    transition: cfg.transitionOn,\\n    entity_id: 'light.'+id\\n  }\\n}})\\n\\nreturn {\\n    topic: 'light.'+light_ids.join(','),\\n    payload,\\n    delay\\n}\",\"outputs\":1,\"noerr\":0,\"initialize\":\"\",\"finalize\":\"\",\"libs\":[],\"x\":525,\"y\":330,\"wires\":[[\"412fe93b1c4add94\",\"3803e8ecf7384d2b\"]]},{\"id\":\"ab49cdb37a246459\",\"type\":\"function\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Light Cfg\",\"func\":\"let cfg = flow.get('cfg')|| {}\\nlet lights = flow.get('lights') || {}\\n// Use Light IDs from Config if defined - otherwise use detected\\nlet light_ids = cfg.lights || lights.ids\\nlet delay = env.get('pause')*1000\\n\\n// Prepare config paramters for Light Off. This is\\n// an Array of Payload Data, one for each light\\nlet payload = light_ids.map(id =\u003e { return {\\n  data: {\\n    transition: cfg.transitionOff,\\n    entity_id: 'light.'+id\\n  }\\n}})\\n\\nreturn {\\n    topic: 'light.'+light_ids.join(','),\\n    payload,\\n    delay\\n}\",\"outputs\":1,\"noerr\":0,\"initialize\":\"\",\"finalize\":\"\",\"libs\":[],\"x\":525,\"y\":435,\"wires\":[[\"ed01207d5f3679e4\",\"63c85b090efb1c5c\"]]},{\"id\":\"1ec81804eca7f722\",\"type\":\"inject\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Default Configuration\",\"props\":[{\"p\":\"payload\"},{\"p\":\"topic\",\"vt\":\"str\"},{\"p\":\"init\",\"v\":\"true\",\"vt\":\"str\"}],\"repeat\":\"\",\"crontab\":\"\",\"once\":true,\"onceDelay\":0.1,\"topic\":\"config\",\"payload\":\"{}\",\"payloadType\":\"json\",\"x\":235,\"y\":75,\"wires\":[[\"41569ba311d53f87\"]]},{\"id\":\"2dfcf7ed6c713ca9\",\"type\":\"api-call-service\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Turn on light\",\"server\":\"f43d015e.4b29\",\"version\":5,\"debugenabled\":false,\"domain\":\"light\",\"service\":\"turn_on\",\"areaId\":[],\"deviceId\":[],\"entityId\":[],\"data\":\"\",\"dataType\":\"json\",\"mergeContext\":\"\",\"mustacheAltTags\":false,\"outputProperties\":[{\"property\":\"payload\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"data\"}],\"queue\":\"none\",\"x\":1045,\"y\":285,\"wires\":[[]]},{\"id\":\"015672de6c534fb2\",\"type\":\"api-call-service\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Turn off light\",\"server\":\"f43d015e.4b29\",\"version\":5,\"domain\":\"light\",\"service\":\"turn_off\",\"areaId\":[],\"deviceId\":[],\"entityId\":[],\"data\":\"\",\"mergeContext\":\"\",\"outputProperties\":[{\"property\":\"payload\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"data\"}],\"queue\":\"none\",\"x\":1045,\"y\":435,\"wires\":[[]]},{\"id\":\"4060d565fc3941d1\",\"type\":\"function\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Check State\",\"func\":\"// Fetch light state from our \\\"Track Lights\\\" data\\n// - no need for a HA State node\\n\\nlet lights = flow.get('lights') || { state: { }, ids: [], ids_csv: '' }\\nlet cfg = flow.get('cfg')|| {}\\n\\n// Return \\\"on\\\" if any one light is \\\"on\\\"\\nreturn {\\n    topic: 'light.'+lights.ids_csv,\\n    payload: lights.ids.map(id =\u003e lights.state[id].state).includes('on') ? 'on' : 'off'\\n}\",\"outputs\":1,\"noerr\":0,\"initialize\":\"\",\"finalize\":\"\",\"libs\":[],\"x\":910,\"y\":525,\"wires\":[[\"774c661db65310b7\"]]},{\"id\":\"4b0205094e835fcc\",\"type\":\"split\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Each Light\",\"splt\":\"\\\\n\",\"spltType\":\"str\",\"arraySplt\":1,\"arraySpltType\":\"len\",\"stream\":false,\"addname\":\"\",\"x\":880,\"y\":285,\"wires\":[[\"2dfcf7ed6c713ca9\"]]},{\"id\":\"88c1ddf9130a3f60\",\"type\":\"split\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Each Light\",\"splt\":\"\\\\n\",\"spltType\":\"str\",\"arraySplt\":1,\"arraySpltType\":\"len\",\"stream\":false,\"addname\":\"\",\"x\":875,\"y\":435,\"wires\":[[\"015672de6c534fb2\"]]},{\"id\":\"01dd313513cd6bbc\",\"type\":\"function\",\"z\":\"3fe087dd9290cd30\",\"name\":\"motion-on\",\"func\":\"// We use a function here to generate a new clean message\\n\\nreturn {\\n    topic: 'state',\\n    payload: 'motion-on'\\n}\",\"outputs\":1,\"noerr\":0,\"initialize\":\"\",\"finalize\":\"\",\"libs\":[],\"x\":885,\"y\":330,\"wires\":[[\"f95e514e2b0be219\"]]},{\"id\":\"e13e288088919cdf\",\"type\":\"function\",\"z\":\"3fe087dd9290cd30\",\"name\":\"motion-off\",\"func\":\"// We use a function here to generate a new clean message\\n\\nreturn {\\n    topic: 'state',\\n    payload: 'motion-off'\\n}\",\"outputs\":1,\"noerr\":0,\"initialize\":\"\",\"finalize\":\"\",\"libs\":[],\"x\":900,\"y\":615,\"wires\":[[\"774c661db65310b7\"]]},{\"id\":\"f9350e6c9e6be889\",\"type\":\"change\",\"z\":\"3fe087dd9290cd30\",\"name\":\"stop\",\"rules\":[{\"t\":\"set\",\"p\":\"reset\",\"pt\":\"msg\",\"to\":\"true\",\"tot\":\"bool\"}],\"action\":\"\",\"property\":\"\",\"from\":\"\",\"to\":\"\",\"reg\":false,\"x\":530,\"y\":480,\"wires\":[[\"63c85b090efb1c5c\"]]},{\"id\":\"67740cc1abae3f4d\",\"type\":\"function\",\"z\":\"3fe087dd9290cd30\",\"name\":\"status\",\"func\":\"\\nmsg.payload = {\\n    text: msg.payload, \\n    shape: msg.payload.match(/on/) ? 'ring' : 'dot',\\n    fill: msg.payload == 'switch' ? 'red' : 'green'\\n}\\nreturn msg;\",\"outputs\":1,\"noerr\":0,\"x\":928,\"y\":157,\"wires\":[[]]},{\"id\":\"412fe93b1c4add94\",\"type\":\"switch\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Manual?\",\"property\":\"manualLight\",\"propertyType\":\"env\",\"rules\":[{\"t\":\"true\"},{\"t\":\"else\"}],\"checkall\":\"true\",\"repair\":false,\"outputs\":2,\"x\":705,\"y\":285,\"wires\":[[],[\"4b0205094e835fcc\"]]},{\"id\":\"ed01207d5f3679e4\",\"type\":\"switch\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Manual?\",\"property\":\"manualLight\",\"propertyType\":\"env\",\"rules\":[{\"t\":\"true\"},{\"t\":\"else\"}],\"checkall\":\"true\",\"repair\":false,\"outputs\":2,\"x\":705,\"y\":435,\"wires\":[[],[\"88c1ddf9130a3f60\"]]},{\"id\":\"f95e514e2b0be219\",\"type\":\"link out\",\"z\":\"3fe087dd9290cd30\",\"name\":\"living room state\",\"links\":[\"18d112236dd3f2c6\"],\"x\":990,\"y\":330,\"wires\":[]},{\"id\":\"6b80334d2b0bd4ab\",\"type\":\"function\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Reset\",\"func\":\"flow.set('lights', null)\\nflow.set('cfg', null)\\n\\nreturn msg\",\"outputs\":1,\"noerr\":0,\"initialize\":\"\",\"finalize\":\"\",\"libs\":[],\"x\":365,\"y\":135,\"wires\":[[\"41569ba311d53f87\"]]},{\"id\":\"31b931f6b9df7e2e\",\"type\":\"switch\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Updated?\",\"property\":\"update\",\"propertyType\":\"msg\",\"rules\":[{\"t\":\"true\"}],\"checkall\":\"true\",\"repair\":false,\"outputs\":1,\"x\":540,\"y\":270,\"wires\":[[\"41569ba311d53f87\"]]},{\"id\":\"3803e8ecf7384d2b\",\"type\":\"trigger\",\"z\":\"3fe087dd9290cd30\",\"name\":\"pause\",\"op1\":\"\",\"op2\":\"\",\"op1type\":\"nul\",\"op2type\":\"payl\",\"duration\":\"5\",\"extend\":true,\"overrideDelay\":true,\"units\":\"s\",\"reset\":\"stop\",\"bytopic\":\"all\",\"topic\":\"topic\",\"outputs\":1,\"x\":695,\"y\":330,\"wires\":[[\"01dd313513cd6bbc\"]]},{\"id\":\"63c85b090efb1c5c\",\"type\":\"trigger\",\"z\":\"3fe087dd9290cd30\",\"name\":\"pause\",\"op1\":\"\",\"op2\":\"\",\"op1type\":\"nul\",\"op2type\":\"payl\",\"duration\":\"5\",\"extend\":true,\"overrideDelay\":true,\"units\":\"s\",\"reset\":\"stop\",\"bytopic\":\"all\",\"topic\":\"topic\",\"outputs\":1,\"x\":695,\"y\":480,\"wires\":[[\"4060d565fc3941d1\"]]},{\"id\":\"f4e6ddd8960529f3\",\"type\":\"trigger\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Back to Auto\",\"op1\":\"\",\"op2\":\"\",\"op1type\":\"nul\",\"op2type\":\"payl\",\"duration\":\"5\",\"extend\":true,\"overrideDelay\":true,\"units\":\"s\",\"reset\":\"stop\",\"bytopic\":\"all\",\"topic\":\"topic\",\"outputs\":1,\"x\":715,\"y\":525,\"wires\":[[\"4060d565fc3941d1\"]]},{\"id\":\"ae931f01824e1cbc\",\"type\":\"change\",\"z\":\"3fe087dd9290cd30\",\"name\":\"cooldown\",\"rules\":[{\"t\":\"set\",\"p\":\"delay\",\"pt\":\"msg\",\"to\":\"$env('manualCooldown')*1000\",\"tot\":\"jsonata\"}],\"action\":\"\",\"property\":\"\",\"from\":\"\",\"to\":\"\",\"reg\":false,\"x\":525,\"y\":525,\"wires\":[[\"f4e6ddd8960529f3\"]]},{\"id\":\"d826541759debe8b\",\"type\":\"change\",\"z\":\"3fe087dd9290cd30\",\"name\":\"timeOffAfter\",\"rules\":[{\"t\":\"set\",\"p\":\"delay\",\"pt\":\"msg\",\"to\":\"$env('timeOffAfter')*1000\",\"tot\":\"jsonata\"}],\"action\":\"\",\"property\":\"\",\"from\":\"\",\"to\":\"\",\"reg\":false,\"x\":455,\"y\":585,\"wires\":[[\"5436a3c1b895bd12\"]]},{\"id\":\"5436a3c1b895bd12\",\"type\":\"trigger\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Turn Off after motion ends\",\"op1\":\"\",\"op2\":\"\",\"op1type\":\"nul\",\"op2type\":\"payl\",\"duration\":\"5\",\"extend\":true,\"overrideDelay\":true,\"units\":\"s\",\"reset\":\"stop\",\"bytopic\":\"all\",\"topic\":\"topic\",\"outputs\":1,\"x\":685,\"y\":615,\"wires\":[[\"e13e288088919cdf\"]]},{\"id\":\"c46ec6da75a29ac3\",\"type\":\"tab\",\"label\":\"Bathroom\",\"disabled\":false,\"info\":\"\",\"env\":[]},{\"id\":\"537c7adde52f50c8\",\"type\":\"group\",\"z\":\"c46ec6da75a29ac3\",\"name\":\"Bathroom Lighting - Motion Control\",\"style\":{\"label\":true,\"fill\":\"#bfbfbf\",\"fill-opacity\":\"0.28\"},\"nodes\":[\"5b9a844b4fed15dc\",\"4c25f2418350340f\",\"fcbdc357f6fb230f\",\"83e9fe224cf56eaf\",\"8ccff7d2f7752935\",\"8cfe54e24192df53\",\"4a6cc4a70ec8b894\",\"269f267b17835f9e\",\"3e8a6ff53d4425a8\",\"2d224de037c2e0fb\",\"4d70d9cf0b54bc16\",\"631bf9eac4809e41\",\"0f8f82c086edc370\",\"d8532d882bb3b7e8\",\"c0b45b47b2055647\"],\"x\":14,\"y\":19,\"w\":1372,\"h\":342},{\"id\":\"5b9a844b4fed15dc\",\"type\":\"server-state-changed\",\"z\":\"c46ec6da75a29ac3\",\"g\":\"537c7adde52f50c8\",\"name\":\"Light Changed - Bathroom\",\"server\":\"f43d015e.4b29\",\"version\":4,\"exposeToHomeAssistant\":false,\"haConfig\":[{\"property\":\"name\",\"value\":\"\"},{\"property\":\"icon\",\"value\":\"\"}],\"entityidfilter\":\"light.all_bathroom_lights\",\"entityidfiltertype\":\"exact\",\"outputinitially\":true,\"state_type\":\"str\",\"haltifstate\":\"\",\"halt_if_type\":\"str\",\"halt_if_compare\":\"is\",\"outputs\":1,\"output_only_on_state_change\":false,\"for\":\"0\",\"forType\":\"num\",\"forUnits\":\"minutes\",\"ignorePrevStateNull\":false,\"ignorePrevStateUnknown\":false,\"ignorePrevStateUnavailable\":false,\"ignoreCurrentStateUnknown\":false,\"ignoreCurrentStateUnavailable\":false,\"outputProperties\":[{\"property\":\"payload\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"entityState\"},{\"property\":\"data\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"eventData\"},{\"property\":\"topic\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"triggerId\"}],\"x\":150,\"y\":120,\"wires\":[[\"fcbdc357f6fb230f\"]]},{\"id\":\"4c25f2418350340f\",\"type\":\"server-state-changed\",\"z\":\"c46ec6da75a29ac3\",\"g\":\"537c7adde52f50c8\",\"name\":\"Presence - Bathroom\",\"server\":\"f43d015e.4b29\",\"version\":4,\"exposeToHomeAssistant\":false,\"haConfig\":[{\"property\":\"name\",\"value\":\"\"},{\"property\":\"icon\",\"value\":\"\"}],\"entityidfilter\":\"binary_sensor.bathroom_motion\",\"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,\"outputProperties\":[{\"property\":\"payload\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"entityState\"},{\"property\":\"data\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"eventData\"},{\"property\":\"topic\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"triggerId\"}],\"x\":160,\"y\":200,\"wires\":[[\"fcbdc357f6fb230f\"],[]]},{\"id\":\"fcbdc357f6fb230f\",\"type\":\"time-range-switch\",\"z\":\"c46ec6da75a29ac3\",\"g\":\"537c7adde52f50c8\",\"name\":\"Day?\",\"lat\":\"\",\"lon\":\"\",\"startTime\":\"10:30\",\"endTime\":\"00:00\",\"startOffset\":0,\"endOffset\":0,\"x\":350,\"y\":160,\"wires\":[[\"269f267b17835f9e\"],[\"3e8a6ff53d4425a8\"]]},{\"id\":\"83e9fe224cf56eaf\",\"type\":\"api-call-service\",\"z\":\"c46ec6da75a29ac3\",\"g\":\"537c7adde52f50c8\",\"name\":\"Day Scene ON\",\"server\":\"f43d015e.4b29\",\"version\":5,\"debugenabled\":false,\"domain\":\"automation\",\"service\":\"trigger\",\"areaId\":[],\"deviceId\":[],\"entityId\":[\"automation.lighting_bathroom_normal\"],\"data\":\"\",\"dataType\":\"jsonata\",\"mergeContext\":\"\",\"mustacheAltTags\":false,\"outputProperties\":[],\"queue\":\"none\",\"x\":1240,\"y\":60,\"wires\":[[]]},{\"id\":\"8ccff7d2f7752935\",\"type\":\"api-call-service\",\"z\":\"c46ec6da75a29ac3\",\"g\":\"537c7adde52f50c8\",\"name\":\"Night Scene ON\",\"server\":\"f43d015e.4b29\",\"version\":5,\"debugenabled\":false,\"domain\":\"automation\",\"service\":\"trigger\",\"areaId\":[],\"deviceId\":[],\"entityId\":[\"automation.lighting_bathroom_morning\"],\"data\":\"\",\"dataType\":\"jsonata\",\"mergeContext\":\"\",\"mustacheAltTags\":false,\"outputProperties\":[],\"queue\":\"none\",\"x\":1240,\"y\":220,\"wires\":[[]]},{\"id\":\"8cfe54e24192df53\",\"type\":\"api-call-service\",\"z\":\"c46ec6da75a29ac3\",\"g\":\"537c7adde52f50c8\",\"name\":\"Bathroom Lights OFF\",\"server\":\"f43d015e.4b29\",\"version\":5,\"debugenabled\":false,\"domain\":\"automation\",\"service\":\"trigger\",\"areaId\":[],\"deviceId\":[],\"entityId\":[\"automation.lighting_bathroom_off\"],\"data\":\"\",\"dataType\":\"jsonata\",\"mergeContext\":\"\",\"mustacheAltTags\":false,\"outputProperties\":[],\"queue\":\"none\",\"x\":1260,\"y\":120,\"wires\":[[]]},{\"id\":\"4a6cc4a70ec8b894\",\"type\":\"api-call-service\",\"z\":\"c46ec6da75a29ac3\",\"g\":\"537c7adde52f50c8\",\"name\":\"Bathroom Lights OFF\",\"server\":\"f43d015e.4b29\",\"version\":5,\"debugenabled\":false,\"domain\":\"automation\",\"service\":\"trigger\",\"areaId\":[],\"deviceId\":[],\"entityId\":[\"automation.lighting_bathroom_off\"],\"data\":\"\",\"dataType\":\"jsonata\",\"mergeContext\":\"\",\"mustacheAltTags\":false,\"outputProperties\":[],\"queue\":\"none\",\"x\":1260,\"y\":280,\"wires\":[[]]},{\"id\":\"269f267b17835f9e\",\"type\":\"subflow:3fe087dd9290cd30\",\"z\":\"c46ec6da75a29ac3\",\"g\":\"537c7adde52f50c8\",\"name\":\"\",\"env\":[{\"name\":\"timeOffAfter\",\"value\":\"500\",\"type\":\"num\"},{\"name\":\"brightness\",\"value\":\"\",\"type\":\"num\"},{\"name\":\"manualLight\",\"value\":\"true\",\"type\":\"bool\"}],\"x\":540,\"y\":80,\"wires\":[[\"83e9fe224cf56eaf\"],[\"0f8f82c086edc370\"],[],[]]},{\"id\":\"3e8a6ff53d4425a8\",\"type\":\"subflow:3fe087dd9290cd30\",\"z\":\"c46ec6da75a29ac3\",\"g\":\"537c7adde52f50c8\",\"name\":\"\",\"env\":[{\"name\":\"timeOffAfter\",\"value\":\"500\",\"type\":\"num\"},{\"name\":\"brightness\",\"value\":\"\",\"type\":\"num\"},{\"name\":\"manualLight\",\"value\":\"true\",\"type\":\"bool\"}],\"x\":540,\"y\":240,\"wires\":[[\"8ccff7d2f7752935\"],[\"2d224de037c2e0fb\"],[],[]]},{\"id\":\"2d224de037c2e0fb\",\"type\":\"api-current-state\",\"z\":\"c46ec6da75a29ac3\",\"g\":\"537c7adde52f50c8\",\"name\":\"Presense - Sam\",\"server\":\"f43d015e.4b29\",\"version\":3,\"outputs\":2,\"halt_if\":\"bathroom\",\"halt_if_type\":\"str\",\"halt_if_compare\":\"is\",\"entity_id\":\"sensor.sam_phone_ble\",\"state_type\":\"str\",\"blockInputOverrides\":false,\"outputProperties\":[{\"property\":\"payload\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"entityState\"},{\"property\":\"data\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"entity\"}],\"for\":\"0\",\"forType\":\"num\",\"forUnits\":\"minutes\",\"override_topic\":false,\"state_location\":\"payload\",\"override_payload\":\"msg\",\"entity_location\":\"data\",\"override_data\":\"msg\",\"x\":780,\"y\":240,\"wires\":[[\"631bf9eac4809e41\"],[\"4d70d9cf0b54bc16\"]]},{\"id\":\"4d70d9cf0b54bc16\",\"type\":\"api-current-state\",\"z\":\"c46ec6da75a29ac3\",\"g\":\"537c7adde52f50c8\",\"name\":\"Presense - Leah\",\"server\":\"f43d015e.4b29\",\"version\":3,\"outputs\":2,\"halt_if\":\"bathroom\",\"halt_if_type\":\"str\",\"halt_if_compare\":\"is\",\"entity_id\":\"sensor.leah_phone_ble\",\"state_type\":\"str\",\"blockInputOverrides\":false,\"outputProperties\":[{\"property\":\"payload\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"entityState\"},{\"property\":\"data\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"entity\"}],\"for\":\"0\",\"forType\":\"num\",\"forUnits\":\"minutes\",\"override_topic\":false,\"state_location\":\"payload\",\"override_payload\":\"msg\",\"entity_location\":\"data\",\"override_data\":\"msg\",\"x\":980,\"y\":240,\"wires\":[[\"631bf9eac4809e41\"],[\"4a6cc4a70ec8b894\"]]},{\"id\":\"631bf9eac4809e41\",\"type\":\"delay\",\"z\":\"c46ec6da75a29ac3\",\"g\":\"537c7adde52f50c8\",\"name\":\"\",\"pauseType\":\"delay\",\"timeout\":\"5\",\"timeoutUnits\":\"minutes\",\"rate\":\"1\",\"nbRateUnits\":\"1\",\"rateUnits\":\"second\",\"randomFirst\":\"1\",\"randomLast\":\"5\",\"randomUnits\":\"seconds\",\"drop\":false,\"allowrate\":false,\"outputs\":1,\"x\":880,\"y\":320,\"wires\":[[\"2d224de037c2e0fb\"]]},{\"id\":\"c0b45b47b2055647\",\"type\":\"api-current-state\",\"z\":\"c46ec6da75a29ac3\",\"g\":\"537c7adde52f50c8\",\"name\":\"Presense - Leah\",\"server\":\"f43d015e.4b29\",\"version\":3,\"outputs\":2,\"halt_if\":\"bathroom\",\"halt_if_type\":\"str\",\"halt_if_compare\":\"is\",\"entity_id\":\"sensor.leah_phone_ble\",\"state_type\":\"str\",\"blockInputOverrides\":false,\"outputProperties\":[{\"property\":\"payload\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"entityState\"},{\"property\":\"data\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"entity\"}],\"for\":\"0\",\"forType\":\"num\",\"forUnits\":\"minutes\",\"override_topic\":false,\"state_location\":\"payload\",\"override_payload\":\"msg\",\"entity_location\":\"data\",\"override_data\":\"msg\",\"x\":980,\"y\":80,\"wires\":[[\"d8532d882bb3b7e8\"],[\"8cfe54e24192df53\"]]},{\"id\":\"d8532d882bb3b7e8\",\"type\":\"delay\",\"z\":\"c46ec6da75a29ac3\",\"g\":\"537c7adde52f50c8\",\"name\":\"\",\"pauseType\":\"delay\",\"timeout\":\"5\",\"timeoutUnits\":\"minutes\",\"rate\":\"1\",\"nbRateUnits\":\"1\",\"rateUnits\":\"second\",\"randomFirst\":\"1\",\"randomLast\":\"5\",\"randomUnits\":\"seconds\",\"drop\":false,\"allowrate\":false,\"outputs\":1,\"x\":880,\"y\":160,\"wires\":[[\"0f8f82c086edc370\"]]},{\"id\":\"0f8f82c086edc370\",\"type\":\"api-current-state\",\"z\":\"c46ec6da75a29ac3\",\"g\":\"537c7adde52f50c8\",\"name\":\"Presense - Sam\",\"server\":\"f43d015e.4b29\",\"version\":3,\"outputs\":2,\"halt_if\":\"bathroom\",\"halt_if_type\":\"str\",\"halt_if_compare\":\"is\",\"entity_id\":\"sensor.sam_phone_ble\",\"state_type\":\"str\",\"blockInputOverrides\":false,\"outputProperties\":[{\"property\":\"payload\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"entityState\"},{\"property\":\"data\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"entity\"}],\"for\":\"0\",\"forType\":\"num\",\"forUnits\":\"minutes\",\"override_topic\":false,\"state_location\":\"payload\",\"override_payload\":\"msg\",\"entity_location\":\"data\",\"override_data\":\"msg\",\"x\":780,\"y\":80,\"wires\":[[\"d8532d882bb3b7e8\"],[\"c0b45b47b2055647\"]]},{\"id\":\"f43d015e.4b29\",\"type\":\"server\",\"name\":\"Home Assistant\",\"version\":4,\"rejectUnauthorizedCerts\":true,\"ha_boolean\":\"y|yes|true|on|home|open\",\"connectionDelay\":true,\"cacheJson\":true,\"heartbeat\":false,\"heartbeatInterval\":30,\"areaSelector\":\"friendlyName\",\"deviceSelector\":\"friendlyName\",\"entitySelector\":\"friendlyName\",\"statusSeparator\":\"at: \",\"statusYear\":\"hidden\",\"statusMonth\":\"short\",\"statusDay\":\"numeric\",\"statusHourCycle\":\"h23\",\"statusTimeFormat\":\"h:m\"}]\n\u003c/details\u003e\n\n\u0026nbsp;\u0026nbsp;_which uses:_\n\n- [Node-RED Add-On](https://github.com/hassio-addons/addon-node-red)\n- [@dortamur's Node-Red Motion Lighting Flow Template](https://github.com/dortamur/ha-node-red-flows)\n- [ESPresense Integration](https://espresense.com/)\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003e\u003ca name=\"https://github.com/smcnab1/home-assistant-config/blob/master/automations/lighting/bathroom/bath.yaml\"\u003eBath Time\u003c/a\u003e\u003c/b\u003e\u003c/summary\u003e\u003cblockquote\u003e\n\u003cb\u003e\u003ci\u003eAutomation to activate bath time scene.\u003c/b\u003e\u003c/i\u003e\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003e\u003ca name=\"https://github.com/smcnab1/home-assistant-config/blob/master/automations/lighting/bathroom/morning.yaml\"\u003eMorning\u003c/a\u003e\u003c/b\u003e\u003c/summary\u003e\u003cblockquote\u003e\n\u003cb\u003e\u003ci\u003eAutomation to activate morning bathroom scene.\u003c/b\u003e\u003c/i\u003e\n\n\u0026nbsp;\u0026nbsp;_which uses:_\n\n- [scene.bathroom_morning](https://github.com/smcnab1/home-assistant-config/blob/master/entities/scenes/bathroom/morning.yaml) \u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003e\u003ca name=\"https://github.com/smcnab1/home-assistant-config/blob/master/automations/lighting/bathroom/normal.yaml\"\u003eNormal\u003c/a\u003e\u003c/b\u003e\u003c/summary\u003e\u003cblockquote\u003e\n\u003cb\u003e\u003ci\u003eAutomation to activate normal bathroom scene.\u003c/b\u003e\u003c/i\u003e\n\n\u0026nbsp;\u0026nbsp;_which uses:_\n\n- [scene.bathroom_day](https://github.com/smcnab1/home-assistant-config/blob/master/entities/scenes/bathroom/day.yaml) \u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003e\u003ca name=\"https://github.com/smcnab1/home-assistant-config/blob/Master/automations/lighting/bathroom/switch.yaml\"\u003eSwitch Control\u003c/a\u003e\u003c/b\u003e\u003c/summary\u003e\u003cblockquote\u003e\n\u003cb\u003e\u003ci\u003eUsing Aqara Switch to toggle lighting, overrides motion triggers\u003c/b\u003e\u003c/i\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003e\u003ca name=\"https://github.com/smcnab1/home-assistant-config/blob/master/automations/lighting/bathroom/off.yaml\"\u003eOff\u003c/a\u003e\u003c/b\u003e\u003c/summary\u003e\u003cblockquote\u003e\n\u003cb\u003e\u003ci\u003eAutomation to turn off all bathroom lights.\u003c/b\u003e\u003c/i\u003e\n\u003c/details\u003e\n\n\u003c/blockquote\u003e\u003c/details\u003e\n\n\u003c!-- BEDROOM LIGHTING AUTOMATIONS --\u003e\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003e\u003ca name=\"https://github.com/smcnab1/home-assistant-config/tree/master/automations/lighting/bedroom\"\u003eBedroom 🛏️ Lighting\u003c/a\u003e\u003c/b\u003e\u003c/summary\u003e\u003cblockquote\u003e\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eBedroom Motion Automation\u003c/b\u003e\u003c/summary\u003e\u003cblockquote\u003e\n\u003cb\u003e\u003ci\u003eAutomation which works with motion sensors to activate and de-activate lighting. Also depends on current sleeping status through Bed Sensors.\u003c/b\u003e\u003c/i\u003e\n\n![Node-Red Flow](https://i.imgur.com/rRnmC3Y.png)\n\n\u003cdetails\u003e\u003csummary\u003eNode-Red Code\u003c/summary\u003e\u003cblockquote\u003e\n[{\"id\":\"3fe087dd9290cd30\",\"type\":\"subflow\",\"name\":\"Lights Motion Control\",\"info\":\"\",\"category\":\"home_assistant\",\"in\":[{\"x\":57,\"y\":162,\"wires\":[{\"id\":\"ef28eae7ed719fef\"}]}],\"out\":[{\"x\":470,\"y\":375,\"wires\":[{\"id\":\"7979d0139dcbb40b\",\"port\":0}]},{\"x\":560,\"y\":390,\"wires\":[{\"id\":\"7979d0139dcbb40b\",\"port\":1}]},{\"x\":650,\"y\":75,\"wires\":[{\"id\":\"41569ba311d53f87\",\"port\":0}]},{\"x\":890,\"y\":105,\"wires\":[{\"id\":\"dc014e6fd4f7b01b\",\"port\":0}]}],\"env\":[{\"name\":\"timeOffAfter\",\"type\":\"num\",\"value\":\"120\"},{\"name\":\"manualCooldown\",\"type\":\"num\",\"value\":\"30\"},{\"name\":\"brightness\",\"type\":\"num\",\"value\":\"100\",\"ui\":{\"type\":\"input\",\"opts\":{\"types\":[\"num\",\"bool\",\"json\",\"bin\"]}}},{\"name\":\"transitionOn\",\"type\":\"num\",\"value\":\"2\"},{\"name\":\"transitionOff\",\"type\":\"num\",\"value\":\"2\"},{\"name\":\"pause\",\"type\":\"str\",\"value\":\"5\"},{\"name\":\"controlLights\",\"type\":\"str\",\"value\":\"\"},{\"name\":\"manualLight\",\"type\":\"bool\",\"value\":\"false\"}],\"meta\":{},\"color\":\"#52C0F2\",\"icon\":\"font-awesome/fa-lightbulb-o\",\"status\":{\"x\":1027,\"y\":157,\"wires\":[{\"id\":\"67740cc1abae3f4d\",\"port\":0}]}},{\"id\":\"69b69fb47d2e171c\",\"type\":\"change\",\"z\":\"3fe087dd9290cd30\",\"name\":\"motion\",\"rules\":[{\"t\":\"set\",\"p\":\"payload\",\"pt\":\"msg\",\"to\":\"motion\",\"tot\":\"str\"}],\"action\":\"\",\"property\":\"\",\"from\":\"\",\"to\":\"\",\"reg\":false,\"x\":544,\"y\":178,\"wires\":[[\"dc014e6fd4f7b01b\"]]},{\"id\":\"dc014e6fd4f7b01b\",\"type\":\"state-machine\",\"z\":\"3fe087dd9290cd30\",\"name\":\"\",\"triggerProperty\":\"payload\",\"triggerPropertyType\":\"msg\",\"stateProperty\":\"payload\",\"statePropertyType\":\"msg\",\"initialDelay\":\"\",\"persistOnReload\":true,\"outputStateChangeOnly\":true,\"throwException\":false,\"states\":[\"switch\",\"motion-detected\",\"motion-on\",\"motion-off\",\"off\",\"on\"],\"transitions\":[{\"name\":\"motion\",\"from\":\"off\",\"to\":\"motion-detected\"},{\"name\":\"motion\",\"from\":\"motion-off\",\"to\":\"motion-detected\"},{\"name\":\"motion\",\"from\":\"motion-on\",\"to\":\"motion-on\"},{\"name\":\"off\",\"from\":\"*\",\"to\":\"off\"},{\"name\":\"on\",\"from\":\"*\",\"to\":\"on\"},{\"name\":\"switch\",\"from\":\"off\",\"to\":\"switch\"},{\"name\":\"switch\",\"from\":\"on\",\"to\":\"switch\"},{\"name\":\"switch\",\"from\":\"switch\",\"to\":\"switch\"},{\"name\":\"switch\",\"from\":\"motion-on\",\"to\":\"switch\"},{\"name\":\"motion-on\",\"from\":\"motion-detected\",\"to\":\"motion-on\"},{\"name\":\"motion-off\",\"from\":\"motion-on\",\"to\":\"motion-off\"}],\"x\":741,\"y\":157,\"wires\":[[\"7979d0139dcbb40b\",\"67740cc1abae3f4d\"]]},{\"id\":\"c0ac9957e8074a3a\",\"type\":\"change\",\"z\":\"3fe087dd9290cd30\",\"name\":\"switch\",\"rules\":[{\"t\":\"set\",\"p\":\"payload\",\"pt\":\"msg\",\"to\":\"switch\",\"tot\":\"str\"}],\"action\":\"\",\"property\":\"\",\"from\":\"\",\"to\":\"\",\"reg\":false,\"x\":541,\"y\":223,\"wires\":[[\"dc014e6fd4f7b01b\"]]},{\"id\":\"b808c7939e262898\",\"type\":\"change\",\"z\":\"3fe087dd9290cd30\",\"name\":\"stop\",\"rules\":[{\"t\":\"set\",\"p\":\"reset\",\"pt\":\"msg\",\"to\":\"true\",\"tot\":\"bool\"}],\"action\":\"\",\"property\":\"\",\"from\":\"\",\"to\":\"\",\"reg\":false,\"x\":440,\"y\":630,\"wires\":[[\"5436a3c1b895bd12\"]]},{\"id\":\"529401309069e7e5\",\"type\":\"inject\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Initial State\",\"props\":[{\"p\":\"reset\",\"v\":\"true\",\"vt\":\"bool\"},{\"p\":\"topic\",\"vt\":\"str\"}],\"repeat\":\"\",\"crontab\":\"\",\"once\":true,\"onceDelay\":\"10\",\"topic\":\"\",\"x\":665,\"y\":570,\"wires\":[[\"4060d565fc3941d1\",\"f4e6ddd8960529f3\"]]},{\"id\":\"18d112236dd3f2c6\",\"type\":\"link in\",\"z\":\"3fe087dd9290cd30\",\"name\":\"\",\"links\":[\"774c661db65310b7\",\"f95e514e2b0be219\"],\"x\":592,\"y\":120,\"wires\":[[\"dc014e6fd4f7b01b\"]]},{\"id\":\"774c661db65310b7\",\"type\":\"link out\",\"z\":\"3fe087dd9290cd30\",\"name\":\"living room state\",\"links\":[\"18d112236dd3f2c6\"],\"x\":1020,\"y\":570,\"wires\":[]},{\"id\":\"7979d0139dcbb40b\",\"type\":\"switch\",\"z\":\"3fe087dd9290cd30\",\"name\":\"State Action\",\"property\":\"payload\",\"propertyType\":\"msg\",\"rules\":[{\"t\":\"eq\",\"v\":\"motion-detected\",\"vt\":\"str\"},{\"t\":\"eq\",\"v\":\"motion-off\",\"vt\":\"str\"},{\"t\":\"eq\",\"v\":\"motion-on\",\"vt\":\"str\"},{\"t\":\"eq\",\"v\":\"switch\",\"vt\":\"str\"}],\"checkall\":\"true\",\"repair\":false,\"outputs\":4,\"x\":230,\"y\":465,\"wires\":[[\"83884d0cb7a1e2a8\",\"f9350e6c9e6be889\"],[\"ab49cdb37a246459\"],[\"d826541759debe8b\"],[\"b808c7939e262898\",\"ae931f01824e1cbc\"]]},{\"id\":\"ece9daf5e1c3fe6c\",\"type\":\"rbe\",\"z\":\"3fe087dd9290cd30\",\"name\":\"\",\"func\":\"rbe\",\"gap\":\"\",\"start\":\"\",\"inout\":\"out\",\"property\":\"payload\",\"x\":369,\"y\":223,\"wires\":[[\"c0ac9957e8074a3a\"]]},{\"id\":\"ef28eae7ed719fef\",\"type\":\"switch\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Topic Route\",\"property\":\"topic\",\"propertyType\":\"msg\",\"rules\":[{\"t\":\"regex\",\"v\":\"^config\\\\b\",\"vt\":\"str\",\"case\":false},{\"t\":\"regex\",\"v\":\"^reset\\\\b\",\"vt\":\"str\",\"case\":false},{\"t\":\"eq\",\"v\":\"light_state\",\"vt\":\"str\"},{\"t\":\"cont\",\"v\":\"sensor.\",\"vt\":\"str\"},{\"t\":\"regex\",\"v\":\"^(light|switch)\\\\.\",\"vt\":\"str\",\"case\":false}],\"checkall\":\"true\",\"repair\":false,\"outputs\":5,\"x\":175,\"y\":162,\"wires\":[[\"41569ba311d53f87\"],[\"6b80334d2b0bd4ab\"],[\"dc014e6fd4f7b01b\"],[\"5855ad1b303c6bc1\"],[\"ece9daf5e1c3fe6c\",\"8ffe714a5901d07d\"]]},{\"id\":\"41569ba311d53f87\",\"type\":\"function\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Update Configuration\",\"func\":\"// Init our Lights state while we're here\\nlet lights = flow.get('lights')\\n// Is this our start-up initialisation? (If so, reset config!)\\nlet init = msg.init || false\\nif (!lights)\\n  flow.set('lights', { state: { }, ids: [], ids_csv: '' })\\n\\n// Merge new Payload with existing config and defaults\\nlet cfg = Object.assign(\\n  // Existing Config\\n  init?flow.get('cfg')||{}:{},  // 'cfg.'+id\\n  // Updated Config\\n  msg.payload)\\n\\n// Make sure Light IDs are initted.\\n// if (!cfg.lights) cfg.lights = []\\nif (!cfg.brightness)\\n  cfg.brightness = env.get('brightness') || 100\\n\\nif (!cfg.transitionOn \u0026\u0026 cfg.transitionOn !== 0)\\n  cfg.transitionOn = env.get('transitionOn') || 2\\n  \\nif (!cfg.transitionOff \u0026\u0026 cfg.transitionOff !== 0)\\n  cfg.transitionOff = env.get('transitionOff') || 2\\n\\nif (!cfg.lights \u0026\u0026 env.get('controlLights') \u0026\u0026 env.get('controlLights').length\u003e0)\\n    cfg.lights = env.get('controlLights').split(/\\\\s*,\\\\s*/)\\n\\nflow.set('cfg', cfg)\\n\\nreturn { topic: 'config', payload: cfg, lights }\",\"outputs\":1,\"noerr\":0,\"initialize\":\"\",\"finalize\":\"\",\"libs\":[],\"x\":505,\"y\":75,\"wires\":[[]]},{\"id\":\"5855ad1b303c6bc1\",\"type\":\"switch\",\"z\":\"3fe087dd9290cd30\",\"name\":\"motion on\",\"property\":\"payload\",\"propertyType\":\"msg\",\"rules\":[{\"t\":\"eq\",\"v\":\"on\",\"vt\":\"str\"}],\"checkall\":\"true\",\"repair\":false,\"outputs\":1,\"x\":375,\"y\":178,\"wires\":[[\"69b69fb47d2e171c\"]]},{\"id\":\"8ffe714a5901d07d\",\"type\":\"function\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Track Lights\",\"func\":\"// Keep a record of all the light entity_ids coming in, for later switching\\n\\nlet lights = flow.get('lights') || { state: { }, ids: [], ids_csv: '' }\\n\\nlet [all, id] = msg.topic.match(/^light\\\\.(.*)/)\\nlet update = false\\n\\nif (id) {\\n  lights.state[id] = msg.data.new_state\\n  if (!lights.ids.includes(id)) {\\n    lights.ids.push(id)\\n    update = true\\n  }\\n  lights.ids_csv = lights.ids.join(',')\\n}\\n\\nflow.set('lights', lights)\\n\\nreturn {update}\",\"outputs\":1,\"noerr\":0,\"initialize\":\"\",\"finalize\":\"\",\"libs\":[],\"x\":389,\"y\":268,\"wires\":[[\"31b931f6b9df7e2e\"]]},{\"id\":\"83884d0cb7a1e2a8\",\"type\":\"function\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Light Cfg\",\"func\":\"let cfg = flow.get('cfg')|| {}\\nlet lights = flow.get('lights') || {}\\n// Use Light IDs from Config if defined - otherwise use detected\\nlet light_ids = cfg.lights || lights.ids\\nlet delay = env.get('pause')*1000\\n\\n// Prepare config paramters for Light On. This is\\n// an Array of Payload Data, one for each light\\nlet payload = light_ids.map(id =\u003e { return {\\n  data: {\\n    brightness: Math.floor(cfg.brightness/100*255),\\n    transition: cfg.transitionOn,\\n    entity_id: 'light.'+id\\n  }\\n}})\\n\\nreturn {\\n    topic: 'light.'+light_ids.join(','),\\n    payload,\\n    delay\\n}\",\"outputs\":1,\"noerr\":0,\"initialize\":\"\",\"finalize\":\"\",\"libs\":[],\"x\":525,\"y\":330,\"wires\":[[\"412fe93b1c4add94\",\"3803e8ecf7384d2b\"]]},{\"id\":\"ab49cdb37a246459\",\"type\":\"function\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Light Cfg\",\"func\":\"let cfg = flow.get('cfg')|| {}\\nlet lights = flow.get('lights') || {}\\n// Use Light IDs from Config if defined - otherwise use detected\\nlet light_ids = cfg.lights || lights.ids\\nlet delay = env.get('pause')*1000\\n\\n// Prepare config paramters for Light Off. This is\\n// an Array of Payload Data, one for each light\\nlet payload = light_ids.map(id =\u003e { return {\\n  data: {\\n    transition: cfg.transitionOff,\\n    entity_id: 'light.'+id\\n  }\\n}})\\n\\nreturn {\\n    topic: 'light.'+light_ids.join(','),\\n    payload,\\n    delay\\n}\",\"outputs\":1,\"noerr\":0,\"initialize\":\"\",\"finalize\":\"\",\"libs\":[],\"x\":525,\"y\":435,\"wires\":[[\"ed01207d5f3679e4\",\"63c85b090efb1c5c\"]]},{\"id\":\"1ec81804eca7f722\",\"type\":\"inject\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Default Configuration\",\"props\":[{\"p\":\"payload\"},{\"p\":\"topic\",\"vt\":\"str\"},{\"p\":\"init\",\"v\":\"true\",\"vt\":\"str\"}],\"repeat\":\"\",\"crontab\":\"\",\"once\":true,\"onceDelay\":0.1,\"topic\":\"config\",\"payload\":\"{}\",\"payloadType\":\"json\",\"x\":235,\"y\":75,\"wires\":[[\"41569ba311d53f87\"]]},{\"id\":\"2dfcf7ed6c713ca9\",\"type\":\"api-call-service\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Turn on light\",\"server\":\"f43d015e.4b29\",\"version\":5,\"debugenabled\":false,\"domain\":\"light\",\"service\":\"turn_on\",\"areaId\":[],\"deviceId\":[],\"entityId\":[],\"data\":\"\",\"dataType\":\"json\",\"mergeContext\":\"\",\"mustacheAltTags\":false,\"outputProperties\":[{\"property\":\"payload\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"data\"}],\"queue\":\"none\",\"x\":1045,\"y\":285,\"wires\":[[]]},{\"id\":\"015672de6c534fb2\",\"type\":\"api-call-service\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Turn off light\",\"server\":\"f43d015e.4b29\",\"version\":5,\"domain\":\"light\",\"service\":\"turn_off\",\"areaId\":[],\"deviceId\":[],\"entityId\":[],\"data\":\"\",\"mergeContext\":\"\",\"outputProperties\":[{\"property\":\"payload\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"data\"}],\"queue\":\"none\",\"x\":1045,\"y\":435,\"wires\":[[]]},{\"id\":\"4060d565fc3941d1\",\"type\":\"function\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Check State\",\"func\":\"// Fetch light state from our \\\"Track Lights\\\" data\\n// - no need for a HA State node\\n\\nlet lights = flow.get('lights') || { state: { }, ids: [], ids_csv: '' }\\nlet cfg = flow.get('cfg')|| {}\\n\\n// Return \\\"on\\\" if any one light is \\\"on\\\"\\nreturn {\\n    topic: 'light.'+lights.ids_csv,\\n    payload: lights.ids.map(id =\u003e lights.state[id].state).includes('on') ? 'on' : 'off'\\n}\",\"outputs\":1,\"noerr\":0,\"initialize\":\"\",\"finalize\":\"\",\"libs\":[],\"x\":910,\"y\":525,\"wires\":[[\"774c661db65310b7\"]]},{\"id\":\"4b0205094e835fcc\",\"type\":\"split\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Each Light\",\"splt\":\"\\\\n\",\"spltType\":\"str\",\"arraySplt\":1,\"arraySpltType\":\"len\",\"stream\":false,\"addname\":\"\",\"x\":880,\"y\":285,\"wires\":[[\"2dfcf7ed6c713ca9\"]]},{\"id\":\"88c1ddf9130a3f60\",\"type\":\"split\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Each Light\",\"splt\":\"\\\\n\",\"spltType\":\"str\",\"arraySplt\":1,\"arraySpltType\":\"len\",\"stream\":false,\"addname\":\"\",\"x\":875,\"y\":435,\"wires\":[[\"015672de6c534fb2\"]]},{\"id\":\"01dd313513cd6bbc\",\"type\":\"function\",\"z\":\"3fe087dd9290cd30\",\"name\":\"motion-on\",\"func\":\"// We use a function here to generate a new clean message\\n\\nreturn {\\n    topic: 'state',\\n    payload: 'motion-on'\\n}\",\"outputs\":1,\"noerr\":0,\"initialize\":\"\",\"finalize\":\"\",\"libs\":[],\"x\":885,\"y\":330,\"wires\":[[\"f95e514e2b0be219\"]]},{\"id\":\"e13e288088919cdf\",\"type\":\"function\",\"z\":\"3fe087dd9290cd30\",\"name\":\"motion-off\",\"func\":\"// We use a function here to generate a new clean message\\n\\nreturn {\\n    topic: 'state',\\n    payload: 'motion-off'\\n}\",\"outputs\":1,\"noerr\":0,\"initialize\":\"\",\"finalize\":\"\",\"libs\":[],\"x\":900,\"y\":615,\"wires\":[[\"774c661db65310b7\"]]},{\"id\":\"f9350e6c9e6be889\",\"type\":\"change\",\"z\":\"3fe087dd9290cd30\",\"name\":\"stop\",\"rules\":[{\"t\":\"set\",\"p\":\"reset\",\"pt\":\"msg\",\"to\":\"true\",\"tot\":\"bool\"}],\"action\":\"\",\"property\":\"\",\"from\":\"\",\"to\":\"\",\"reg\":false,\"x\":530,\"y\":480,\"wires\":[[\"63c85b090efb1c5c\"]]},{\"id\":\"67740cc1abae3f4d\",\"type\":\"function\",\"z\":\"3fe087dd9290cd30\",\"name\":\"status\",\"func\":\"\\nmsg.payload = {\\n    text: msg.payload, \\n    shape: msg.payload.match(/on/) ? 'ring' : 'dot',\\n    fill: msg.payload == 'switch' ? 'red' : 'green'\\n}\\nreturn msg;\",\"outputs\":1,\"noerr\":0,\"x\":928,\"y\":157,\"wires\":[[]]},{\"id\":\"412fe93b1c4add94\",\"type\":\"switch\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Manual?\",\"property\":\"manualLight\",\"propertyType\":\"env\",\"rules\":[{\"t\":\"true\"},{\"t\":\"else\"}],\"checkall\":\"true\",\"repair\":false,\"outputs\":2,\"x\":705,\"y\":285,\"wires\":[[],[\"4b0205094e835fcc\"]]},{\"id\":\"ed01207d5f3679e4\",\"type\":\"switch\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Manual?\",\"property\":\"manualLight\",\"propertyType\":\"env\",\"rules\":[{\"t\":\"true\"},{\"t\":\"else\"}],\"checkall\":\"true\",\"repair\":false,\"outputs\":2,\"x\":705,\"y\":435,\"wires\":[[],[\"88c1ddf9130a3f60\"]]},{\"id\":\"f95e514e2b0be219\",\"type\":\"link out\",\"z\":\"3fe087dd9290cd30\",\"name\":\"living room state\",\"links\":[\"18d112236dd3f2c6\"],\"x\":990,\"y\":330,\"wires\":[]},{\"id\":\"6b80334d2b0bd4ab\",\"type\":\"function\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Reset\",\"func\":\"flow.set('lights', null)\\nflow.set('cfg', null)\\n\\nreturn msg\",\"outputs\":1,\"noerr\":0,\"initialize\":\"\",\"finalize\":\"\",\"libs\":[],\"x\":365,\"y\":135,\"wires\":[[\"41569ba311d53f87\"]]},{\"id\":\"31b931f6b9df7e2e\",\"type\":\"switch\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Updated?\",\"property\":\"update\",\"propertyType\":\"msg\",\"rules\":[{\"t\":\"true\"}],\"checkall\":\"true\",\"repair\":false,\"outputs\":1,\"x\":540,\"y\":270,\"wires\":[[\"41569ba311d53f87\"]]},{\"id\":\"3803e8ecf7384d2b\",\"type\":\"trigger\",\"z\":\"3fe087dd9290cd30\",\"name\":\"pause\",\"op1\":\"\",\"op2\":\"\",\"op1type\":\"nul\",\"op2type\":\"payl\",\"duration\":\"5\",\"extend\":true,\"overrideDelay\":true,\"units\":\"s\",\"reset\":\"stop\",\"bytopic\":\"all\",\"topic\":\"topic\",\"outputs\":1,\"x\":695,\"y\":330,\"wires\":[[\"01dd313513cd6bbc\"]]},{\"id\":\"63c85b090efb1c5c\",\"type\":\"trigger\",\"z\":\"3fe087dd9290cd30\",\"name\":\"pause\",\"op1\":\"\",\"op2\":\"\",\"op1type\":\"nul\",\"op2type\":\"payl\",\"duration\":\"5\",\"extend\":true,\"overrideDelay\":true,\"units\":\"s\",\"reset\":\"stop\",\"bytopic\":\"all\",\"topic\":\"topic\",\"outputs\":1,\"x\":695,\"y\":480,\"wires\":[[\"4060d565fc3941d1\"]]},{\"id\":\"f4e6ddd8960529f3\",\"type\":\"trigger\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Back to Auto\",\"op1\":\"\",\"op2\":\"\",\"op1type\":\"nul\",\"op2type\":\"payl\",\"duration\":\"5\",\"extend\":true,\"overrideDelay\":true,\"units\":\"s\",\"reset\":\"stop\",\"bytopic\":\"all\",\"topic\":\"topic\",\"outputs\":1,\"x\":715,\"y\":525,\"wires\":[[\"4060d565fc3941d1\"]]},{\"id\":\"ae931f01824e1cbc\",\"type\":\"change\",\"z\":\"3fe087dd9290cd30\",\"name\":\"cooldown\",\"rules\":[{\"t\":\"set\",\"p\":\"delay\",\"pt\":\"msg\",\"to\":\"$env('manualCooldown')*1000\",\"tot\":\"jsonata\"}],\"action\":\"\",\"property\":\"\",\"from\":\"\",\"to\":\"\",\"reg\":false,\"x\":525,\"y\":525,\"wires\":[[\"f4e6ddd8960529f3\"]]},{\"id\":\"d826541759debe8b\",\"type\":\"change\",\"z\":\"3fe087dd9290cd30\",\"name\":\"timeOffAfter\",\"rules\":[{\"t\":\"set\",\"p\":\"delay\",\"pt\":\"msg\",\"to\":\"$env('timeOffAfter')*1000\",\"tot\":\"jsonata\"}],\"action\":\"\",\"property\":\"\",\"from\":\"\",\"to\":\"\",\"reg\":false,\"x\":455,\"y\":585,\"wires\":[[\"5436a3c1b895bd12\"]]},{\"id\":\"5436a3c1b895bd12\",\"type\":\"trigger\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Turn Off after motion ends\",\"op1\":\"\",\"op2\":\"\",\"op1type\":\"nul\",\"op2type\":\"payl\",\"duration\":\"5\",\"extend\":true,\"overrideDelay\":true,\"units\":\"s\",\"reset\":\"stop\",\"bytopic\":\"all\",\"topic\":\"topic\",\"outputs\":1,\"x\":685,\"y\":615,\"wires\":[[\"e13e288088919cdf\"]]},{\"id\":\"c2ba449f446e667c\",\"type\":\"tab\",\"label\":\"Bedroom\",\"disabled\":false,\"info\":\"\",\"env\":[]},{\"id\":\"3078332f43c74f1e\",\"type\":\"group\",\"z\":\"c2ba449f446e667c\",\"name\":\"Bedroom Lighting - Motion Control\",\"style\":{\"fill\":\"#bfbfbf\",\"fill-opacity\":\"0.28\",\"label\":true},\"nodes\":[\"5ce86c26042ed130\",\"cd09166b18a2f86b\",\"0364439744f43537\",\"d2a1dd7d5996161d\",\"04c00c183752e772\",\"fa3b7940e4d2fa24\",\"0b0f420ae089691b\",\"b55a96d513e91a1f\",\"dab1e06e38d4c443\",\"e3d9f3b1d3bcc801\",\"36ec48f25d8ac699\",\"528497d80aeca402\",\"4c43170ab9b6c4fc\",\"ff1a1c54f34eb696\",\"c05cc102028d85e9\",\"cb47a6c87fb91b76\",\"df3acb47ef0f0334\",\"8b28b8db6a97e3b2\",\"40bded6d504046aa\",\"b0bc0dd2b5bc36dc\",\"64fb0975f7ea4c76\"],\"x\":14,\"y\":19,\"w\":1792,\"h\":342},{\"id\":\"5ce86c26042ed130\",\"type\":\"server-state-changed\",\"z\":\"c2ba449f446e667c\",\"g\":\"3078332f43c74f1e\",\"name\":\"Light Changed - Bedroom\",\"server\":\"f43d015e.4b29\",\"version\":4,\"exposeToHomeAssistant\":false,\"haConfig\":[{\"property\":\"name\",\"value\":\"\"},{\"property\":\"icon\",\"value\":\"\"}],\"entityidfilter\":\"light.all_bedroom_lights\",\"entityidfiltertype\":\"exact\",\"outputinitially\":true,\"state_type\":\"str\",\"haltifstate\":\"\",\"halt_if_type\":\"str\",\"halt_if_compare\":\"is\",\"outputs\":1,\"output_only_on_state_change\":false,\"for\":\"0\",\"forType\":\"num\",\"forUnits\":\"minutes\",\"ignorePrevStateNull\":false,\"ignorePrevStateUnknown\":false,\"ignorePrevStateUnavailable\":false,\"ignoreCurrentStateUnknown\":false,\"ignoreCurrentStateUnavailable\":false,\"outputProperties\":[{\"property\":\"payload\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"entityState\"},{\"property\":\"data\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"eventData\"},{\"property\":\"topic\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"triggerId\"}],\"x\":150,\"y\":120,\"wires\":[[\"0364439744f43537\"]]},{\"id\":\"cd09166b18a2f86b\",\"type\":\"server-state-changed\",\"z\":\"c2ba449f446e667c\",\"g\":\"3078332f43c74f1e\",\"name\":\"Presence - Bedroom\",\"server\":\"f43d015e.4b29\",\"version\":4,\"exposeToHomeAssistant\":false,\"haConfig\":[{\"property\":\"name\",\"value\":\"\"},{\"property\":\"icon\",\"value\":\"\"}],\"entityidfilter\":\"binary_sensor.bedroom_motion\",\"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,\"outputProperties\":[{\"property\":\"payload\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"entityState\"},{\"property\":\"data\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"eventData\"},{\"property\":\"topic\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"triggerId\"}],\"x\":170,\"y\":200,\"wires\":[[\"0364439744f43537\"],[]]},{\"id\":\"0364439744f43537\",\"type\":\"time-range-switch\",\"z\":\"c2ba449f446e667c\",\"g\":\"3078332f43c74f1e\",\"name\":\"Day?\",\"lat\":\"\",\"lon\":\"\",\"startTime\":\"sunrise\",\"endTime\":\"sunset\",\"startOffset\":0,\"endOffset\":0,\"x\":350,\"y\":160,\"wires\":[[\"d2a1dd7d5996161d\"],[\"04c00c183752e772\"]]},{\"id\":\"d2a1dd7d5996161d\",\"type\":\"subflow:3fe087dd9290cd30\",\"z\":\"c2ba449f446e667c\",\"g\":\"3078332f43c74f1e\",\"name\":\"\",\"env\":[{\"name\":\"timeOffAfter\",\"value\":\"500\",\"type\":\"num\"},{\"name\":\"brightness\",\"value\":\"\",\"type\":\"num\"},{\"name\":\"manualLight\",\"value\":\"true\",\"type\":\"bool\"}],\"x\":540,\"y\":80,\"wires\":[[\"cb47a6c87fb91b76\"],[\"e3d9f3b1d3bcc801\"],[],[]]},{\"id\":\"04c00c183752e772\",\"type\":\"subflow:3fe087dd9290cd30\",\"z\":\"c2ba449f446e667c\",\"g\":\"3078332f43c74f1e\",\"name\":\"\",\"env\":[{\"name\":\"timeOffAfter\",\"value\":\"500\",\"type\":\"num\"},{\"name\":\"brightness\",\"value\":\"\",\"type\":\"num\"},{\"name\":\"manualLight\",\"value\":\"true\",\"type\":\"bool\"}],\"x\":540,\"y\":240,\"wires\":[[\"64fb0975f7ea4c76\"],[\"ff1a1c54f34eb696\"],[],[]]},{\"id\":\"fa3b7940e4d2fa24\",\"type\":\"api-call-service\",\"z\":\"c2ba449f446e667c\",\"g\":\"3078332f43c74f1e\",\"name\":\"Day Scene ON\",\"server\":\"f43d015e.4b29\",\"version\":5,\"debugenabled\":false,\"domain\":\"automation\",\"service\":\"trigger\",\"areaId\":[],\"deviceId\":[],\"entityId\":[\"automation.lighting_bedroom_day\"],\"data\":\"\",\"dataType\":\"jsonata\",\"mergeContext\":\"\",\"mustacheAltTags\":false,\"outputProperties\":[],\"queue\":\"none\",\"x\":1660,\"y\":60,\"wires\":[[]]},{\"id\":\"0b0f420ae089691b\",\"type\":\"api-call-service\",\"z\":\"c2ba449f446e667c\",\"g\":\"3078332f43c74f1e\",\"name\":\"Bedroom Lights OFF\",\"server\":\"f43d015e.4b29\",\"version\":5,\"debugenabled\":false,\"domain\":\"automation\",\"service\":\"trigger\",\"areaId\":[],\"deviceId\":[],\"entityId\":[\"automation.lighting_bedroom_off\"],\"data\":\"\",\"dataType\":\"jsonata\",\"mergeContext\":\"\",\"mustacheAltTags\":false,\"outputProperties\":[],\"queue\":\"none\",\"x\":1680,\"y\":120,\"wires\":[[]]},{\"id\":\"b55a96d513e91a1f\",\"type\":\"api-call-service\",\"z\":\"c2ba449f446e667c\",\"g\":\"3078332f43c74f1e\",\"name\":\"Night Scene ON\",\"server\":\"f43d015e.4b29\",\"version\":5,\"debugenabled\":false,\"domain\":\"automation\",\"service\":\"trigger\",\"areaId\":[],\"deviceId\":[],\"entityId\":[\"automation.lighting_bedroom_night\"],\"data\":\"\",\"dataType\":\"jsonata\",\"mergeContext\":\"\",\"mustacheAltTags\":false,\"outputProperties\":[],\"queue\":\"none\",\"x\":1660,\"y\":220,\"wires\":[[]]},{\"id\":\"dab1e06e38d4c443\",\"type\":\"api-call-service\",\"z\":\"c2ba449f446e667c\",\"g\":\"3078332f43c74f1e\",\"name\":\"Bedroom Lights OFF\",\"server\":\"f43d015e.4b29\",\"version\":5,\"debugenabled\":false,\"domain\":\"automation\",\"service\":\"trigger\",\"areaId\":[],\"deviceId\":[],\"entityId\":[\"automation.lighting_bedroom_off\"],\"data\":\"\",\"dataType\":\"jsonata\",\"mergeContext\":\"\",\"mustacheAltTags\":false,\"outputProperties\":[],\"queue\":\"none\",\"x\":1680,\"y\":280,\"wires\":[[]]},{\"id\":\"e3d9f3b1d3bcc801\",\"type\":\"api-current-state\",\"z\":\"c2ba449f446e667c\",\"g\":\"3078332f43c74f1e\",\"name\":\"Presense - Sam\",\"server\":\"f43d015e.4b29\",\"version\":3,\"outputs\":2,\"halt_if\":\"bedroom\",\"halt_if_type\":\"str\",\"halt_if_compare\":\"is\",\"entity_id\":\"sensor.sam_phone_ble\",\"state_type\":\"str\",\"blockInputOverrides\":false,\"outputProperties\":[{\"property\":\"payload\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"entityState\"},{\"property\":\"data\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"entity\"}],\"for\":\"0\",\"forType\":\"num\",\"forUnits\":\"minutes\",\"override_topic\":false,\"state_location\":\"payload\",\"override_payload\":\"msg\",\"entity_location\":\"data\",\"override_data\":\"msg\",\"x\":780,\"y\":80,\"wires\":[[\"528497d80aeca402\"],[\"36ec48f25d8ac699\"]]},{\"id\":\"36ec48f25d8ac699\",\"type\":\"api-current-state\",\"z\":\"c2ba449f446e667c\",\"g\":\"3078332f43c74f1e\",\"name\":\"Presense - Leah\",\"server\":\"f43d015e.4b29\",\"version\":3,\"outputs\":2,\"halt_if\":\"bedroom\",\"halt_if_type\":\"str\",\"halt_if_compare\":\"is\",\"entity_id\":\"sensor.leah_phone_ble\",\"state_type\":\"str\",\"blockInputOverrides\":false,\"outputProperties\":[{\"property\":\"payload\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"entityState\"},{\"property\":\"data\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"entity\"}],\"for\":\"0\",\"forType\":\"num\",\"forUnits\":\"minutes\",\"override_topic\":false,\"state_location\":\"payload\",\"override_payload\":\"msg\",\"entity_location\":\"data\",\"override_data\":\"msg\",\"x\":980,\"y\":80,\"wires\":[[\"528497d80aeca402\"],[\"0b0f420ae089691b\"]]},{\"id\":\"528497d80aeca402\",\"type\":\"delay\",\"z\":\"c2ba449f446e667c\",\"g\":\"3078332f43c74f1e\",\"name\":\"\",\"pauseType\":\"delay\",\"timeout\":\"5\",\"timeoutUnits\":\"minutes\",\"rate\":\"1\",\"nbRateUnits\":\"1\",\"rateUnits\":\"second\",\"randomFirst\":\"1\",\"randomLast\":\"5\",\"randomUnits\":\"seconds\",\"drop\":false,\"allowrate\":false,\"outputs\":1,\"x\":880,\"y\":160,\"wires\":[[\"e3d9f3b1d3bcc801\"]]},{\"id\":\"4c43170ab9b6c4fc\",\"type\":\"delay\",\"z\":\"c2ba449f446e667c\",\"g\":\"3078332f43c74f1e\",\"name\":\"\",\"pauseType\":\"delay\",\"timeout\":\"5\",\"timeoutUnits\":\"minutes\",\"rate\":\"1\",\"nbRateUnits\":\"1\",\"rateUnits\":\"second\",\"randomFirst\":\"1\",\"randomLast\":\"5\",\"randomUnits\":\"seconds\",\"drop\":false,\"allowrate\":false,\"outputs\":1,\"x\":880,\"y\":320,\"wires\":[[\"ff1a1c54f34eb696\"]]},{\"id\":\"ff1a1c54f34eb696\",\"type\":\"api-current-state\",\"z\":\"c2ba449f446e667c\",\"g\":\"3078332f43c74f1e\",\"name\":\"Presense - Sam\",\"server\":\"f43d015e.4b29\",\"version\":3,\"outputs\":2,\"halt_if\":\"bedroom\",\"halt_if_type\":\"str\",\"halt_if_compare\":\"is\",\"entity_id\":\"sensor.sam_phone_ble\",\"state_type\":\"str\",\"blockInputOverrides\":false,\"outputProperties\":[{\"property\":\"payload\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"entityState\"},{\"property\":\"data\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"entity\"}],\"for\":\"0\",\"forType\":\"num\",\"forUnits\":\"minutes\",\"override_topic\":false,\"state_location\":\"payload\",\"override_payload\":\"msg\",\"entity_location\":\"data\",\"override_data\":\"msg\",\"x\":780,\"y\":240,\"wires\":[[\"4c43170ab9b6c4fc\"],[\"c05cc102028d85e9\"]]},{\"id\":\"c05cc102028d85e9\",\"type\":\"api-current-state\",\"z\":\"c2ba449f446e667c\",\"g\":\"3078332f43c74f1e\",\"name\":\"Presense - Leah\",\"server\":\"f43d015e.4b29\",\"version\":3,\"outputs\":2,\"halt_if\":\"bedroom\",\"halt_if_type\":\"str\",\"halt_if_compare\":\"is\",\"entity_id\":\"sensor.leah_phone_ble\",\"state_type\":\"str\",\"blockInputOverrides\":false,\"outputProperties\":[{\"property\":\"payload\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"entityState\"},{\"property\":\"data\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"entity\"}],\"for\":\"0\",\"forType\":\"num\",\"forUnits\":\"minutes\",\"override_topic\":false,\"state_location\":\"payload\",\"override_payload\":\"msg\",\"entity_location\":\"data\",\"override_data\":\"msg\",\"x\":980,\"y\":240,\"wires\":[[\"4c43170ab9b6c4fc\"],[\"dab1e06e38d4c443\"]]},{\"id\":\"cb47a6c87fb91b76\",\"type\":\"api-current-state\",\"z\":\"c2ba449f446e667c\",\"g\":\"3078332f43c74f1e\",\"name\":\"Sleep - Sam\",\"server\":\"f43d015e.4b29\",\"version\":3,\"outputs\":2,\"halt_if\":\"on\",\"halt_if_type\":\"str\",\"halt_if_compare\":\"is\",\"entity_id\":\"input_boolean.sam_sleeping\",\"state_type\":\"str\",\"blockInputOverrides\":false,\"outputProperties\":[{\"property\":\"payload\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"entityState\"},{\"property\":\"data\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"entity\"}],\"for\":\"0\",\"forType\":\"num\",\"forUnits\":\"minutes\",\"override_topic\":false,\"state_location\":\"payload\",\"override_payload\":\"msg\",\"entity_location\":\"data\",\"override_data\":\"msg\",\"x\":1190,\"y\":60,\"wires\":[[],[\"df3acb47ef0f0334\"]]},{\"id\":\"df3acb47ef0f0334\",\"type\":\"api-current-state\",\"z\":\"c2ba449f446e667c\",\"g\":\"3078332f43c74f1e\",\"name\":\"Sleep - Leah\",\"server\":\"f43d015e.4b29\",\"version\":3,\"outputs\":2,\"halt_if\":\"on\",\"halt_if_type\":\"str\",\"halt_if_compare\":\"is\",\"entity_id\":\"input_boolean.leah_sleeping\",\"state_type\":\"str\",\"blockInputOverrides\":false,\"outputProperties\":[{\"property\":\"payload\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"entityState\"},{\"property\":\"data\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"entity\"}],\"for\":\"0\",\"forType\":\"num\",\"forUnits\":\"minutes\",\"override_topic\":false,\"state_location\":\"payload\",\"override_payload\":\"msg\",\"entity_location\":\"data\",\"override_data\":\"msg\",\"x\":1350,\"y\":60,\"wires\":[[],[\"8b28b8db6a97e3b2\"]]},{\"id\":\"8b28b8db6a97e3b2\",\"type\":\"api-current-state\",\"z\":\"c2ba449f446e667c\",\"g\":\"3078332f43c74f1e\",\"name\":\"Sleeping\",\"server\":\"f43d015e.4b29\",\"version\":3,\"outputs\":2,\"halt_if\":\"on\",\"halt_if_type\":\"str\",\"halt_if_compare\":\"is\",\"entity_id\":\"input_boolean.all_sleeping\",\"state_type\":\"str\",\"blockInputOverrides\":false,\"outputProperties\":[{\"property\":\"payload\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"entityState\"},{\"property\":\"data\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"entity\"}],\"for\":\"0\",\"forType\":\"num\",\"forUnits\":\"minutes\",\"override_topic\":false,\"state_location\":\"payload\",\"override_payload\":\"msg\",\"entity_location\":\"data\",\"override_data\":\"msg\",\"x\":1500,\"y\":60,\"wires\":[[],[\"fa3b7940e4d2fa24\"]]},{\"id\":\"40bded6d504046aa\",\"type\":\"api-current-state\",\"z\":\"c2ba449f446e667c\",\"g\":\"3078332f43c74f1e\",\"name\":\"Sleeping\",\"server\":\"f43d015e.4b29\",\"version\":3,\"outputs\":2,\"halt_if\":\"on\",\"halt_if_type\":\"str\",\"halt_if_compare\":\"is\",\"entity_id\":\"input_boolean.all_sleeping\",\"state_type\":\"str\",\"blockInputOverrides\":false,\"outputProperties\":[{\"property\":\"payload\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"entityState\"},{\"property\":\"data\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"entity\"}],\"for\":\"0\",\"forType\":\"num\",\"forUnits\":\"minutes\",\"override_topic\":false,\"state_location\":\"payload\",\"override_payload\":\"msg\",\"entity_location\":\"data\",\"override_data\":\"msg\",\"x\":1500,\"y\":220,\"wires\":[[],[\"b55a96d513e91a1f\"]]},{\"id\":\"b0bc0dd2b5bc36dc\",\"type\":\"api-current-state\",\"z\":\"c2ba449f446e667c\",\"g\":\"3078332f43c74f1e\",\"name\":\"Sleep - Leah\",\"server\":\"f43d015e.4b29\",\"version\":3,\"outputs\":2,\"halt_if\":\"on\",\"halt_if_type\":\"str\",\"halt_if_compare\":\"is\",\"entity_id\":\"input_boolean.leah_sleeping\",\"state_type\":\"str\",\"blockInputOverrides\":false,\"outputProperties\":[{\"property\":\"payload\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"entityState\"},{\"property\":\"data\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"entity\"}],\"for\":\"0\",\"forType\":\"num\",\"forUnits\":\"minutes\",\"override_topic\":false,\"state_location\":\"payload\",\"override_payload\":\"msg\",\"entity_location\":\"data\",\"override_data\":\"msg\",\"x\":1350,\"y\":220,\"wires\":[[],[\"40bded6d504046aa\"]]},{\"id\":\"64fb0975f7ea4c76\",\"type\":\"api-current-state\",\"z\":\"c2ba449f446e667c\",\"g\":\"3078332f43c74f1e\",\"name\":\"Sleep - Sam\",\"server\":\"f43d015e.4b29\",\"version\":3,\"outputs\":2,\"halt_if\":\"on\",\"halt_if_type\":\"str\",\"halt_if_compare\":\"is\",\"entity_id\":\"input_boolean.sam_sleeping\",\"state_type\":\"str\",\"blockInputOverrides\":false,\"outputProperties\":[{\"property\":\"payload\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"entityState\"},{\"property\":\"data\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"entity\"}],\"for\":\"0\",\"forType\":\"num\",\"forUnits\":\"minutes\",\"override_topic\":false,\"state_location\":\"payload\",\"override_payload\":\"msg\",\"entity_location\":\"data\",\"override_data\":\"msg\",\"x\":1190,\"y\":220,\"wires\":[[],[\"b0bc0dd2b5bc36dc\"]]},{\"id\":\"f43d015e.4b29\",\"type\":\"server\",\"name\":\"Home Assistant\",\"version\":4,\"rejectUnauthorizedCerts\":true,\"ha_boolean\":\"y|yes|true|on|home|open\",\"connectionDelay\":true,\"cacheJson\":true,\"heartbeat\":false,\"heartbeatInterval\":30,\"areaSelector\":\"friendlyName\",\"deviceSelector\":\"friendlyName\",\"entitySelector\":\"friendlyName\",\"statusSeparator\":\"at: \",\"statusYear\":\"hidden\",\"statusMonth\":\"short\",\"statusDay\":\"numeric\",\"statusHourCycle\":\"h23\",\"statusTimeFormat\":\"h:m\"}]\n\u003c/details\u003e\n\n\u0026nbsp;\u0026nbsp;_which uses:_\n\n- [Node-RED Add-On](https://github.com/hassio-addons/addon-node-red)\n- [@dortamur's Node-Red Motion Lighting Flow Template](https://github.com/dortamur/ha-node-red-flows)\n- [Sleep Sensor Control](#sleep) \u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003e\u003ca name=\"https://github.com/smcnab1/home-assistant-config/blob/master/automations/lighting/bedroom/day.yaml\"\u003eDay\u003c/a\u003e\u003c/b\u003e\u003c/summary\u003e\u003cblockquote\u003e\n\u003cb\u003e\u003ci\u003eAutomation to activate bedroom day time scene.\u003c/b\u003e\u003c/i\u003e\n\n\u0026nbsp;\u0026nbsp;_which uses:_\n\n- [scene.bedroom_day](https://github.com/smcnab1/home-assistant-config/blob/master/entities/scenes/bedroom/day.yaml) \u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003e\u003ca name=\"https://github.com/smcnab1/home-assistant-config/blob/master/automations/lighting/bedroom/night.yaml\"\u003eNight\u003c/a\u003e\u003c/b\u003e\u003c/summary\u003e\u003cblockquote\u003e\n\u003cb\u003e\u003ci\u003eAutomation to activate bedroom night time scene.\u003c/b\u003e\u003c/i\u003e\n\n\u0026nbsp;\u0026nbsp;_which uses:_\n\n- [scene.bedroom_night](https://github.com/smcnab1/home-assistant-config/blob/master/entities/scenes/bedroom/night.yaml) \u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003e\u003ca name=\"https://github.com/smcnab1/home-assistant-config/blob/master/automations/lighting/bedroom/movie.yaml\"\u003eMovie Scene\u003c/a\u003e\u003c/b\u003e\u003c/summary\u003e\u003cblockquote\u003e\n\u003cb\u003e\u003ci\u003eAutomation to activate bedroom movie scene.\u003c/b\u003e\u003c/i\u003e\n\n\u0026nbsp;\u0026nbsp;_which uses:_\n\n- [scene.bedroom_movie](https://github.com/smcnab1/home-assistant-config/blob/master/entities/scenes/bedroom/movie.yaml) \u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003e\u003ca name=\"https://github.com/smcnab1/home-assistant-config/blob/master/automations/lighting/bedroom/movie_time.yaml\"\u003eMovie Time\u003c/a\u003e\u003c/b\u003e\u003c/summary\u003e\u003cblockquote\u003e\n\u003cb\u003e\u003ci\u003eAutomation automatically turn on \u003ca name=\"https://github.com/smcnab1/home-assistant-config/blob/master/entities/scenes/bedroom/movie.yaml\"\u003eMovie Scene\u003c/a\u003e when TV is turned on to certain apps/channels.\u003c/b\u003e\u003c/i\u003e\n\n\u0026nbsp;\u0026nbsp;_which uses:_\n\n- [scene.bedroom_movie](https://github.com/smcnab1/home-assistant-config/blob/master/entities/scenes/bedroom/movie.yaml)\n- [Android TV Integration](https://www.home-assistant.io/integrations/androidtv/) \u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003e\u003ca name=\"https://github.com/smcnab1/home-assistant-config/blob/Master/automations/lighting/bedroom/switch.yaml\"\u003eSwitch Control\u003c/a\u003e\u003c/b\u003e\u003c/summary\u003e\u003cblockquote\u003e\n\u003cb\u003e\u003ci\u003eUsing Aqara Switch to toggle lighting, overrides motion triggers\u003c/b\u003e\u003c/i\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003e\u003ca name=\"https://github.com/smcnab1/home-assistant-config/blob/master/automations/lighting/bedroom/off.yaml\"\u003eOff\u003c/a\u003e\u003c/b\u003e\u003c/summary\u003e\u003cblockquote\u003e\n\u003cb\u003e\u003ci\u003eAutomation to turn off all bedroom lights.\u003c/b\u003e\u003c/i\u003e\n\u003c/details\u003e\n\n\u003c/blockquote\u003e\u003c/details\u003e\n\n\u003c!-- HALL LIGHTING AUTOMATIONS --\u003e\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003e\u003ca name=\"https://github.com/smcnab1/home-assistant-config/tree/master/automations/lighting/hall\"\u003eHall 🚪 Lighting\u003c/a\u003e\u003c/b\u003e\u003c/summary\u003e\u003cblockquote\u003e\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eHall Motion Automations\u003c/b\u003e\u003c/summary\u003e\u003cblockquote\u003e\n\u003cb\u003e\u003ci\u003eAutomation which works with motion and door sensors to activate and de-activate lighting. Also depends on time of day.\u003c/b\u003e\u003c/i\u003e\n\n![Node-Red Flow](https://i.imgur.com/JwBNkYo.png)\n\n\u003cdetails\u003e\u003csummary\u003eNode-Red Code\u003c/summary\u003e\u003cblockquote\u003e\n[{\"id\":\"3fe087dd9290cd30\",\"type\":\"subflow\",\"name\":\"Lights Motion Control\",\"info\":\"\",\"category\":\"home_assistant\",\"in\":[{\"x\":57,\"y\":162,\"wires\":[{\"id\":\"ef28eae7ed719fef\"}]}],\"out\":[{\"x\":470,\"y\":375,\"wires\":[{\"id\":\"7979d0139dcbb40b\",\"port\":0}]},{\"x\":560,\"y\":390,\"wires\":[{\"id\":\"7979d0139dcbb40b\",\"port\":1}]},{\"x\":650,\"y\":75,\"wires\":[{\"id\":\"41569ba311d53f87\",\"port\":0}]},{\"x\":890,\"y\":105,\"wires\":[{\"id\":\"dc014e6fd4f7b01b\",\"port\":0}]}],\"env\":[{\"name\":\"timeOffAfter\",\"type\":\"num\",\"value\":\"120\"},{\"name\":\"manualCooldown\",\"type\":\"num\",\"value\":\"30\"},{\"name\":\"brightness\",\"type\":\"num\",\"value\":\"100\",\"ui\":{\"type\":\"input\",\"opts\":{\"types\":[\"num\",\"bool\",\"json\",\"bin\"]}}},{\"name\":\"transitionOn\",\"type\":\"num\",\"value\":\"2\"},{\"name\":\"transitionOff\",\"type\":\"num\",\"value\":\"2\"},{\"name\":\"pause\",\"type\":\"str\",\"value\":\"5\"},{\"name\":\"controlLights\",\"type\":\"str\",\"value\":\"\"},{\"name\":\"manualLight\",\"type\":\"bool\",\"value\":\"false\"}],\"meta\":{},\"color\":\"#52C0F2\",\"icon\":\"font-awesome/fa-lightbulb-o\",\"status\":{\"x\":1027,\"y\":157,\"wires\":[{\"id\":\"67740cc1abae3f4d\",\"port\":0}]}},{\"id\":\"69b69fb47d2e171c\",\"type\":\"change\",\"z\":\"3fe087dd9290cd30\",\"name\":\"motion\",\"rules\":[{\"t\":\"set\",\"p\":\"payload\",\"pt\":\"msg\",\"to\":\"motion\",\"tot\":\"str\"}],\"action\":\"\",\"property\":\"\",\"from\":\"\",\"to\":\"\",\"reg\":false,\"x\":544,\"y\":178,\"wires\":[[\"dc014e6fd4f7b01b\"]]},{\"id\":\"dc014e6fd4f7b01b\",\"type\":\"state-machine\",\"z\":\"3fe087dd9290cd30\",\"name\":\"\",\"triggerProperty\":\"payload\",\"triggerPropertyType\":\"msg\",\"stateProperty\":\"payload\",\"statePropertyType\":\"msg\",\"initialDelay\":\"\",\"persistOnReload\":true,\"outputStateChangeOnly\":true,\"throwException\":false,\"states\":[\"switch\",\"motion-detected\",\"motion-on\",\"motion-off\",\"off\",\"on\"],\"transitions\":[{\"name\":\"motion\",\"from\":\"off\",\"to\":\"motion-detected\"},{\"name\":\"motion\",\"from\":\"motion-off\",\"to\":\"motion-detected\"},{\"name\":\"motion\",\"from\":\"motion-on\",\"to\":\"motion-on\"},{\"name\":\"off\",\"from\":\"*\",\"to\":\"off\"},{\"name\":\"on\",\"from\":\"*\",\"to\":\"on\"},{\"name\":\"switch\",\"from\":\"off\",\"to\":\"switch\"},{\"name\":\"switch\",\"from\":\"on\",\"to\":\"switch\"},{\"name\":\"switch\",\"from\":\"switch\",\"to\":\"switch\"},{\"name\":\"switch\",\"from\":\"motion-on\",\"to\":\"switch\"},{\"name\":\"motion-on\",\"from\":\"motion-detected\",\"to\":\"motion-on\"},{\"name\":\"motion-off\",\"from\":\"motion-on\",\"to\":\"motion-off\"}],\"x\":741,\"y\":157,\"wires\":[[\"7979d0139dcbb40b\",\"67740cc1abae3f4d\"]]},{\"id\":\"c0ac9957e8074a3a\",\"type\":\"change\",\"z\":\"3fe087dd9290cd30\",\"name\":\"switch\",\"rules\":[{\"t\":\"set\",\"p\":\"payload\",\"pt\":\"msg\",\"to\":\"switch\",\"tot\":\"str\"}],\"action\":\"\",\"property\":\"\",\"from\":\"\",\"to\":\"\",\"reg\":false,\"x\":541,\"y\":223,\"wires\":[[\"dc014e6fd4f7b01b\"]]},{\"id\":\"b808c7939e262898\",\"type\":\"change\",\"z\":\"3fe087dd9290cd30\",\"name\":\"stop\",\"rules\":[{\"t\":\"set\",\"p\":\"reset\",\"pt\":\"msg\",\"to\":\"true\",\"tot\":\"bool\"}],\"action\":\"\",\"property\":\"\",\"from\":\"\",\"to\":\"\",\"reg\":false,\"x\":440,\"y\":630,\"wires\":[[\"5436a3c1b895bd12\"]]},{\"id\":\"529401309069e7e5\",\"type\":\"inject\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Initial State\",\"props\":[{\"p\":\"reset\",\"v\":\"true\",\"vt\":\"bool\"},{\"p\":\"topic\",\"vt\":\"str\"}],\"repeat\":\"\",\"crontab\":\"\",\"once\":true,\"onceDelay\":\"10\",\"topic\":\"\",\"x\":665,\"y\":570,\"wires\":[[\"4060d565fc3941d1\",\"f4e6ddd8960529f3\"]]},{\"id\":\"18d112236dd3f2c6\",\"type\":\"link in\",\"z\":\"3fe087dd9290cd30\",\"name\":\"\",\"links\":[\"774c661db65310b7\",\"f95e514e2b0be219\"],\"x\":592,\"y\":120,\"wires\":[[\"dc014e6fd4f7b01b\"]]},{\"id\":\"774c661db65310b7\",\"type\":\"link out\",\"z\":\"3fe087dd9290cd30\",\"name\":\"living room state\",\"links\":[\"18d112236dd3f2c6\"],\"x\":1020,\"y\":570,\"wires\":[]},{\"id\":\"7979d0139dcbb40b\",\"type\":\"switch\",\"z\":\"3fe087dd9290cd30\",\"name\":\"State Action\",\"property\":\"payload\",\"propertyType\":\"msg\",\"rules\":[{\"t\":\"eq\",\"v\":\"motion-detected\",\"vt\":\"str\"},{\"t\":\"eq\",\"v\":\"motion-off\",\"vt\":\"str\"},{\"t\":\"eq\",\"v\":\"motion-on\",\"vt\":\"str\"},{\"t\":\"eq\",\"v\":\"switch\",\"vt\":\"str\"}],\"checkall\":\"true\",\"repair\":false,\"outputs\":4,\"x\":230,\"y\":465,\"wires\":[[\"83884d0cb7a1e2a8\",\"f9350e6c9e6be889\"],[\"ab49cdb37a246459\"],[\"d826541759debe8b\"],[\"b808c7939e262898\",\"ae931f01824e1cbc\"]]},{\"id\":\"ece9daf5e1c3fe6c\",\"type\":\"rbe\",\"z\":\"3fe087dd9290cd30\",\"name\":\"\",\"func\":\"rbe\",\"gap\":\"\",\"start\":\"\",\"inout\":\"out\",\"property\":\"payload\",\"x\":369,\"y\":223,\"wires\":[[\"c0ac9957e8074a3a\"]]},{\"id\":\"ef28eae7ed719fef\",\"type\":\"switch\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Topic Route\",\"property\":\"topic\",\"propertyType\":\"msg\",\"rules\":[{\"t\":\"regex\",\"v\":\"^config\\\\b\",\"vt\":\"str\",\"case\":false},{\"t\":\"regex\",\"v\":\"^reset\\\\b\",\"vt\":\"str\",\"case\":false},{\"t\":\"eq\",\"v\":\"light_state\",\"vt\":\"str\"},{\"t\":\"cont\",\"v\":\"sensor.\",\"vt\":\"str\"},{\"t\":\"regex\",\"v\":\"^(light|switch)\\\\.\",\"vt\":\"str\",\"case\":false}],\"checkall\":\"true\",\"repair\":false,\"outputs\":5,\"x\":175,\"y\":162,\"wires\":[[\"41569ba311d53f87\"],[\"6b80334d2b0bd4ab\"],[\"dc014e6fd4f7b01b\"],[\"5855ad1b303c6bc1\"],[\"ece9daf5e1c3fe6c\",\"8ffe714a5901d07d\"]]},{\"id\":\"41569ba311d53f87\",\"type\":\"function\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Update Configuration\",\"func\":\"// Init our Lights state while we're here\\nlet lights = flow.get('lights')\\n// Is this our start-up initialisation? (If so, reset config!)\\nlet init = msg.init || false\\nif (!lights)\\n  flow.set('lights', { state: { }, ids: [], ids_csv: '' })\\n\\n// Merge new Payload with existing config and defaults\\nlet cfg = Object.assign(\\n  // Existing Config\\n  init?flow.get('cfg')||{}:{},  // 'cfg.'+id\\n  // Updated Config\\n  msg.payload)\\n\\n// Make sure Light IDs are initted.\\n// if (!cfg.lights) cfg.lights = []\\nif (!cfg.brightness)\\n  cfg.brightness = env.get('brightness') || 100\\n\\nif (!cfg.transitionOn \u0026\u0026 cfg.transitionOn !== 0)\\n  cfg.transitionOn = env.get('transitionOn') || 2\\n  \\nif (!cfg.transitionOff \u0026\u0026 cfg.transitionOff !== 0)\\n  cfg.transitionOff = env.get('transitionOff') || 2\\n\\nif (!cfg.lights \u0026\u0026 env.get('controlLights') \u0026\u0026 env.get('controlLights').length\u003e0)\\n    cfg.lights = env.get('controlLights').split(/\\\\s*,\\\\s*/)\\n\\nflow.set('cfg', cfg)\\n\\nreturn { topic: 'config', payload: cfg, lights }\",\"outputs\":1,\"noerr\":0,\"initialize\":\"\",\"finalize\":\"\",\"libs\":[],\"x\":505,\"y\":75,\"wires\":[[]]},{\"id\":\"5855ad1b303c6bc1\",\"type\":\"switch\",\"z\":\"3fe087dd9290cd30\",\"name\":\"motion on\",\"property\":\"payload\",\"propertyType\":\"msg\",\"rules\":[{\"t\":\"eq\",\"v\":\"on\",\"vt\":\"str\"}],\"checkall\":\"true\",\"repair\":false,\"outputs\":1,\"x\":375,\"y\":178,\"wires\":[[\"69b69fb47d2e171c\"]]},{\"id\":\"8ffe714a5901d07d\",\"type\":\"function\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Track Lights\",\"func\":\"// Keep a record of all the light entity_ids coming in, for later switching\\n\\nlet lights = flow.get('lights') || { state: { }, ids: [], ids_csv: '' }\\n\\nlet [all, id] = msg.topic.match(/^light\\\\.(.*)/)\\nlet update = false\\n\\nif (id) {\\n  lights.state[id] = msg.data.new_state\\n  if (!lights.ids.includes(id)) {\\n    lights.ids.push(id)\\n    update = true\\n  }\\n  lights.ids_csv = lights.ids.join(',')\\n}\\n\\nflow.set('lights', lights)\\n\\nreturn {update}\",\"outputs\":1,\"noerr\":0,\"initialize\":\"\",\"finalize\":\"\",\"libs\":[],\"x\":389,\"y\":268,\"wires\":[[\"31b931f6b9df7e2e\"]]},{\"id\":\"83884d0cb7a1e2a8\",\"type\":\"function\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Light Cfg\",\"func\":\"let cfg = flow.get('cfg')|| {}\\nlet lights = flow.get('lights') || {}\\n// Use Light IDs from Config if defined - otherwise use detected\\nlet light_ids = cfg.lights || lights.ids\\nlet delay = env.get('pause')*1000\\n\\n// Prepare config paramters for Light On. This is\\n// an Array of Payload Data, one for each light\\nlet payload = light_ids.map(id =\u003e { return {\\n  data: {\\n    brightness: Math.floor(cfg.brightness/100*255),\\n    transition: cfg.transitionOn,\\n    entity_id: 'light.'+id\\n  }\\n}})\\n\\nreturn {\\n    topic: 'light.'+light_ids.join(','),\\n    payload,\\n    delay\\n}\",\"outputs\":1,\"noerr\":0,\"initialize\":\"\",\"finalize\":\"\",\"libs\":[],\"x\":525,\"y\":330,\"wires\":[[\"412fe93b1c4add94\",\"3803e8ecf7384d2b\"]]},{\"id\":\"ab49cdb37a246459\",\"type\":\"function\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Light Cfg\",\"func\":\"let cfg = flow.get('cfg')|| {}\\nlet lights = flow.get('lights') || {}\\n// Use Light IDs from Config if defined - otherwise use detected\\nlet light_ids = cfg.lights || lights.ids\\nlet delay = env.get('pause')*1000\\n\\n// Prepare config paramters for Light Off. This is\\n// an Array of Payload Data, one for each light\\nlet payload = light_ids.map(id =\u003e { return {\\n  data: {\\n    transition: cfg.transitionOff,\\n    entity_id: 'light.'+id\\n  }\\n}})\\n\\nreturn {\\n    topic: 'light.'+light_ids.join(','),\\n    payload,\\n    delay\\n}\",\"outputs\":1,\"noerr\":0,\"initialize\":\"\",\"finalize\":\"\",\"libs\":[],\"x\":525,\"y\":435,\"wires\":[[\"ed01207d5f3679e4\",\"63c85b090efb1c5c\"]]},{\"id\":\"1ec81804eca7f722\",\"type\":\"inject\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Default Configuration\",\"props\":[{\"p\":\"payload\"},{\"p\":\"topic\",\"vt\":\"str\"},{\"p\":\"init\",\"v\":\"true\",\"vt\":\"str\"}],\"repeat\":\"\",\"crontab\":\"\",\"once\":true,\"onceDelay\":0.1,\"topic\":\"config\",\"payload\":\"{}\",\"payloadType\":\"json\",\"x\":235,\"y\":75,\"wires\":[[\"41569ba311d53f87\"]]},{\"id\":\"2dfcf7ed6c713ca9\",\"type\":\"api-call-service\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Turn on light\",\"server\":\"f43d015e.4b29\",\"version\":5,\"debugenabled\":false,\"domain\":\"light\",\"service\":\"turn_on\",\"areaId\":[],\"deviceId\":[],\"entityId\":[],\"data\":\"\",\"dataType\":\"json\",\"mergeContext\":\"\",\"mustacheAltTags\":false,\"outputProperties\":[{\"property\":\"payload\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"data\"}],\"queue\":\"none\",\"x\":1045,\"y\":285,\"wires\":[[]]},{\"id\":\"015672de6c534fb2\",\"type\":\"api-call-service\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Turn off light\",\"server\":\"f43d015e.4b29\",\"version\":5,\"domain\":\"light\",\"service\":\"turn_off\",\"areaId\":[],\"deviceId\":[],\"entityId\":[],\"data\":\"\",\"mergeContext\":\"\",\"outputProperties\":[{\"property\":\"payload\",\"propertyType\":\"msg\",\"value\":\"\",\"valueType\":\"data\"}],\"queue\":\"none\",\"x\":1045,\"y\":435,\"wires\":[[]]},{\"id\":\"4060d565fc3941d1\",\"type\":\"function\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Check State\",\"func\":\"// Fetch light state from our \\\"Track Lights\\\" data\\n// - no need for a HA State node\\n\\nlet lights = flow.get('lights') || { state: { }, ids: [], ids_csv: '' }\\nlet cfg = flow.get('cfg')|| {}\\n\\n// Return \\\"on\\\" if any one light is \\\"on\\\"\\nreturn {\\n    topic: 'light.'+lights.ids_csv,\\n    payload: lights.ids.map(id =\u003e lights.state[id].state).includes('on') ? 'on' : 'off'\\n}\",\"outputs\":1,\"noerr\":0,\"initialize\":\"\",\"finalize\":\"\",\"libs\":[],\"x\":910,\"y\":525,\"wires\":[[\"774c661db65310b7\"]]},{\"id\":\"4b0205094e835fcc\",\"type\":\"split\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Each Light\",\"splt\":\"\\\\n\",\"spltType\":\"str\",\"arraySplt\":1,\"arraySpltType\":\"len\",\"stream\":false,\"addname\":\"\",\"x\":880,\"y\":285,\"wires\":[[\"2dfcf7ed6c713ca9\"]]},{\"id\":\"88c1ddf9130a3f60\",\"type\":\"split\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Each Light\",\"splt\":\"\\\\n\",\"spltType\":\"str\",\"arraySplt\":1,\"arraySpltType\":\"len\",\"stream\":false,\"addname\":\"\",\"x\":875,\"y\":435,\"wires\":[[\"015672de6c534fb2\"]]},{\"id\":\"01dd313513cd6bbc\",\"type\":\"function\",\"z\":\"3fe087dd9290cd30\",\"name\":\"motion-on\",\"func\":\"// We use a function here to generate a new clean message\\n\\nreturn {\\n    topic: 'state',\\n    payload: 'motion-on'\\n}\",\"outputs\":1,\"noerr\":0,\"initialize\":\"\",\"finalize\":\"\",\"libs\":[],\"x\":885,\"y\":330,\"wires\":[[\"f95e514e2b0be219\"]]},{\"id\":\"e13e288088919cdf\",\"type\":\"function\",\"z\":\"3fe087dd9290cd30\",\"name\":\"motion-off\",\"func\":\"// We use a function here to generate a new clean message\\n\\nreturn {\\n    topic: 'state',\\n    payload: 'motion-off'\\n}\",\"outputs\":1,\"noerr\":0,\"initialize\":\"\",\"finalize\":\"\",\"libs\":[],\"x\":900,\"y\":615,\"wires\":[[\"774c661db65310b7\"]]},{\"id\":\"f9350e6c9e6be889\",\"type\":\"change\",\"z\":\"3fe087dd9290cd30\",\"name\":\"stop\",\"rules\":[{\"t\":\"set\",\"p\":\"reset\",\"pt\":\"msg\",\"to\":\"true\",\"tot\":\"bool\"}],\"action\":\"\",\"property\":\"\",\"from\":\"\",\"to\":\"\",\"reg\":false,\"x\":530,\"y\":480,\"wires\":[[\"63c85b090efb1c5c\"]]},{\"id\":\"67740cc1abae3f4d\",\"type\":\"function\",\"z\":\"3fe087dd9290cd30\",\"name\":\"status\",\"func\":\"\\nmsg.payload = {\\n    text: msg.payload, \\n    shape: msg.payload.match(/on/) ? 'ring' : 'dot',\\n    fill: msg.payload == 'switch' ? 'red' : 'green'\\n}\\nreturn msg;\",\"outputs\":1,\"noerr\":0,\"x\":928,\"y\":157,\"wires\":[[]]},{\"id\":\"412fe93b1c4add94\",\"type\":\"switch\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Manual?\",\"property\":\"manualLight\",\"propertyType\":\"env\",\"rules\":[{\"t\":\"true\"},{\"t\":\"else\"}],\"checkall\":\"true\",\"repair\":false,\"outputs\":2,\"x\":705,\"y\":285,\"wires\":[[],[\"4b0205094e835fcc\"]]},{\"id\":\"ed01207d5f3679e4\",\"type\":\"switch\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Manual?\",\"property\":\"manualLight\",\"propertyType\":\"env\",\"rules\":[{\"t\":\"true\"},{\"t\":\"else\"}],\"checkall\":\"true\",\"repair\":false,\"outputs\":2,\"x\":705,\"y\":435,\"wires\":[[],[\"88c1ddf9130a3f60\"]]},{\"id\":\"f95e514e2b0be219\",\"type\":\"link out\",\"z\":\"3fe087dd9290cd30\",\"name\":\"living room state\",\"links\":[\"18d112236dd3f2c6\"],\"x\":990,\"y\":330,\"wires\":[]},{\"id\":\"6b80334d2b0bd4ab\",\"type\":\"function\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Reset\",\"func\":\"flow.set('lights', null)\\nflow.set('cfg', null)\\n\\nreturn msg\",\"outputs\":1,\"noerr\":0,\"initialize\":\"\",\"finalize\":\"\",\"libs\":[],\"x\":365,\"y\":135,\"wires\":[[\"41569ba311d53f87\"]]},{\"id\":\"31b931f6b9df7e2e\",\"type\":\"switch\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Updated?\",\"property\":\"update\",\"propertyType\":\"msg\",\"rules\":[{\"t\":\"true\"}],\"checkall\":\"true\",\"repair\":false,\"outputs\":1,\"x\":540,\"y\":270,\"wires\":[[\"41569ba311d53f87\"]]},{\"id\":\"3803e8ecf7384d2b\",\"type\":\"trigger\",\"z\":\"3fe087dd9290cd30\",\"name\":\"pause\",\"op1\":\"\",\"op2\":\"\",\"op1type\":\"nul\",\"op2type\":\"payl\",\"duration\":\"5\",\"extend\":true,\"overrideDelay\":true,\"units\":\"s\",\"reset\":\"stop\",\"bytopic\":\"all\",\"topic\":\"topic\",\"outputs\":1,\"x\":695,\"y\":330,\"wires\":[[\"01dd313513cd6bbc\"]]},{\"id\":\"63c85b090efb1c5c\",\"type\":\"trigger\",\"z\":\"3fe087dd9290cd30\",\"name\":\"pause\",\"op1\":\"\",\"op2\":\"\",\"op1type\":\"nul\",\"op2type\":\"payl\",\"duration\":\"5\",\"extend\":true,\"overrideDelay\":true,\"units\":\"s\",\"reset\":\"stop\",\"bytopic\":\"all\",\"topic\":\"topic\",\"outputs\":1,\"x\":695,\"y\":480,\"wires\":[[\"4060d565fc3941d1\"]]},{\"id\":\"f4e6ddd8960529f3\",\"type\":\"trigger\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Back to Auto\",\"op1\":\"\",\"op2\":\"\",\"op1type\":\"nul\",\"op2type\":\"payl\",\"duration\":\"5\",\"extend\":true,\"overrideDelay\":true,\"units\":\"s\",\"reset\":\"stop\",\"bytopic\":\"all\",\"topic\":\"topic\",\"outputs\":1,\"x\":715,\"y\":525,\"wires\":[[\"4060d565fc3941d1\"]]},{\"id\":\"ae931f01824e1cbc\",\"type\":\"change\",\"z\":\"3fe087dd9290cd30\",\"name\":\"cooldown\",\"rules\":[{\"t\":\"set\",\"p\":\"delay\",\"pt\":\"msg\",\"to\":\"$env('manualCooldown')*1000\",\"tot\":\"jsonata\"}],\"action\":\"\",\"property\":\"\",\"from\":\"\",\"to\":\"\",\"reg\":false,\"x\":525,\"y\":525,\"wires\":[[\"f4e6ddd8960529f3\"]]},{\"id\":\"d826541759debe8b\",\"type\":\"change\",\"z\":\"3fe087dd9290cd30\",\"name\":\"timeOffAfter\",\"rules\":[{\"t\":\"set\",\"p\":\"delay\",\"pt\":\"msg\",\"to\":\"$env('timeOffAfter')*1000\",\"tot\":\"jsonata\"}],\"action\":\"\",\"property\":\"\",\"from\":\"\",\"to\":\"\",\"reg\":false,\"x\":455,\"y\":585,\"wires\":[[\"5436a3c1b895bd12\"]]},{\"id\":\"5436a3c1b895bd12\",\"type\":\"trigger\",\"z\":\"3fe087dd9290cd30\",\"name\":\"Turn Off after motion ends\",\"op1\":\"\",\"op2\":\"\",\"op1type\":\"nul\",\"op2type\":\"payl\",\"duration\":\"5\",\"extend\":true,\"overrideDelay\":true,\"units\":\"s\",\"reset\":\"stop\",\"bytopic\":\"all\",\"topic\":\"topic\",\"outputs\":1,\"x\":685,\"y\":615,\"wires\":[[\"e13e288088919cdf\"]]},{\"id\":\"7c547859912b407f\",\"type\":\"tab\",\"label\":\"Hall\",\"disabled\":false,\"info\":\"\",\"env\":[]},{\"id\":\"e47d3124ce86e5cf\",\"type\":\"group\",\"z\":\"7c547859912b407f\",\"name\":\"Hall Lighting - Door Control\",\"style\":{\"label\":true,\"fill\":\"#bfbfbf\",\"fill-opacity\":\"0.28\"},\"nodes\":[\"0d31b91fa456ef0a\",\"34ed0ea27e507b41\",\"1160707e1d5f6745\",\"e067aa5a9a5ad390\",\"a89b115c1bcf76b0\"],\"x\":14,\"y\":339,\"w\":812","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmcnab1%2Fhome-assistant-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmcnab1%2Fhome-assistant-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmcnab1%2Fhome-assistant-config/lists"}