├── .HA_VERSION
├── .gitignore
├── .prettierignore
├── .prettierrc
├── .vscode
├── extensions.json
└── settings.json
├── .yamllint
├── LICENSE
├── README.md
├── automations.yaml
├── blueprints
├── automation
│ ├── CentralCommand
│ │ └── get-notified-any-time-there-is-a-new-home-assistant-alert.yaml
│ ├── EPMatt
│ │ ├── ikea_e1744.yaml
│ │ ├── ikea_e1812.yaml
│ │ ├── persistent_notification_to_mobile.yaml
│ │ └── philips_324131092621.yaml
│ ├── SirGoodenough
│ │ └── Zigbee2MQTT - Xiaomi Cube Controller.yaml
│ ├── cvroque
│ │ └── webostv_turn_on.yaml
│ ├── homeassistant
│ │ ├── motion_light.yaml
│ │ └── notify_leaving_zone.yaml
│ ├── mannerisms
│ │ └── zha-philips-hue-dimmer-switch-individual-buttons-with-long-presses.yaml
│ ├── metbril
│ │ ├── actionable_alert.yaml
│ │ ├── always_on.yaml
│ │ ├── appliance_has_finished.yaml
│ │ ├── appliance_running.yaml
│ │ └── zha_ikea_tradfri_2button_onoff_brightness.yaml
│ ├── michal-stelmach
│ │ └── meteoalarm_mobile.yaml
│ ├── niro1987
│ │ └── lightsaver.yaml
│ ├── samnewman86
│ │ └── another-deconz-ikea-5-button-remote-blueprint-this-time-with-long-press-on-all-buttons.yaml
│ ├── sbyx
│ │ └── low-battery-level-detection-notification-for-all-battery-sensors.yaml
│ └── seamus65
│ │ └── zha-ikea-symfonisk-sound-controller-for-media-the-spinny-one.yaml
└── script
│ ├── Talvish
│ └── sonos_say.yaml
│ └── homeassistant
│ └── confirmable_notification.yaml
├── configuration.yaml
├── includes
├── alert.yaml
├── automation
│ └── random_house_stats.yaml
├── climate.yaml
├── customize.yaml
├── customize_glob.yaml
├── group.yaml
├── logger.yaml
├── notify.yaml
├── rest_command.yaml
├── sensor
│ ├── living_lights_on_today.yaml
│ ├── living_tv_on_last_24h.yaml
│ ├── living_tv_on_today.yaml
│ ├── living_tv_on_today_ratio.yaml
│ ├── office_heater_on_today.yaml
│ ├── statistics.yaml
│ ├── time_date.yaml
│ └── working_from_home.yaml
└── template
│ ├── appliances
│ ├── tumble_dryer_running.yaml
│ ├── washing_machine_running.yaml
│ ├── washing_machine_running_duration.yaml
│ ├── washing_machine_running_energy.yaml
│ ├── washing_machine_running_off.yaml
│ └── washing_machine_running_on.yaml
│ ├── expected_precipitation.yaml
│ ├── living_tv_volume_level.yaml
│ ├── low_battery.yaml
│ ├── occupancy
│ ├── binary_sensor_occupancy.yaml
│ └── sensor_occupancy.yaml
│ ├── uv_protection_window.yaml
│ └── zigbee_devices_offline.yaml
├── scenes.yaml
├── scripts.yaml
├── secrets.example.yaml
├── themes
└── .gitkeep
└── zigbee2mqtt
└── configuration.yaml
/.HA_VERSION:
--------------------------------------------------------------------------------
1 | 2024.5.1
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # home assistant files
2 | home-assistant_v2.db
3 | home-assistant.log
4 | home-assistant.log*
5 | ip_bans.yaml
6 | known_devices.yaml
7 | secrets.yaml
8 | feedreader.pickle
9 |
10 | # home assistant folders
11 | .cloud/
12 | .storage/
13 | custom_components/
14 | deps/
15 | homebridge/
16 | image/
17 | lib/
18 | themes/
19 | tts/
20 | www/
21 | www/community/
22 | zigbee2mqtt/*
23 |
24 |
25 | # zwave
26 | OZW_Log.txt
27 |
28 | # MacOS
29 | .DS_Store
30 | ._*
31 |
32 | # sane defaults
33 | *.pid
34 | *.xml
35 | *.conf
36 | *.csr
37 | *.crt
38 | *.key
39 | *.log
40 |
41 | # database files
42 | *.db
43 | *.db-shm
44 | *.db-wal
45 | *.db-journal
46 | *.sqlite
47 | *.sqlite-journal
48 |
49 | # custom files
50 | *.csv
51 |
52 | # custom folders
53 | ssh/
54 |
55 | # custom components
56 | # authenticated
57 | .ip_authenticated.yaml
58 |
59 | # exceptions (!...)
60 | !zigbee2mqtt/configuration.yaml
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | # UI generated files
2 | automations.yaml
3 | scripts.yaml
4 | scenes.yaml
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/metbril/home-assistant-config/95a49f6cf424e1e83ce56299b72a11b3bf4208ad/.prettierrc
--------------------------------------------------------------------------------
/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": []
3 | }
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "[home-assistant]": {
3 |
4 | "editor.insertSpaces": true,
5 | "editor.tabSize": 2,
6 | "editor.quickSuggestions": {
7 | "other": true,
8 | "comments": false,
9 | "strings": true
10 | },
11 | "editor.autoIndent": "full"
12 | },
13 | "files.associations": {
14 | "*.yaml": "home-assistant",
15 | ".prettierrc": "yaml",
16 | ".prettierignore": "gitignore"
17 | }
18 | }
--------------------------------------------------------------------------------
/.yamllint:
--------------------------------------------------------------------------------
1 | extends: default
2 |
3 | rules:
4 | document-start: disable
5 | new-line-at-end-of-file: disable
6 | line-length: disable
7 | comments:
8 | require-starting-space: true
9 | ignore-shebangs: true
10 | min-spaces-from-content: 1
11 |
12 | ignore: |
13 |
14 | # folders
15 | blueprints/
16 | custom_components/
17 | themes/
18 |
19 | # files
20 | automations.yaml
21 | customize.yaml
22 | groups.yaml
23 | ip_bans.yaml
24 | known_devices.yaml
25 | scenes.yaml
26 | scripts.yaml
27 | secrets.yaml
28 | secrets.example.yaml
29 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 Robert van Bregt
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Metbril's 🤓 Home Assistant Configuration
2 |
3 | [![Check configuration][check-badge]][check-log]
4 | [![Mastodon][mastodon-badge]][mastodon-link]
5 |
6 | This repository contains my configuration for Home Assistant.
7 |
8 | NOTE: I have decided to no longer maintain my configuration with git.
9 | Home Assistant is moving outside YAML more and more.
10 | Larger parts of the configuration are stored outside these files.
11 | This is the last commit before the repository is archived.
12 |
13 | ## Table of Contents
14 |
15 |
16 |
17 |
18 | Details
19 |
20 | - [Configuration principles](#configuration-principles)
21 | - [Automations, Scripts & Scenes](#automations-scripts--scenes)
22 | - [HASS.io](#hassio)
23 | - [Host hardware](#host-hardware)
24 | - [Add-ons](#add-ons)
25 | - [SSH](#ssh)
26 | - [Samba](#samba)
27 | - [Backups](#backups)
28 | - [Custom Components](#custom-components)
29 | - [HACS](#hacs)
30 | - [Z-Wave](#z-wave)
31 | - [Hardware](#hardware)
32 | - [Sonos](#sonos)
33 | - [Neo Coolcam](#neo-coolcam)
34 | - [Dashboards](#dashboards)
35 | - [Themes](#themes)
36 | - [Mushroom & Tile cards](#mushroom--tile-cards)
37 | - [Custom cards](#custom-cards)
38 | - [Tips & Tricks](#tips--tricks)
39 | - [Tracking your Lovelace UI file](#tracking-your-lovelace-ui-file)
40 | - [Testing and debugging automations with automation editor](#testing-and-debugging-automations-with-automation-editor)
41 | - [Limit database growth](#limit-database-growth)
42 | - [Outside Brightness](#outside-brightness)
43 | - [Maintenance](#maintenance)
44 | - [Credits 🙏](#credits-)
45 | - [Contributions](#contributions)
46 |
47 |
48 |
49 |
50 | ## Configuration principles
51 |
52 | I used to be an avid user of packages. That provided an easy way to keep
53 | funtionality together, enable or disable it, and share with others. However,
54 | Home Assistant is slowly phasing out YAML configuration and adding more and
55 | more features to the UI. This has pros and cons, but the main advantage is,
56 | that you don't need a real computer, ssh or a Samba connection
57 | to edit the configuration.
58 |
59 | The biggest drawback of using the UI is, that editing using the interface
60 | usually takes more time than editing a text file. But on the other hand, I have
61 | spent a lot of time fixed yaml syntax and formatting errors.
62 |
63 | So for now I have decided to move as much configuration as possible to the UI.
64 |
65 | ### Automations, Scripts & Scenes
66 |
67 | Since using the UI editor for automations, scripts and scenes, I have noticed
68 | that I change those a lot. These means that changes are scattered around the
69 | files. Since I want to track changes through git and be able
70 | to revert to old versions, I have again decided to split these files
71 | `automations.yaml`, `scripts.yaml` and `scenes.yaml` into separate files.
72 | I will continue using the files for quick one offs or testing.
73 |
74 | ## HASS.io
75 |
76 | This file contains specific details about my HASS.io installation.
77 |
78 | ### Host hardware
79 |
80 | The system is currently running on Hardkernel Odroid-N2 (like [Home Assistant Blue][blue]).
81 | Previously, I have used a Raspberry Pi 3B and before that a Raspberry Pi 2B.
82 |
83 | ## Add-ons
84 |
85 | I recently switched to [Home Assistant Cloud][cloud] from a self-managed proxy setup.
86 | So I closed the port on my firewall and no longer need the add-ons that made this possible:
87 | Nginx Proxy, Duckdns and Certbot.
88 |
89 | ### SSH
90 |
91 | ### Samba
92 |
93 | ### Backups
94 |
95 | I create backups with the [Home Assistant Google Drive Backup addon](https://github.com/sabeechen/hassio-google-drive-backup).
96 |
97 | ## Custom Components
98 |
99 | ### HACS
100 |
101 | To manage my custom components, I use [HACS](https://hacs.xyz/).
102 |
103 | ## Z-Wave
104 |
105 | I am using Z-Wave. I started using it as a reliable, secure and 2-way alternative to cheap 433 MHz devices (mainly Klik-Aan-Klik-Uit). This was before Philips Hue and Ikea Trådfri became large and mainstream, and thus the Zigbee protocol.
106 |
107 | Until the end of 2019 I have been using the standard Hassio [Z-Wave integration](https://www.home-assistant.io/integrations/zwave/), but have migrated to [Zwave2Mqtt](https://github.com/OpenZWave/Zwave2Mqtt) since.
108 |
109 | The reason to switch to Zwave2Mqtt was, to de-couple Home Assistant from my Z-Wave network. This should provide me with a healthier and more stable Z-Wave mesh. Using the Z-Wave integration, you will restart your entire network with every restart of Home Assistant, which can lead to unexpected results. And you need to wait minutes for all entities to show up.
110 |
111 | Somewhere in 2023, I moved to the [Z-Wave JS integration](https://www.home-assistant.io/integrations/zwave_js/).
112 |
113 | ## Hardware
114 |
115 | Connected (smart) hardware:
116 |
117 | - Sonos speakers
118 | - [LG WebOS TV](https://www.home-assistant.io/integrations/webostv/)
119 |
120 | ### Sonos
121 |
122 | Sonos speakers are added through discovery. This is more convenient than configuring manually.
123 |
124 | ### Neo Coolcam
125 |
126 | Template sensor to fix a bug in some Neo wall plugs.
127 | The applied constant is the equivalent of 0x7FFFFFFF.
128 | Device precision is 2 decimals.
129 | The original sensosr is renamed to "...raw_energy"
130 | The template sensor then gets the old name.
131 |
132 | https://community.home-assistant.io/t/energy-consumption-for-neo-coolcam-plug/219844/26
133 |
134 | ## Dashboards
135 |
136 | ### Themes
137 |
138 | I only use themes from HACS. These are installed in the `themes` folder, but are never uploaded to this repo.
139 |
140 | ### Mushroom & Tile cards
141 |
142 | I really like [Mushroom](https://github.com/piitaya/lovelace-mushroom) and [Tile cards](https://www.home-assistant.io/dashboards/tile/). However, they do not (yet) have the flexibility of the entities card in combination with some custom cards.
143 |
144 | ### Custom cards
145 |
146 | I use several custom cards for displaying a nice and tailored dashboard. Among thise are:
147 |
148 | - [Mini Graph Card](https://github.com/kalkih/mini-graph-card)
149 | - [Mini Mediaplayer](https://github.com/kalkih/mini-media-player)
150 | - [Fold Entity Row](https://github.com/thomasloven/lovelace-fold-entity-row)
151 | - [Multiple Entity Row](https://github.com/benct/lovelace-multiple-entity-row)
152 | - [Template Entity Row](https://github.com/thomasloven/lovelace-template-entity-row)
153 |
154 | ## Tips & Tricks
155 |
156 | Editing your configuration
157 |
158 | - [Tracking your lovelace UI file](#tracking-your-lovelace-ui-file)
159 | - [Testing and debugging automations with automation editor](#testing-and-debugging-automations-with-automation-editor)
160 |
161 | Database
162 |
163 | - [Limit database growth](#limit-database-growth)
164 |
165 | ### Tracking your Lovelace UI file
166 |
167 | To start tracking the lovelace UI file `.storage/lovelace`, you need to force-add it to git:
168 |
169 | ```bash
170 | git add -f .storage/lovelace
171 | ```
172 |
173 | ### Testing and debugging automations with automation editor
174 |
175 | Using the automation editor is an easy way to test automations or to create temporary automations for debugging.
176 |
177 | To use the automation editor in combination with packages, there needs to be [a separate `automations.yaml` file in the root of the config directory](./automations.yaml), with a least one properly formatted automation. My config has a dummy automation to prevent that the configuration becomes invalid.
178 |
179 | ### Limit database growth
180 |
181 | To limit database growth, I limit [recording](https://home-assistant.io/components/recorder/) as much as possible and purge the database daily for values older than 3 days.
182 |
183 | ### Outside Brightness
184 |
185 | Use a template sensor to calculate outside brightness. This takes into account the sun elevation, cloudiness and radiation.
186 |
187 | https://community.home-assistant.io/t/virtual-light-sensor/31975/24
188 | https://en.wikipedia.org/wiki/Solar_irradiance#:~:text=Average%20annual%20solar%20radiation%20arriving,level%20on%20a%20clear%20day.
189 | https://gps-coordinates.org/coordinate-converter.php
190 | max elevation https://www.suncalc.org/#/40.1789,-3.5156,3/2022.09.13/17:15/1/3
191 |
192 | ## Maintenance
193 |
194 | For the maintenance of my configuration, I use these tools:
195 |
196 | - Visual Studio Code, with extensions:
197 | - Home Assistant Config Helper
198 | - YAML
199 | - markdownlint
200 | - UUID Generator
201 | - [yamllint][yamllint]
202 | - [pre-commit][pre-commit]
203 |
204 | To use yamllint with pre-commit, execute these commands:
205 |
206 | ```shell
207 | brew install yamllint
208 | brew install pre-commit
209 | pre-commit install
210 | ```
211 |
212 | ## Credits 🙏
213 |
214 | - [Frenck's yamllint action](https://github.com/frenck/action-yamllint)
215 | - [Frenck's home assistant configuration checker](https://github.com/frenck/action-home-assistant)
216 |
217 | ## Contributions
218 |
219 | If you have suggestions or improvements, please submit an issue or pull request.
220 |
221 | [check-badge]: https://github.com/metbril/home-assistant-config/workflows/Check%20configuration/badge.svg
222 | [check-log]: https://github.com/metbril/home-assistant-config/actions?query=workflow%3A%22Check+configuration%22
223 | [pre-commit]: https://pre-commit.com/
224 | [yamllint]: https://yamllint.readthedocs.io/en/stable/
225 | [mastodon-badge]: https://img.shields.io/mastodon/follow/109290308537002308?domain=https%3A%2F%2Fbotsin.space&style=flat
226 | [mastodon-link]: https://botsin.space/@DomusSapiens
227 | [blue]: https://www.home-assistant.io/blue
228 |
--------------------------------------------------------------------------------
/blueprints/automation/CentralCommand/get-notified-any-time-there-is-a-new-home-assistant-alert.yaml:
--------------------------------------------------------------------------------
1 | blueprint:
2 | name: Send Notification for Home Assistant Alert
3 | description: Send notification on your preferred channel when there is a new Home
4 | Assistant alert published
5 | domain: automation
6 | input:
7 | notifier:
8 | name: Notifier
9 | description: Name of integration you prefer to use for notifications (i.e. what
10 | comes after `notify.` in the service call). Defaults to `persistent_notification`
11 | default: persistent_notification
12 | title:
13 | name: Notification title
14 | description: Title of notification when there is an alert. Defaults to "New
15 | Home Assistant alert"
16 | default: New Home Assistant alert
17 | urls_supported:
18 | name: URLs are supported
19 | description: True if your notification platform supports clicking the notification
20 | to open a URL, false to just include the alert URL in the message body
21 | selector:
22 | boolean: {}
23 | default: false
24 | additional_data:
25 | name: Additional data for notification
26 | description: Additional data to include in service call if your notification
27 | platform has extended functionality. Will need to write as a JSON object (ex.
28 | `{"badge":"https://alerts.home-assistant.io/images/favicon.png", "priority":"high"}`)
29 | default: '{}'
30 | feed_url:
31 | name: Feed URL
32 | description: Used for testing automation by setting to a custom URL so you can
33 | create fake HA alerts and see it in action. Leave blank otherwise so it defaults
34 | to the normal HA alert feed
35 | default: https://alerts.home-assistant.io/feed.xml
36 | source_url: https://community.home-assistant.io/t/get-notified-any-time-there-is-a-new-home-assistant-alert/256924
37 | mode: parallel
38 | variables:
39 | notifier: !input 'notifier'
40 | urls_supported: !input 'urls_supported'
41 | additional_data: !input 'additional_data'
42 | trigger:
43 | platform: event
44 | event_type: feedreader
45 | event_data:
46 | feed_url: !input 'feed_url'
47 | action:
48 | - service: notify.{{ notifier }}
49 | data:
50 | title: !input 'title'
51 | message: '{{ trigger.event.data.title + ('''' if urls_supported else ''
52 |
53 | '' + trigger.event.data.link) }}'
54 | data: '{% set data = additional_data | from_json %}{% if urls_supported %}{{ dict(data,
55 | url=trigger.event.data.link) }}{% else %}{{ data }}{% endif %}'
56 |
--------------------------------------------------------------------------------
/blueprints/automation/EPMatt/ikea_e1744.yaml:
--------------------------------------------------------------------------------
1 | blueprint:
2 | name: Controller - IKEA E1744 SYMFONISK Rotary Remote
3 | description: "# Controller - IKEA E1744 SYMFONISK Rotary Remote\n\nController automation
4 | for executing any kind of action triggered by the provided IKEA E1744 SYMFONISK
5 | Rotary Remote. Allows to optionally loop a custom action during controller rotation.\nSupports
6 | deCONZ, ZHA, Zigbee2MQTT.\n\nAutomations created with this blueprint can be connected
7 | with one or more [Hooks](https://epmatt.github.io/awesome-ha-blueprints/docs/blueprints/hooks)
8 | supported by this controller.\nHooks allow to easily create controller-based automations
9 | for interacting with media players, lights, covers and more.\nSee the list of
10 | [Hooks available for this controller](https://epmatt.github.io/awesome-ha-blueprints/docs/blueprints/controllers/ikea_e1744#available-hooks)
11 | for additional details.\n\n\U0001F4D5 Full documentation regarding this blueprint
12 | is available [here](https://epmatt.github.io/awesome-ha-blueprints/docs/blueprints/controllers/ikea_e1744).\n\n\U0001F680
13 | This blueprint is part of the **[Awesome HA Blueprints](https://epmatt.github.io/awesome-ha-blueprints)
14 | project**.\n\nℹ️ Version 2022.08.08\n"
15 | source_url: https://github.com/EPMatt/awesome-ha-blueprints/blob/main/blueprints/controllers/ikea_e1744/ikea_e1744.yaml
16 | domain: automation
17 | input:
18 | integration:
19 | name: (Required) Integration
20 | description: Integration used for connecting the remote with Home Assistant.
21 | Select one of the available values.
22 | selector:
23 | select:
24 | options:
25 | - deCONZ
26 | - ZHA
27 | - Zigbee2MQTT
28 | custom_value: false
29 | multiple: false
30 | controller_device:
31 | name: (deCONZ, ZHA) Controller Device
32 | description: The controller device to use for the automation. Choose a value
33 | only if the remote is integrated with deCONZ, ZHA.
34 | default: ''
35 | selector:
36 | device: {}
37 | controller_entity:
38 | name: (Zigbee2MQTT) Controller Entity
39 | description: The action sensor of the controller to use for the automation.
40 | Choose a value only if the remote is integrated with Zigbee2MQTT.
41 | default: ''
42 | selector:
43 | entity:
44 | domain: sensor
45 | multiple: false
46 | helper_last_controller_event:
47 | name: (Required) Helper - Last Controller Event
48 | description: Input Text used to store the last event fired by the controller.
49 | You will need to manually create a text input entity for this, please read
50 | the blueprint Additional Notes for more info.
51 | default: ''
52 | selector:
53 | entity:
54 | domain: input_text
55 | multiple: false
56 | action_rotate_left:
57 | name: (Optional) Rotate left
58 | description: Action to run on rotate left.
59 | default: []
60 | selector:
61 | action: {}
62 | action_rotate_left_stop:
63 | name: (Optional) Rotate left stop
64 | description: Action to run when stopping to rotate left the remote.
65 | default: []
66 | selector:
67 | action: {}
68 | action_rotate_right:
69 | name: (Optional) Rotate right
70 | description: Action to run on rotate right.
71 | default: []
72 | selector:
73 | action: {}
74 | action_rotate_right_stop:
75 | name: (Optional) Rotate right stop
76 | description: Action to run when stopping to rotate right the remote.
77 | default: []
78 | selector:
79 | action: {}
80 | action_click_short:
81 | name: (Optional) Remote short press
82 | description: Action to run on short remote press.
83 | default: []
84 | selector:
85 | action: {}
86 | action_click_double:
87 | name: (Optional) Remote double press
88 | description: Action to run on double remote press.
89 | default: []
90 | selector:
91 | action: {}
92 | action_click_triple:
93 | name: (Optional) Remote triple press
94 | description: Action to run on triple remote press.
95 | default: []
96 | selector:
97 | action: {}
98 | rotate_left_loop:
99 | name: (Optional) Rotate left - loop until stop
100 | description: Loop the rotate left action until the rotation is stopped.
101 | default: false
102 | selector:
103 | boolean: {}
104 | rotate_left_max_loop_repeats:
105 | name: (Optional) Rotate left - Maximum loop repeats
106 | description: Maximum number of repeats for the custom action, when looping is
107 | enabled. Use it as a safety limit to prevent an endless loop in case the corresponding
108 | stop event is not received.
109 | default: 500
110 | selector:
111 | number:
112 | min: 1.0
113 | max: 5000.0
114 | mode: slider
115 | step: 1.0
116 | rotate_right_loop:
117 | name: (Optional) Rotate right - loop until stop
118 | description: Loop the rotate right action until the rotation is stopped.
119 | default: false
120 | selector:
121 | boolean: {}
122 | rotate_right_max_loop_repeats:
123 | name: (Optional) Rotate right - Maximum loop repeats
124 | description: Maximum number of repeats for the custom action, when looping is
125 | enabled. Use it as a safety limit to prevent an endless loop in case the corresponding
126 | stop event is not received.
127 | default: 500
128 | selector:
129 | number:
130 | min: 1.0
131 | max: 5000.0
132 | mode: slider
133 | step: 1.0
134 | helper_debounce_delay:
135 | name: (Optional) Helper - Debounce delay
136 | description: Delay used for debouncing RAW controller events, by default set
137 | to 0. A value of 0 disables the debouncing feature. Increase this value if
138 | you notice custom actions or linked Hooks running multiple times when interacting
139 | with the device. When the controller needs to be debounced, usually a value
140 | of 100 is enough to remove all duplicate events.
141 | default: 0
142 | selector:
143 | number:
144 | min: 0.0
145 | max: 1000.0
146 | unit_of_measurement: milliseconds
147 | mode: box
148 | step: 10.0
149 | variables:
150 | integration: !input integration
151 | rotate_left_loop: !input rotate_left_loop
152 | rotate_left_max_loop_repeats: !input rotate_left_max_loop_repeats
153 | rotate_right_loop: !input rotate_right_loop
154 | rotate_right_max_loop_repeats: !input rotate_right_max_loop_repeats
155 | helper_last_controller_event: !input helper_last_controller_event
156 | helper_debounce_delay: !input helper_debounce_delay
157 | integration_id: '{{ integration | lower }}'
158 | actions_mapping:
159 | deconz:
160 | rotate_left:
161 | - '3001'
162 | rotate_stop:
163 | - '3003'
164 | - '2003'
165 | rotate_right:
166 | - '2001'
167 | click_short:
168 | - '1002'
169 | click_double:
170 | - '1004'
171 | click_triple:
172 | - '1005'
173 | zha:
174 | rotate_left:
175 | - move_1_195
176 | rotate_stop:
177 | - stop
178 | rotate_right:
179 | - move_0_195
180 | click_short:
181 | - toggle
182 | click_double:
183 | - step_0_1_0
184 | click_triple:
185 | - step_1_1_0
186 | zigbee2mqtt:
187 | rotate_left:
188 | - brightness_move_down
189 | rotate_stop:
190 | - brightness_stop
191 | rotate_right:
192 | - brightness_move_up
193 | click_short:
194 | - toggle
195 | click_double:
196 | - brightness_step_up
197 | click_triple:
198 | - brightness_step_down
199 | rotate_left: '{{ actions_mapping[integration_id]["rotate_left"] }}'
200 | rotate_stop: '{{ actions_mapping[integration_id]["rotate_stop"] }}'
201 | rotate_right: '{{ actions_mapping[integration_id]["rotate_right"] }}'
202 | click_short: '{{ actions_mapping[integration_id]["click_short"] }}'
203 | click_double: '{{ actions_mapping[integration_id]["click_double"] }}'
204 | click_triple: '{{ actions_mapping[integration_id]["click_triple"] }}'
205 | controller_entity: !input controller_entity
206 | controller_device: !input controller_device
207 | controller_id: '{% if integration_id=="zigbee2mqtt" %}{{controller_entity}}{% else
208 | %}{{controller_device}}{% endif %}'
209 | mode: restart
210 | max_exceeded: silent
211 | trigger:
212 | - platform: event
213 | event_type: state_changed
214 | event_data:
215 | entity_id: !input controller_entity
216 | - platform: event
217 | event_type:
218 | - deconz_event
219 | - zha_event
220 | event_data:
221 | device_id: !input controller_device
222 | condition:
223 | - condition: and
224 | conditions:
225 | - '{%- set trigger_action -%} {%- if integration_id == "zigbee2mqtt" -%} {{ trigger.event.data.new_state.state
226 | }} {%- elif integration_id == "deconz" -%} {{ trigger.event.data.event }} {%-
227 | elif integration_id == "zha" -%} {{ trigger.event.data.command }}{{"_" if trigger.event.data.args|length
228 | > 0}}{{ trigger.event.data.args|join("_") }} {%- endif -%} {%- endset -%} {{ trigger_action
229 | not in ["","None"] }}'
230 | - '{{ integration_id != "zigbee2mqtt" or trigger.event.data.new_state.state != trigger.event.data.old_state.state
231 | }}'
232 | action:
233 | - delay:
234 | milliseconds: !input helper_debounce_delay
235 | - variables:
236 | trigger_action: '{%- if integration_id == "zigbee2mqtt" -%} {{ trigger.event.data.new_state.state
237 | }} {%- elif integration_id == "deconz" -%} {{ trigger.event.data.event }} {%-
238 | elif integration_id == "zha" -%} {{ trigger.event.data.command }}{{"_" if trigger.event.data.args|length
239 | > 0}}{{ trigger.event.data.args|join("_") }} {%- endif -%}'
240 | trigger_delta: '{{ (as_timestamp(now()) - ((states(helper_last_controller_event)
241 | | from_json).t if helper_last_controller_event is not none and (states(helper_last_controller_event)
242 | | regex_match("^\{((\"a\": \".*\"|\"t\": \d+\.\d+)(, )?){2}\}$")) else as_timestamp("1970-01-01
243 | 00:00:00"))) * 1000 }}'
244 | last_controller_event: '{{ (states(helper_last_controller_event) | from_json).a
245 | if helper_last_controller_event is not none and (states(helper_last_controller_event)
246 | | regex_match("^\{((\"a\": \".*\"|\"t\": \d+\.\d+)(, )?){2}\}$")) else "" }}'
247 | - service: input_text.set_value
248 | data:
249 | entity_id: !input helper_last_controller_event
250 | value: '{{ {"a":trigger_action,"t":as_timestamp(now())} | to_json }}'
251 | - choose:
252 | - conditions: '{{ trigger_action | string in rotate_left }}'
253 | sequence:
254 | - event: ahb_controller_event
255 | event_data:
256 | controller: '{{ controller_id }}'
257 | action: rotate_left
258 | - choose:
259 | - conditions: '{{ rotate_left_loop }}'
260 | sequence:
261 | - repeat:
262 | while: '{{ repeat.index < rotate_left_max_loop_repeats | int }}'
263 | sequence: !input action_rotate_left
264 | default: !input action_rotate_left
265 | - conditions:
266 | - '{{ trigger_action | string in rotate_stop }}'
267 | - '{{ last_controller_event | string in rotate_left }}'
268 | sequence:
269 | - event: ahb_controller_event
270 | event_data:
271 | controller: '{{ controller_id }}'
272 | action: rotate_left_stop
273 | - choose:
274 | - conditions: []
275 | sequence: !input action_rotate_left_stop
276 | - conditions: '{{ trigger_action | string in rotate_right }}'
277 | sequence:
278 | - event: ahb_controller_event
279 | event_data:
280 | controller: '{{ controller_id }}'
281 | action: rotate_right
282 | - choose:
283 | - conditions: '{{ rotate_right_loop }}'
284 | sequence:
285 | - repeat:
286 | while: '{{ repeat.index < rotate_right_max_loop_repeats | int }}'
287 | sequence: !input action_rotate_right
288 | default: !input action_rotate_right
289 | - conditions:
290 | - '{{ trigger_action | string in rotate_stop }}'
291 | - '{{ last_controller_event | string in rotate_right }}'
292 | sequence:
293 | - event: ahb_controller_event
294 | event_data:
295 | controller: '{{ controller_id }}'
296 | action: rotate_right_stop
297 | - choose:
298 | - conditions: []
299 | sequence: !input action_rotate_right_stop
300 | - conditions: '{{ trigger_action | string in click_short }}'
301 | sequence:
302 | - event: ahb_controller_event
303 | event_data:
304 | controller: '{{ controller_id }}'
305 | action: click_short
306 | - choose:
307 | - conditions: []
308 | sequence: !input action_click_short
309 | - conditions: '{{ trigger_action | string in click_double }}'
310 | sequence:
311 | - event: ahb_controller_event
312 | event_data:
313 | controller: '{{ controller_id }}'
314 | action: click_double
315 | - choose:
316 | - conditions: []
317 | sequence: !input action_click_double
318 | - conditions: '{{ trigger_action | string in click_triple }}'
319 | sequence:
320 | - event: ahb_controller_event
321 | event_data:
322 | controller: '{{ controller_id }}'
323 | action: click_triple
324 | - choose:
325 | - conditions: []
326 | sequence: !input action_click_triple
327 |
--------------------------------------------------------------------------------
/blueprints/automation/EPMatt/ikea_e1812.yaml:
--------------------------------------------------------------------------------
1 | blueprint:
2 | name: Controller - IKEA E1812 TRÅDFRI Shortcut button
3 | description: "# Controller - IKEA E1812 TRÅDFRI Shortcut button\n\nController automation
4 | for executing any kind of action triggered by the provided IKEA E1812 TRÅDFRI
5 | Shortcut button. Allows to optionally loop an action on a button long press.\nSupports
6 | deCONZ, ZHA, Zigbee2MQTT.\n\nAutomations created with this blueprint can be connected
7 | with one or more [Hooks](https://epmatt.github.io/awesome-ha-blueprints/docs/blueprints/hooks)
8 | supported by this controller.\nHooks allow to easily create controller-based automations
9 | for interacting with media players, lights, covers and more.\nSee the list of
10 | [Hooks available for this controller](https://epmatt.github.io/awesome-ha-blueprints/docs/blueprints/controllers/ikea_e1812#available-hooks)
11 | for additional details.\n\n\U0001F4D5 Full documentation regarding this blueprint
12 | is available [here](https://epmatt.github.io/awesome-ha-blueprints/docs/blueprints/controllers/ikea_e1812).\n\n\U0001F680
13 | This blueprint is part of the **[Awesome HA Blueprints](https://epmatt.github.io/awesome-ha-blueprints)
14 | project**.\n\nℹ️ Version 2022.08.08\n"
15 | source_url: https://github.com/EPMatt/awesome-ha-blueprints/blob/main/blueprints/controllers/ikea_e1812/ikea_e1812.yaml
16 | domain: automation
17 | input:
18 | integration:
19 | name: (Required) Integration
20 | description: Integration used for connecting the remote with Home Assistant.
21 | Select one of the available values.
22 | selector:
23 | select:
24 | options:
25 | - deCONZ
26 | - ZHA
27 | - Zigbee2MQTT
28 | custom_value: false
29 | multiple: false
30 | controller_device:
31 | name: (deCONZ, ZHA) Controller Device
32 | description: The controller device to use for the automation. Choose a value
33 | only if the remote is integrated with deCONZ, ZHA.
34 | default: ''
35 | selector:
36 | device: {}
37 | controller_entity:
38 | name: (Zigbee2MQTT) Controller Entity
39 | description: The action sensor of the controller to use for the automation.
40 | Choose a value only if the remote is integrated with Zigbee2MQTT.
41 | default: ''
42 | selector:
43 | entity:
44 | domain: sensor
45 | multiple: false
46 | helper_last_controller_event:
47 | name: (Required) Helper - Last Controller Event
48 | description: Input Text used to store the last event fired by the controller.
49 | You will need to manually create a text input entity for this, please read
50 | the blueprint Additional Notes for more info.
51 | default: ''
52 | selector:
53 | entity:
54 | domain: input_text
55 | multiple: false
56 | action_button_short:
57 | name: (Optional) Button short press
58 | description: Action to run on short button press.
59 | default: []
60 | selector:
61 | action: {}
62 | action_button_long:
63 | name: (Optional) Button long press
64 | description: Action to run on long button press.
65 | default: []
66 | selector:
67 | action: {}
68 | action_button_release:
69 | name: (Optional) Button release
70 | description: Action to run on button release after long press.
71 | default: []
72 | selector:
73 | action: {}
74 | action_button_double:
75 | name: (Optional) Button double press
76 | description: Action to run on double button press.
77 | default: []
78 | selector:
79 | action: {}
80 | button_long_loop:
81 | name: (Optional) Button long press - loop until release
82 | description: Loop the button action until the button is released.
83 | default: false
84 | selector:
85 | boolean: {}
86 | button_long_max_loop_repeats:
87 | name: (Optional) Button long press - Maximum loop repeats
88 | description: Maximum number of repeats for the custom action, when looping is
89 | enabled. Use it as a safety limit to prevent an endless loop in case the corresponding
90 | stop event is not received.
91 | default: 500
92 | selector:
93 | number:
94 | min: 1.0
95 | max: 5000.0
96 | mode: slider
97 | step: 1.0
98 | button_double_press:
99 | name: (Optional) Expose button double press event
100 | description: Choose whether or not to expose the virtual double press event
101 | for the button. Turn this on if you are providing an action for the button
102 | double press event.
103 | default: false
104 | selector:
105 | boolean: {}
106 | helper_double_press_delay:
107 | name: (Optional) Helper - Double Press delay
108 | description: Max delay between the first and the second button press for the
109 | double press event. Provide a value only if you are using a double press action.
110 | Increase this value if you notice that the double press action is not triggered
111 | properly.
112 | default: 500
113 | selector:
114 | number:
115 | min: 100.0
116 | max: 5000.0
117 | unit_of_measurement: milliseconds
118 | mode: box
119 | step: 10.0
120 | helper_debounce_delay:
121 | name: (Optional) Helper - Debounce delay
122 | description: Delay used for debouncing RAW controller events, by default set
123 | to 0. A value of 0 disables the debouncing feature. Increase this value if
124 | you notice custom actions or linked Hooks running multiple times when interacting
125 | with the device. When the controller needs to be debounced, usually a value
126 | of 100 is enough to remove all duplicate events.
127 | default: 0
128 | selector:
129 | number:
130 | min: 0.0
131 | max: 1000.0
132 | unit_of_measurement: milliseconds
133 | mode: box
134 | step: 10.0
135 | variables:
136 | integration: !input integration
137 | button_long_loop: !input button_long_loop
138 | button_long_max_loop_repeats: !input button_long_max_loop_repeats
139 | button_double_press: !input button_double_press
140 | helper_last_controller_event: !input helper_last_controller_event
141 | helper_double_press_delay: !input helper_double_press_delay
142 | helper_debounce_delay: !input helper_debounce_delay
143 | integration_id: '{{ integration | lower }}'
144 | adjusted_double_press_delay: '{{ [helper_double_press_delay - helper_debounce_delay,
145 | 100] | max }}'
146 | actions_mapping:
147 | deconz:
148 | button_short:
149 | - '1002'
150 | button_long:
151 | - '1001'
152 | button_release:
153 | - '1003'
154 | zha:
155 | button_short:
156 | - 'on'
157 | button_long:
158 | - move_with_on_off_0_83
159 | button_release:
160 | - stop
161 | zigbee2mqtt:
162 | button_short:
163 | - 'on'
164 | button_long:
165 | - brightness_move_up
166 | button_release:
167 | - brightness_stop
168 | button_short: '{{ actions_mapping[integration_id]["button_short"] }}'
169 | button_long: '{{ actions_mapping[integration_id]["button_long"] }}'
170 | button_release: '{{ actions_mapping[integration_id]["button_release"] }}'
171 | controller_entity: !input controller_entity
172 | controller_device: !input controller_device
173 | controller_id: '{% if integration_id=="zigbee2mqtt" %}{{controller_entity}}{% else
174 | %}{{controller_device}}{% endif %}'
175 | mode: restart
176 | max_exceeded: silent
177 | trigger:
178 | - platform: event
179 | event_type: state_changed
180 | event_data:
181 | entity_id: !input controller_entity
182 | - platform: event
183 | event_type:
184 | - deconz_event
185 | - zha_event
186 | event_data:
187 | device_id: !input controller_device
188 | condition:
189 | - condition: and
190 | conditions:
191 | - '{%- set trigger_action -%} {%- if integration_id == "zigbee2mqtt" -%} {{ trigger.event.data.new_state.state
192 | }} {%- elif integration_id == "deconz" -%} {{ trigger.event.data.event }} {%-
193 | elif integration_id == "zha" -%} {{ trigger.event.data.command }}{{"_" if trigger.event.data.args|length
194 | > 0}}{{ trigger.event.data.args|join("_") }} {%- endif -%} {%- endset -%} {{ trigger_action
195 | not in ["","None"] }}'
196 | - '{{ integration_id != "zigbee2mqtt" or trigger.event.data.new_state.state != trigger.event.data.old_state.state
197 | }}'
198 | action:
199 | - delay:
200 | milliseconds: !input helper_debounce_delay
201 | - variables:
202 | trigger_action: '{%- if integration_id == "zigbee2mqtt" -%} {{ trigger.event.data.new_state.state
203 | }} {%- elif integration_id == "deconz" -%} {{ trigger.event.data.event }} {%-
204 | elif integration_id == "zha" -%} {{ trigger.event.data.command }}{{"_" if trigger.event.data.args|length
205 | > 0}}{{ trigger.event.data.args|join("_") }} {%- endif -%}'
206 | trigger_delta: '{{ (as_timestamp(now()) - ((states(helper_last_controller_event)
207 | | from_json).t if helper_last_controller_event is not none and (states(helper_last_controller_event)
208 | | regex_match("^\{((\"a\": \".*\"|\"t\": \d+\.\d+)(, )?){2}\}$")) else as_timestamp("1970-01-01
209 | 00:00:00"))) * 1000 }}'
210 | - service: input_text.set_value
211 | data:
212 | entity_id: !input helper_last_controller_event
213 | value: '{{ {"a":trigger_action,"t":as_timestamp(now())} | to_json }}'
214 | - choose:
215 | - conditions: '{{ trigger_action | string in button_short }}'
216 | sequence:
217 | - choose:
218 | - conditions: '{{ button_double_press }}'
219 | sequence:
220 | - choose:
221 | - conditions: '{{ trigger_action | string in states(helper_last_controller_event)
222 | and trigger_delta | int <= helper_double_press_delay | int }}'
223 | sequence:
224 | - service: input_text.set_value
225 | data:
226 | entity_id: !input helper_last_controller_event
227 | value: '{{ {"a":"double_press","t":as_timestamp(now())} | to_json
228 | }}'
229 | - event: ahb_controller_event
230 | event_data:
231 | controller: '{{ controller_id }}'
232 | action: button_double
233 | - choose:
234 | - conditions: []
235 | sequence: !input action_button_double
236 | default:
237 | - delay:
238 | milliseconds: '{{ adjusted_double_press_delay }}'
239 | - event: ahb_controller_event
240 | event_data:
241 | controller: '{{ controller_id }}'
242 | action: button_short
243 | - choose:
244 | - conditions: []
245 | sequence: !input action_button_short
246 | default:
247 | - event: ahb_controller_event
248 | event_data:
249 | controller: '{{ controller_id }}'
250 | action: button_short
251 | - choose:
252 | - conditions: []
253 | sequence: !input action_button_short
254 | - conditions: '{{ trigger_action | string in button_long }}'
255 | sequence:
256 | - event: ahb_controller_event
257 | event_data:
258 | controller: '{{ controller_id }}'
259 | action: button_long
260 | - choose:
261 | - conditions: '{{ button_long_loop }}'
262 | sequence:
263 | - repeat:
264 | while: '{{ repeat.index < button_long_max_loop_repeats | int }}'
265 | sequence: !input action_button_long
266 | default: !input action_button_long
267 | - conditions: '{{ trigger_action | string in button_release }}'
268 | sequence:
269 | - event: ahb_controller_event
270 | event_data:
271 | controller: '{{ controller_id }}'
272 | action: button_release
273 | - choose:
274 | - conditions: []
275 | sequence: !input action_button_release
276 |
--------------------------------------------------------------------------------
/blueprints/automation/EPMatt/persistent_notification_to_mobile.yaml:
--------------------------------------------------------------------------------
1 | blueprint:
2 | name: Send Web UI persistent notifications to Mobile Devices
3 | description: "# Send Web UI persistent notifications to Mobile Devices\n\nSend Web
4 | UI persistent notifications with the provided ID to the specified Mobile Devices.\n\n\U0001F4D5
5 | Full documentation regarding this blueprint is available [here](https://epmatt.github.io/awesome-ha-blueprints/docs/blueprints/automation/persistent_notification_to_mobile).\n\n\U0001F680
6 | This blueprint is part of the **[Awesome HA Blueprints](https://epmatt.github.io/awesome-ha-blueprints)
7 | project**.\n\nℹ️ Version 2021.10.26\n"
8 | source_url: https://github.com/EPMatt/awesome-ha-blueprints/blob/main/blueprints/automation/persistent_notification_to_mobile/persistent_notification_to_mobile.yaml
9 | domain: automation
10 | input:
11 | notification_id:
12 | name: (Optional) Notification ID
13 | description: The notification ID of persistent notifications which must be sent
14 | to mobile devices. Empty for all notifications.
15 | default: ''
16 | selector:
17 | text: {}
18 | mobile_notify_service:
19 | name: (Required) Mobile devices notification service
20 | description: The notification service for mobile devices (eg. service.mobile_app_).
21 | You can provide both a notify group or a single notify device here.
22 | selector:
23 | text: {}
24 | replace_notifications:
25 | name: (Optional) Replace notifications with same ID
26 | description: Replace existing notifications with the same notification ID.
27 | default: false
28 | selector:
29 | boolean: {}
30 | android_notification_channel:
31 | name: (Optional) (Android only) Notification channel
32 | description: Android notification channel. Allows to group notifications to
33 | then apply custom settings for sound, vibration, etc. Leave blank if you do
34 | not want to use this feature.
35 | default: ''
36 | selector:
37 | text: {}
38 | notification_group:
39 | name: (Optional) Notification group
40 | description: Notification group for the notifications sent with this automation.
41 | Use this to group notifications in the notification tray. Leave blank if you
42 | do not want to use this feature.
43 | default: ''
44 | selector:
45 | text: {}
46 | variables:
47 | notification_id: !input notification_id
48 | replace_notifications: !input replace_notifications
49 | mode: queued
50 | max: 10
51 | max_exceeded: silent
52 | trigger:
53 | platform: event
54 | event_type: call_service
55 | event_data:
56 | domain: persistent_notification
57 | service: create
58 | condition:
59 | condition: template
60 | value_template: '{{ trigger.event.data.service_data.notification_id == notification_id
61 | or notification_id == "" }}'
62 | action:
63 | - service: !input mobile_notify_service
64 | data:
65 | title: '{{ trigger.event.data.service_data.title }}'
66 | message: '{{ trigger.event.data.service_data.message }}'
67 | data:
68 | tag: '{{ trigger.event.data.service_data.notification_id if replace_notifications
69 | else "" }}'
70 | group: !input notification_group
71 | channel: !input android_notification_channel
72 | push:
73 | thread-id: !input notification_group
74 | apns_headers:
75 | apns-collapse-id: '{{ trigger.event.data.service_data.notification_id if replace_notifications
76 | else "" }}'
77 |
--------------------------------------------------------------------------------
/blueprints/automation/EPMatt/philips_324131092621.yaml:
--------------------------------------------------------------------------------
1 | blueprint:
2 | name: Controller - Philips 324131092621 Hue Dimmer switch
3 | description: "# Controller - Philips 324131092621 Hue Dimmer switch\n\nController
4 | automation for executing any kind of action triggered by the provided Philips
5 | 324131092621 Hue Dimmer switch. Allows to optionally loop an action on a button
6 | long press.\nSupports deCONZ, ZHA, Zigbee2MQTT.\n\nAutomations created with this
7 | blueprint can be connected with one or more [Hooks](https://epmatt.github.io/awesome-ha-blueprints/docs/blueprints/hooks)
8 | supported by this controller.\nHooks allow to easily create controller-based automations
9 | for interacting with media players, lights, covers and more.\nSee the list of
10 | [Hooks available for this controller](https://epmatt.github.io/awesome-ha-blueprints/docs/blueprints/controllers/philips_324131092621#available-hooks)
11 | for additional details.\n\n\U0001F4D5 Full documentation regarding this blueprint
12 | is available [here](https://epmatt.github.io/awesome-ha-blueprints/docs/blueprints/controllers/philips_324131092621).\n\n\U0001F680
13 | This blueprint is part of the **[Awesome HA Blueprints](https://epmatt.github.io/awesome-ha-blueprints)
14 | project**.\n\nℹ️ Version 2022.08.08\n"
15 | source_url: https://github.com/EPMatt/awesome-ha-blueprints/blob/main/blueprints/controllers/philips_324131092621/philips_324131092621.yaml
16 | domain: automation
17 | input:
18 | integration:
19 | name: (Required) Integration
20 | description: Integration used for connecting the remote with Home Assistant.
21 | Select one of the available values.
22 | selector:
23 | select:
24 | options:
25 | - deCONZ
26 | - ZHA
27 | - Zigbee2MQTT
28 | custom_value: false
29 | multiple: false
30 | sort: false
31 | controller_device:
32 | name: (deCONZ, ZHA) Controller Device
33 | description: The controller device to use for the automation. Choose a value
34 | only if the remote is integrated with deCONZ, ZHA.
35 | default: ''
36 | selector:
37 | device: {}
38 | controller_entity:
39 | name: (Zigbee2MQTT) Controller Entity
40 | description: The action sensor of the controller to use for the automation.
41 | Choose a value only if the remote is integrated with Zigbee2MQTT.
42 | default: ''
43 | selector:
44 | entity:
45 | domain:
46 | - sensor
47 | multiple: false
48 | helper_last_controller_event:
49 | name: (Required) Helper - Last Controller Event
50 | description: Input Text used to store the last event fired by the controller.
51 | You will need to manually create a text input entity for this, please read
52 | the blueprint Additional Notes for more info.
53 | default: ''
54 | selector:
55 | entity:
56 | domain:
57 | - input_text
58 | multiple: false
59 | action_button_on_short:
60 | name: (Optional) On button short press
61 | description: Action to run on short on button press.
62 | default: []
63 | selector:
64 | action: {}
65 | action_button_on_long:
66 | name: (Optional) On button long press
67 | description: Action to run on long on button press.
68 | default: []
69 | selector:
70 | action: {}
71 | action_button_on_release:
72 | name: (Optional) On button release
73 | description: Action to run on on button release after long press.
74 | default: []
75 | selector:
76 | action: {}
77 | action_button_on_double:
78 | name: (Optional) On button double press
79 | description: Action to run on double on button press.
80 | default: []
81 | selector:
82 | action: {}
83 | action_button_off_short:
84 | name: (Optional) Off button short press
85 | description: Action to run on short off button press.
86 | default: []
87 | selector:
88 | action: {}
89 | action_button_off_long:
90 | name: (Optional) Off button long press
91 | description: Action to run on long off button press.
92 | default: []
93 | selector:
94 | action: {}
95 | action_button_off_release:
96 | name: (Optional) Off button release
97 | description: Action to run on off button release after long press.
98 | default: []
99 | selector:
100 | action: {}
101 | action_button_off_double:
102 | name: (Optional) Off button double press
103 | description: Action to run on double off button press.
104 | default: []
105 | selector:
106 | action: {}
107 | action_button_up_short:
108 | name: (Optional) Up button short press
109 | description: Action to run on short up button press.
110 | default: []
111 | selector:
112 | action: {}
113 | action_button_up_long:
114 | name: (Optional) Up button long press
115 | description: Action to run on long up button press.
116 | default: []
117 | selector:
118 | action: {}
119 | action_button_up_release:
120 | name: (Optional) Up button release
121 | description: Action to run on up button release after long press.
122 | default: []
123 | selector:
124 | action: {}
125 | action_button_up_double:
126 | name: (Optional) Up button double press
127 | description: Action to run on double up button press.
128 | default: []
129 | selector:
130 | action: {}
131 | action_button_down_short:
132 | name: (Optional) Down button short press
133 | description: Action to run on short down button press.
134 | default: []
135 | selector:
136 | action: {}
137 | action_button_down_long:
138 | name: (Optional) Down button long press
139 | description: Action to run on long down button press.
140 | default: []
141 | selector:
142 | action: {}
143 | action_button_down_release:
144 | name: (Optional) Down button release
145 | description: Action to run on down button release after long press.
146 | default: []
147 | selector:
148 | action: {}
149 | action_button_down_double:
150 | name: (Optional) Down button double press
151 | description: Action to run on double down button press.
152 | default: []
153 | selector:
154 | action: {}
155 | button_on_long_loop:
156 | name: (Optional) On button long press - loop until release
157 | description: Loop the on button action until the button is released.
158 | default: false
159 | selector:
160 | boolean: {}
161 | button_on_long_max_loop_repeats:
162 | name: (Optional) On button long press - Maximum loop repeats
163 | description: Maximum number of repeats for the custom action, when looping is
164 | enabled. Use it as a safety limit to prevent an endless loop in case the corresponding
165 | stop event is not received.
166 | default: 500
167 | selector:
168 | number:
169 | min: 1.0
170 | max: 5000.0
171 | mode: slider
172 | step: 1.0
173 | button_off_long_loop:
174 | name: (Optional) Off button long press - loop until release
175 | description: Loop the off button action until the button is released.
176 | default: false
177 | selector:
178 | boolean: {}
179 | button_off_long_max_loop_repeats:
180 | name: (Optional) Off button long press - Maximum loop repeats
181 | description: Maximum number of repeats for the custom action, when looping is
182 | enabled. Use it as a safety limit to prevent an endless loop in case the corresponding
183 | stop event is not received.
184 | default: 500
185 | selector:
186 | number:
187 | min: 1.0
188 | max: 5000.0
189 | mode: slider
190 | step: 1.0
191 | button_up_long_loop:
192 | name: (Optional) Up button long press - loop until release
193 | description: Loop the up button action until the button is released.
194 | default: false
195 | selector:
196 | boolean: {}
197 | button_up_long_max_loop_repeats:
198 | name: (Optional) Up button long press - Maximum loop repeats
199 | description: Maximum number of repeats for the custom action, when looping is
200 | enabled. Use it as a safety limit to prevent an endless loop in case the corresponding
201 | stop event is not received.
202 | default: 500
203 | selector:
204 | number:
205 | min: 1.0
206 | max: 5000.0
207 | mode: slider
208 | step: 1.0
209 | button_down_long_loop:
210 | name: (Optional) Down button long press - loop until release
211 | description: Loop the down button action until the button is released.
212 | default: false
213 | selector:
214 | boolean: {}
215 | button_down_long_max_loop_repeats:
216 | name: (Optional) Down button long press - Maximum loop repeats
217 | description: Maximum number of repeats for the custom action, when looping is
218 | enabled. Use it as a safety limit to prevent an endless loop in case the corresponding
219 | stop event is not received.
220 | default: 500
221 | selector:
222 | number:
223 | min: 1.0
224 | max: 5000.0
225 | mode: slider
226 | step: 1.0
227 | button_on_double_press:
228 | name: (Optional) Expose on button double press event
229 | description: Choose whether or not to expose the virtual double press event
230 | for the on button. Turn this on if you are providing an action for the on
231 | button double press event.
232 | default: false
233 | selector:
234 | boolean: {}
235 | button_off_double_press:
236 | name: (Optional) Expose off button double press event
237 | description: Choose whether or not to expose the virtual double press event
238 | for the off button. Turn this on if you are providing an action for the off
239 | button double press event.
240 | default: false
241 | selector:
242 | boolean: {}
243 | button_up_double_press:
244 | name: (Optional) Expose up button double press event
245 | description: Choose whether or not to expose the virtual double press event
246 | for the up button. Turn this on if you are providing an action for the up
247 | button double press event.
248 | default: false
249 | selector:
250 | boolean: {}
251 | button_down_double_press:
252 | name: (Optional) Expose down button double press event
253 | description: Choose whether or not to expose the virtual double press event
254 | for the down button. Turn this on if you are providing an action for the down
255 | button double press event.
256 | default: false
257 | selector:
258 | boolean: {}
259 | helper_double_press_delay:
260 | name: (Optional) Helper - Double Press delay
261 | description: Max delay between the first and the second button press for the
262 | double press event. Provide a value only if you are using a double press action.
263 | Increase this value if you notice that the double press action is not triggered
264 | properly.
265 | default: 500
266 | selector:
267 | number:
268 | min: 100.0
269 | max: 5000.0
270 | unit_of_measurement: milliseconds
271 | mode: box
272 | step: 10.0
273 | helper_debounce_delay:
274 | name: (Optional) Helper - Debounce delay
275 | description: Delay used for debouncing RAW controller events, by default set
276 | to 0. A value of 0 disables the debouncing feature. Increase this value if
277 | you notice custom actions or linked Hooks running multiple times when interacting
278 | with the device. When the controller needs to be debounced, usually a value
279 | of 100 is enough to remove all duplicate events.
280 | default: 0
281 | selector:
282 | number:
283 | min: 0.0
284 | max: 1000.0
285 | unit_of_measurement: milliseconds
286 | mode: box
287 | step: 10.0
288 | variables:
289 | integration: !input integration
290 | button_on_long_loop: !input button_on_long_loop
291 | button_on_long_max_loop_repeats: !input button_on_long_max_loop_repeats
292 | button_on_double_press: !input button_on_double_press
293 | button_off_long_loop: !input button_off_long_loop
294 | button_off_long_max_loop_repeats: !input button_off_long_max_loop_repeats
295 | button_off_double_press: !input button_off_double_press
296 | button_up_long_loop: !input button_up_long_loop
297 | button_up_long_max_loop_repeats: !input button_up_long_max_loop_repeats
298 | button_up_double_press: !input button_up_double_press
299 | button_down_long_loop: !input button_down_long_loop
300 | button_down_long_max_loop_repeats: !input button_down_long_max_loop_repeats
301 | button_down_double_press: !input button_down_double_press
302 | helper_last_controller_event: !input helper_last_controller_event
303 | helper_double_press_delay: !input helper_double_press_delay
304 | helper_debounce_delay: !input helper_debounce_delay
305 | integration_id: '{{ integration | lower }}'
306 | adjusted_double_press_delay: '{{ [helper_double_press_delay - helper_debounce_delay,
307 | 100] | max }}'
308 | actions_mapping:
309 | deconz:
310 | button_on_short:
311 | - '1000'
312 | button_on_long:
313 | - '1001'
314 | button_on_release:
315 | - '1003'
316 | button_off_short:
317 | - '4000'
318 | button_off_long:
319 | - '4001'
320 | button_off_release:
321 | - '4003'
322 | button_up_short:
323 | - '2000'
324 | button_up_long:
325 | - '2001'
326 | button_up_release:
327 | - '2003'
328 | button_down_short:
329 | - '3000'
330 | button_down_long:
331 | - '3001'
332 | button_down_release:
333 | - '3003'
334 | zha:
335 | button_on_short:
336 | - on_short_release
337 | button_on_long:
338 | - on_hold
339 | button_on_release:
340 | - on_long_release
341 | button_off_short:
342 | - off_short_release
343 | button_off_long:
344 | - off_hold
345 | button_off_release:
346 | - off_long_release
347 | button_up_short:
348 | - up_short_release
349 | button_up_long:
350 | - up_hold
351 | button_up_release:
352 | - up_long_release
353 | button_down_short:
354 | - down_short_release
355 | button_down_long:
356 | - down_hold
357 | button_down_release:
358 | - down_long_release
359 | zigbee2mqtt:
360 | button_on_short:
361 | - on-press
362 | button_on_long:
363 | - on-hold
364 | button_on_release:
365 | - on-hold-release
366 | button_off_short:
367 | - off-press
368 | button_off_long:
369 | - off-hold
370 | button_off_release:
371 | - off-hold-release
372 | button_up_short:
373 | - up-press
374 | button_up_long:
375 | - up-hold
376 | button_up_release:
377 | - up-hold-release
378 | button_down_short:
379 | - down-press
380 | button_down_long:
381 | - down-hold
382 | button_down_release:
383 | - down-hold-release
384 | button_on_short: '{{ actions_mapping[integration_id]["button_on_short"] }}'
385 | button_on_long: '{{ actions_mapping[integration_id]["button_on_long"] }}'
386 | button_on_release: '{{ actions_mapping[integration_id]["button_on_release"] }}'
387 | button_off_short: '{{ actions_mapping[integration_id]["button_off_short"] }}'
388 | button_off_long: '{{ actions_mapping[integration_id]["button_off_long"] }}'
389 | button_off_release: '{{ actions_mapping[integration_id]["button_off_release"] }}'
390 | button_up_short: '{{ actions_mapping[integration_id]["button_up_short"] }}'
391 | button_up_long: '{{ actions_mapping[integration_id]["button_up_long"] }}'
392 | button_up_release: '{{ actions_mapping[integration_id]["button_up_release"] }}'
393 | button_down_short: '{{ actions_mapping[integration_id]["button_down_short"] }}'
394 | button_down_long: '{{ actions_mapping[integration_id]["button_down_long"] }}'
395 | button_down_release: '{{ actions_mapping[integration_id]["button_down_release"]
396 | }}'
397 | controller_entity: !input controller_entity
398 | controller_device: !input controller_device
399 | controller_id: '{% if integration_id=="zigbee2mqtt" %}{{controller_entity}}{% else
400 | %}{{controller_device}}{% endif %}'
401 | mode: restart
402 | max_exceeded: silent
403 | trigger:
404 | - platform: event
405 | event_type: state_changed
406 | event_data:
407 | entity_id: !input controller_entity
408 | - platform: event
409 | event_type:
410 | - deconz_event
411 | - zha_event
412 | event_data:
413 | device_id: !input controller_device
414 | condition:
415 | - condition: and
416 | conditions:
417 | - '{%- set trigger_action -%} {%- if integration_id == "zigbee2mqtt" -%} {{ trigger.event.data.new_state.state
418 | }} {%- elif integration_id == "deconz" -%} {{ trigger.event.data.event }} {%-
419 | elif integration_id == "zha" -%} {{ trigger.event.data.command }} {%- endif -%}
420 | {%- endset -%} {{ trigger_action not in ["","None"] }}'
421 | - '{{ integration_id != "zigbee2mqtt" or trigger.event.data.new_state.state != trigger.event.data.old_state.state
422 | }}'
423 | action:
424 | - delay:
425 | milliseconds: !input helper_debounce_delay
426 | - variables:
427 | trigger_action: '{%- if integration_id == "zigbee2mqtt" -%} {{ trigger.event.data.new_state.state
428 | }} {%- elif integration_id == "deconz" -%} {{ trigger.event.data.event }} {%-
429 | elif integration_id == "zha" -%} {{ trigger.event.data.command }} {%- endif
430 | -%}'
431 | trigger_delta: '{{ (as_timestamp(now()) - ((states(helper_last_controller_event)
432 | | from_json).t if helper_last_controller_event is not none and (states(helper_last_controller_event)
433 | | regex_match("^\{((\"a\": \".*\"|\"t\": \d+\.\d+)(, )?){2}\}$")) else as_timestamp("1970-01-01
434 | 00:00:00"))) * 1000 }}'
435 | - service: input_text.set_value
436 | data:
437 | entity_id: !input helper_last_controller_event
438 | value: '{{ {"a":trigger_action,"t":as_timestamp(now())} | to_json }}'
439 | - choose:
440 | - conditions: '{{ trigger_action | string in button_on_short }}'
441 | sequence:
442 | - choose:
443 | - conditions: '{{ button_on_double_press }}'
444 | sequence:
445 | - choose:
446 | - conditions: '{{ trigger_action | string in states(helper_last_controller_event)
447 | and trigger_delta | int <= helper_double_press_delay | int }}'
448 | sequence:
449 | - service: input_text.set_value
450 | data:
451 | entity_id: !input helper_last_controller_event
452 | value: '{{ {"a":"double_press","t":as_timestamp(now())} | to_json
453 | }}'
454 | - event: ahb_controller_event
455 | event_data:
456 | controller: '{{ controller_id }}'
457 | action: button_on_double
458 | - choose:
459 | - conditions: []
460 | sequence: !input action_button_on_double
461 | default:
462 | - delay:
463 | milliseconds: '{{ adjusted_double_press_delay }}'
464 | - event: ahb_controller_event
465 | event_data:
466 | controller: '{{ controller_id }}'
467 | action: button_on_short
468 | - choose:
469 | - conditions: []
470 | sequence: !input action_button_on_short
471 | default:
472 | - event: ahb_controller_event
473 | event_data:
474 | controller: '{{ controller_id }}'
475 | action: button_on_short
476 | - choose:
477 | - conditions: []
478 | sequence: !input action_button_on_short
479 | - conditions: '{{ trigger_action | string in button_on_long }}'
480 | sequence:
481 | - event: ahb_controller_event
482 | event_data:
483 | controller: '{{ controller_id }}'
484 | action: button_on_long
485 | - choose:
486 | - conditions: '{{ button_on_long_loop }}'
487 | sequence:
488 | - repeat:
489 | while: '{{ repeat.index < button_on_long_max_loop_repeats | int }}'
490 | sequence: !input action_button_on_long
491 | default: !input action_button_on_long
492 | - conditions: '{{ trigger_action | string in button_on_release }}'
493 | sequence:
494 | - event: ahb_controller_event
495 | event_data:
496 | controller: '{{ controller_id }}'
497 | action: button_on_release
498 | - choose:
499 | - conditions: []
500 | sequence: !input action_button_on_release
501 | - conditions: '{{ trigger_action | string in button_off_short }}'
502 | sequence:
503 | - choose:
504 | - conditions: '{{ button_off_double_press }}'
505 | sequence:
506 | - choose:
507 | - conditions: '{{ trigger_action | string in states(helper_last_controller_event)
508 | and trigger_delta | int <= helper_double_press_delay | int }}'
509 | sequence:
510 | - service: input_text.set_value
511 | data:
512 | entity_id: !input helper_last_controller_event
513 | value: '{{ {"a":"double_press","t":as_timestamp(now())} | to_json
514 | }}'
515 | - event: ahb_controller_event
516 | event_data:
517 | controller: '{{ controller_id }}'
518 | action: button_off_double
519 | - choose:
520 | - conditions: []
521 | sequence: !input action_button_off_double
522 | default:
523 | - delay:
524 | milliseconds: '{{ adjusted_double_press_delay }}'
525 | - event: ahb_controller_event
526 | event_data:
527 | controller: '{{ controller_id }}'
528 | action: button_off_short
529 | - choose:
530 | - conditions: []
531 | sequence: !input action_button_off_short
532 | default:
533 | - event: ahb_controller_event
534 | event_data:
535 | controller: '{{ controller_id }}'
536 | action: button_off_short
537 | - choose:
538 | - conditions: []
539 | sequence: !input action_button_off_short
540 | - conditions: '{{ trigger_action | string in button_off_long }}'
541 | sequence:
542 | - event: ahb_controller_event
543 | event_data:
544 | controller: '{{ controller_id }}'
545 | action: button_off_long
546 | - choose:
547 | - conditions: '{{ button_off_long_loop }}'
548 | sequence:
549 | - repeat:
550 | while: '{{ repeat.index < button_off_long_max_loop_repeats | int }}'
551 | sequence: !input action_button_off_long
552 | default: !input action_button_off_long
553 | - conditions: '{{ trigger_action | string in button_off_release }}'
554 | sequence:
555 | - event: ahb_controller_event
556 | event_data:
557 | controller: '{{ controller_id }}'
558 | action: button_off_release
559 | - choose:
560 | - conditions: []
561 | sequence: !input action_button_off_release
562 | - conditions: '{{ trigger_action | string in button_up_short }}'
563 | sequence:
564 | - choose:
565 | - conditions: '{{ button_up_double_press }}'
566 | sequence:
567 | - choose:
568 | - conditions: '{{ trigger_action | string in states(helper_last_controller_event)
569 | and trigger_delta | int <= helper_double_press_delay | int }}'
570 | sequence:
571 | - service: input_text.set_value
572 | data:
573 | entity_id: !input helper_last_controller_event
574 | value: '{{ {"a":"double_press","t":as_timestamp(now())} | to_json
575 | }}'
576 | - event: ahb_controller_event
577 | event_data:
578 | controller: '{{ controller_id }}'
579 | action: button_up_double
580 | - choose:
581 | - conditions: []
582 | sequence: !input action_button_up_double
583 | default:
584 | - delay:
585 | milliseconds: '{{ adjusted_double_press_delay }}'
586 | - event: ahb_controller_event
587 | event_data:
588 | controller: '{{ controller_id }}'
589 | action: button_up_short
590 | - choose:
591 | - conditions: []
592 | sequence: !input action_button_up_short
593 | default:
594 | - event: ahb_controller_event
595 | event_data:
596 | controller: '{{ controller_id }}'
597 | action: button_up_short
598 | - choose:
599 | - conditions: []
600 | sequence: !input action_button_up_short
601 | - conditions: '{{ trigger_action | string in button_up_long }}'
602 | sequence:
603 | - event: ahb_controller_event
604 | event_data:
605 | controller: '{{ controller_id }}'
606 | action: button_up_long
607 | - choose:
608 | - conditions: '{{ button_up_long_loop }}'
609 | sequence:
610 | - repeat:
611 | while: '{{ repeat.index < button_up_long_max_loop_repeats | int }}'
612 | sequence: !input action_button_up_long
613 | default: !input action_button_up_long
614 | - conditions: '{{ trigger_action | string in button_up_release }}'
615 | sequence:
616 | - event: ahb_controller_event
617 | event_data:
618 | controller: '{{ controller_id }}'
619 | action: button_up_release
620 | - choose:
621 | - conditions: []
622 | sequence: !input action_button_up_release
623 | - conditions: '{{ trigger_action | string in button_down_short }}'
624 | sequence:
625 | - choose:
626 | - conditions: '{{ button_down_double_press }}'
627 | sequence:
628 | - choose:
629 | - conditions: '{{ trigger_action | string in states(helper_last_controller_event)
630 | and trigger_delta | int <= helper_double_press_delay | int }}'
631 | sequence:
632 | - service: input_text.set_value
633 | data:
634 | entity_id: !input helper_last_controller_event
635 | value: '{{ {"a":"double_press","t":as_timestamp(now())} | to_json
636 | }}'
637 | - event: ahb_controller_event
638 | event_data:
639 | controller: '{{ controller_id }}'
640 | action: button_down_double
641 | - choose:
642 | - conditions: []
643 | sequence: !input action_button_down_double
644 | default:
645 | - delay:
646 | milliseconds: '{{ adjusted_double_press_delay }}'
647 | - event: ahb_controller_event
648 | event_data:
649 | controller: '{{ controller_id }}'
650 | action: button_down_short
651 | - choose:
652 | - conditions: []
653 | sequence: !input action_button_down_short
654 | default:
655 | - event: ahb_controller_event
656 | event_data:
657 | controller: '{{ controller_id }}'
658 | action: button_down_short
659 | - choose:
660 | - conditions: []
661 | sequence: !input action_button_down_short
662 | - conditions: '{{ trigger_action | string in button_down_long }}'
663 | sequence:
664 | - event: ahb_controller_event
665 | event_data:
666 | controller: '{{ controller_id }}'
667 | action: button_down_long
668 | - choose:
669 | - conditions: '{{ button_down_long_loop }}'
670 | sequence:
671 | - repeat:
672 | while: '{{ repeat.index < button_down_long_max_loop_repeats | int }}'
673 | sequence: !input action_button_down_long
674 | default: !input action_button_down_long
675 | - conditions: '{{ trigger_action | string in button_down_release }}'
676 | sequence:
677 | - event: ahb_controller_event
678 | event_data:
679 | controller: '{{ controller_id }}'
680 | action: button_down_release
681 | - choose:
682 | - conditions: []
683 | sequence: !input action_button_down_release
684 |
--------------------------------------------------------------------------------
/blueprints/automation/SirGoodenough/Zigbee2MQTT - Xiaomi Cube Controller.yaml:
--------------------------------------------------------------------------------
1 | blueprint:
2 | name: Aqara Magic Cube Zigbee2MQTT - 2022-05-05
3 | description: "This Blueprint uses a Zigbee2MQTT built sensor to sort out the 38(+54)
4 | unique commands available from the Xiaomi Magic Cube Remote. (Some unique commands
5 | are available thru templating only. See the related document.)\nThe split out
6 | of functions gives you the ability to assign local scripts or functions to do
7 | the things you want the remote to do.\nFunctions that are left empty will simply
8 | do nothing.\n\n### \U0001F34E There is a set of 36 event functions that will trigger
9 | on specific actions on specific sides that are listed as **Group 1 actions \U0001F34E**.\n\n###
10 | \U0001F34A There is a set of 6 event functions that will trigger on specific actions
11 | on *ANY* side that are listed as **Group 2 sctions \U0001F34A**.\n\n### \U0001F350
12 | There is a set of 30 event functions that will trigger on cube flips to & froma
13 | specific sides that are listed as **Group 3 sctions \U0001F350**.\n\n### \U0001F369
14 | There are 2 actions (shake and drop) that only occur once and are OK to be combined
15 | with any other group.\n\nPlease be aware that ALL actions except the 2 listed
16 | above,\n\U0001F369 will trigger an action in **ALL 3 groups at the same time**
17 | every time. Therefore I suggest if you just have a couple of things you want this
18 | remote to do that you choose the *ANY / Group 2 / \U0001F34A* events.\nIf you
19 | want more than a few events, you should select actions in **Group 1 / \U0001F34E
20 | OR Group 3 / \U0001F350**.\nWith careful selection you can use mixed groups, but
21 | you run the risk of a single cube action triggering more than 1 Home Assistant
22 | action and making a mess of things \U0001F371.\n\n#### NOTICE: This cube *can*
23 | be triggered 124 ways, but only 38(+54) of them are unique (with templating).\n\nThere
24 | is sample code to make the template sensor in the help file on GitHib named [Zigbee2MQTT
25 | - Xiaomi Cube Controller.md](https://github.com/SirGoodenough/HA_Blueprints/blob/master/Automations/Zigbee2MQTT%20-%20Xiaomi%20Cube%20Controller.md)
26 | & in the [community page related to this](https://community.home-assistant.io/t/zigbee2mqtt-xiaomi-cube-controller/393203).\n\nWithin
27 | this blueprint there is an event handler that will latch the last command that
28 | the blueprint finds and sends that to the event buss. From there a simple Template
29 | sensor can grab it and show you the last action sent. Thie will help when setting
30 | up new functions and to troubleshoot strange behaviours.\n\n> This was forked
31 | from https://community.home-assistant.io/t/z2m-xiaomi-cube-controller/263006 1.2
32 | project authored by luckypoppy and the friends he pulled together to create the
33 | base. I sincerely thank Him (Them) for their work. I felt there needed to be more
34 | documentation for rookie users to properly set this up. I had quite a few questions
35 | and when I saw a few questions in that chat from people struggling, I wanted to
36 | help. I also had a better idea for troubleshooting info.\n"
37 | source_url: https://github.com/SirGoodenough/HA_Blueprints/blob/master/Automations/Zigbee2MQTT%20-%20Xiaomi%20Cube%20Controller.yaml
38 | domain: automation
39 | homeassistant:
40 | min_version: 2022.5.2
41 | input:
42 | remote:
43 | name: Remote
44 | description: 'The entity to put here is the sensor that Z2M imported which is
45 | named like this> sensor.XXYour_HameXX_action.
46 |
47 | The other 4 sensors can be disabled, they will not be used.'
48 | selector:
49 | entity:
50 | integration: mqtt
51 | domain: sensor
52 | multiple: false
53 | slide_face_0:
54 | name: "Group 1 actions \U0001F34E Slide the cube with face 0 up"
55 | description: Face 0 is the one with the 'Aqara' LOGO
56 | default: []
57 | selector:
58 | action: {}
59 | doubletap_face_0:
60 | name: "Group 1 actions \U0001F34E Double tap the cube with face 0 up"
61 | description: Face 0 is the one with the 'Aqara' LOGO
62 | default: []
63 | selector:
64 | action: {}
65 | flipped90_face_0:
66 | name: "Group 1 actions \U0001F34E Flip the cube 90 degrees to face 0"
67 | description: Face 0 is the one with the 'Aqara' LOGO
68 | default: []
69 | selector:
70 | action: {}
71 | flipped180_face_0:
72 | name: "Group 1 actions \U0001F34E Flip the cube 180 degrees to face 0"
73 | description: '**NOTE:** This action is trick to master, and should be used sparingly...
74 |
75 | Face 0 is the one with the ''Aqara'' LOGO'
76 | default: []
77 | selector:
78 | action: {}
79 | rotate_cw_face_0:
80 | name: "Group 1 actions \U0001F34E Rotate cube clockwise with face 0 up"
81 | description: Face 0 is the one with the 'Aqara' LOGO
82 | default: []
83 | selector:
84 | action: {}
85 | rotate_ccw_face_0:
86 | name: "Group 1 actions \U0001F34E Rotate cube counter clockwise with face 0
87 | up"
88 | description: Face 0 is the one with the 'Aqara' LOGO
89 | default: []
90 | selector:
91 | action: {}
92 | slide_face_1:
93 | name: "Group 1 actions \U0001F34E Slide the cube with face 1 up"
94 | default: []
95 | selector:
96 | action: {}
97 | doubletap_face_1:
98 | name: "Group 1 actions \U0001F34E Double tap the cube with face 1 up"
99 | default: []
100 | selector:
101 | action: {}
102 | flipped90_face_1:
103 | name: "Group 1 actions \U0001F34E Flip the cube 90 degrees to face 1"
104 | default: []
105 | selector:
106 | action: {}
107 | flipped180_face_1:
108 | name: "Group 1 actions \U0001F34E Flip the cube 180 degrees to face 1"
109 | description: '**NOTE:** This action is trick to master, and should be used sparingly...'
110 | default: []
111 | selector:
112 | action: {}
113 | rotate_cw_face_1:
114 | name: "Group 1 actions \U0001F34E Rotate cube clockwise with face 1 up"
115 | default: []
116 | selector:
117 | action: {}
118 | rotate_ccw_face_1:
119 | name: "Group 1 actions \U0001F34E Rotate cube counter clockwise with face 1
120 | up"
121 | default: []
122 | selector:
123 | action: {}
124 | slide_face_2:
125 | name: "Group 1 actions \U0001F34E Slide the cube with face 2 up"
126 | default: []
127 | selector:
128 | action: {}
129 | doubletap_face_2:
130 | name: "Group 1 actions \U0001F34E Double tap the cube with face 2 up"
131 | default: []
132 | selector:
133 | action: {}
134 | flipped90_face_2:
135 | name: "Group 1 actions \U0001F34E Flip the cube 90 degrees to face 2"
136 | default: []
137 | selector:
138 | action: {}
139 | flipped180_face_2:
140 | name: "Group 1 actions \U0001F34E Flip the cube 180 degrees to face 2"
141 | description: '**NOTE:** This action is trick to master, and should be used sparingly...'
142 | default: []
143 | selector:
144 | action: {}
145 | rotate_cw_face_2:
146 | name: "Group 1 actions \U0001F34E Rotate cube clockwise with face 2 up"
147 | default: []
148 | selector:
149 | action: {}
150 | rotate_ccw_face_2:
151 | name: "Group 1 actions \U0001F34E Rotate cube counter clockwise with face 2
152 | up"
153 | default: []
154 | selector:
155 | action: {}
156 | slide_face_3:
157 | name: "Group 1 actions \U0001F34E Slide the cube with face 3 up"
158 | default: []
159 | selector:
160 | action: {}
161 | doubletap_face_3:
162 | name: "Group 1 actions \U0001F34E Double tap the cube with face 3 up"
163 | default: []
164 | selector:
165 | action: {}
166 | flipped90_face_3:
167 | name: "Group 1 actions \U0001F34E Flip the cube 90 degrees to face 3"
168 | default: []
169 | selector:
170 | action: {}
171 | flipped180_face_3:
172 | name: "Group 1 actions \U0001F34E Flip the cube 180 degrees to face 3"
173 | description: '**NOTE:** This action is trick to master, and should be used sparingly...'
174 | default: []
175 | selector:
176 | action: {}
177 | rotate_cw_face_3:
178 | name: "Group 1 actions \U0001F34E Rotate cube clockwise with face 3 up"
179 | default: []
180 | selector:
181 | action: {}
182 | rotate_ccw_face_3:
183 | name: "Group 1 actions \U0001F34E Rotate cube counter clockwise with face 3
184 | up"
185 | default: []
186 | selector:
187 | action: {}
188 | slide_face_4:
189 | name: "Group 1 actions \U0001F34E Slide the cube with face 4 up"
190 | default: []
191 | selector:
192 | action: {}
193 | doubletap_face_4:
194 | name: "Group 1 actions \U0001F34E Double tap the cube with face 4 up"
195 | default: []
196 | selector:
197 | action: {}
198 | flipped90_face_4:
199 | name: "Group 1 actions \U0001F34E Flip the cube 90 degrees to face 4"
200 | default: []
201 | selector:
202 | action: {}
203 | flipped180_face_4:
204 | name: "Group 1 actions \U0001F34E Flip the cube 180 degrees to face 4"
205 | description: '**NOTE:** This action is trick to master, and should be used sparingly...'
206 | default: []
207 | selector:
208 | action: {}
209 | rotate_cw_face_4:
210 | name: "Group 1 actions \U0001F34E Rotate cube clockwise with face 4 up"
211 | default: []
212 | selector:
213 | action: {}
214 | rotate_ccw_face_4:
215 | name: "Group 1 actions \U0001F34E Rotate cube counter clockwise with face 4
216 | up"
217 | default: []
218 | selector:
219 | action: {}
220 | slide_face_5:
221 | name: "Group 1 actions \U0001F34E Slide the cube with face 5 up"
222 | default: []
223 | selector:
224 | action: {}
225 | doubletap_face_5:
226 | name: "Group 1 actions \U0001F34E Double tap the cube with face 5 up"
227 | default: []
228 | selector:
229 | action: {}
230 | flipped90_face_5:
231 | name: "Group 1 actions \U0001F34E Flip the cube 90 degrees to face 5"
232 | default: []
233 | selector:
234 | action: {}
235 | flipped180_face_5:
236 | name: "Group 1 actions \U0001F34E Flip the cube 180 degrees to face 5"
237 | description: '**NOTE:** This action is trick to master, and should be used sparingly...'
238 | default: []
239 | selector:
240 | action: {}
241 | rotate_cw_face_5:
242 | name: "Group 1 actions \U0001F34E Rotate cube clockwise with face 5 up"
243 | default: []
244 | selector:
245 | action: {}
246 | rotate_ccw_face_5:
247 | name: "Group 1 actions \U0001F34E Rotate cube counter clockwise with face 5
248 | up"
249 | default: []
250 | selector:
251 | action: {}
252 | shake:
253 | name: "Shake the cube \U0001F369"
254 | description: 'This trigger only occurs once in the set-up.
255 |
256 | It can be combined in any group.'
257 | default: []
258 | selector:
259 | action: {}
260 | fall:
261 | name: "Drop the cube \U0001F369"
262 | description: 'This trigger only occurs once in the set-up.
263 |
264 | It can be combined in any group.'
265 | default: []
266 | selector:
267 | action: {}
268 | slide_any:
269 | name: "Group 2 actions \U0001F34A Slide the cube with any side"
270 | description: "Side doesn't matter on this one.\n**!!Warning!!** The automations
271 | for the specific side will also trigger. \U0001F34E\U0001F350\nI suggest using
272 | only one of the three groups of triggers, not multiple groups..."
273 | default: []
274 | selector:
275 | action: {}
276 | doubletap_any:
277 | name: "Group 2 actions \U0001F34A Double tap the cube with any side"
278 | description: "Side doesn't matter on this one.\n**!!Warning!!** The automations
279 | for the specific side will also trigger. \U0001F34E\U0001F350\nI suggest using
280 | only one of the three groups of triggers, not multiple groups..."
281 | default: []
282 | selector:
283 | action: {}
284 | flipped90_any:
285 | name: "Group 2 actions \U0001F34A Flip the cube 90 degrees to any side"
286 | description: "Side doesn't matter on this one.\n**!!Warning!!** The automations
287 | for the specific side will also trigger. \U0001F34E\U0001F350\nI suggest using
288 | only one of the three groups of triggers, not multiple groups..."
289 | default: []
290 | selector:
291 | action: {}
292 | flipped180_any:
293 | name: "Group 2 actions \U0001F34A Flip the cube 180 degrees any side"
294 | description: "NOTE: This action is trick to master, and should be used sparingly...
295 | Side doesn't matter on this one.\n**!!Warning!!** The automations for the
296 | specific side will also trigger. \U0001F34E\U0001F350\nI suggest using only
297 | one of the three groups of triggers, not multiple groups..."
298 | default: []
299 | selector:
300 | action: {}
301 | rotate_cw_any:
302 | name: "Group 2 actions \U0001F34A Rotate cube clockwise with any side"
303 | description: "Side doesn't matter on this one.\n**!!Warning!!** The automations
304 | for the specific side will also trigger. \U0001F34E\U0001F350\nI suggest using
305 | only one of the three groups of triggers, not multiple groups..."
306 | default: []
307 | selector:
308 | action: {}
309 | rotate_ccw_any:
310 | name: "Group 2 actions \U0001F34A Rotate cube counter clockwise with any side"
311 | description: "Side doesn't matter on this one.\n**!!Warning!!** The automations
312 | for the specific side will also trigger. \U0001F34E\U0001F350\nI suggest using
313 | only one of the three groups of triggers, not multiple groups..."
314 | default: []
315 | selector:
316 | action: {}
317 | 0_from_1:
318 | name: "Group 3 actions \U0001F350 Flip the cube to side 0 from side 1"
319 | description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 0
320 | and the ANY \U0001F34A automations will also trigger.\nI suggest using only
321 | one of the three groups of triggers, not multiple groups..."
322 | default: []
323 | selector:
324 | action: {}
325 | 0_from_2:
326 | name: "Group 3 actions \U0001F350 Flip the cube to side 0 from side 2"
327 | description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 0
328 | and the ANY \U0001F34A automations will also trigger.\nI suggest using only
329 | one of the three groups of triggers, not multiple groups..."
330 | default: []
331 | selector:
332 | action: {}
333 | 0_from_3:
334 | name: "Group 3 actions \U0001F350 Flip the cube to side 0 from side 3"
335 | description: "**!!Warning!!** The flip 180 automations \U0001F34E for side 0
336 | and the ANY \U0001F34A automations will also trigger.\nI suggest using only
337 | one of the three groups of triggers, not multiple groups..."
338 | default: []
339 | selector:
340 | action: {}
341 | 0_from_4:
342 | name: "Group 3 actions \U0001F350 Flip the cube to side 0 from side 4"
343 | description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 0
344 | and the ANY \U0001F34A automations will also trigger.\nI suggest using only
345 | one of the three groups of triggers, not multiple groups..."
346 | default: []
347 | selector:
348 | action: {}
349 | 0_from_5:
350 | name: "Group 3 actions \U0001F350 Flip the cube to side 0 from side 5"
351 | description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 0
352 | and the ANY \U0001F34A automations will also trigger.\nI suggest using only
353 | one of the three groups of triggers, not multiple groups..."
354 | default: []
355 | selector:
356 | action: {}
357 | 1_from_0:
358 | name: "Group 3 actions \U0001F350 Flip the cube to side 1 from side 0"
359 | description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 1
360 | and the ANY \U0001F34A automations will also trigger.\nI suggest using only
361 | one of the three groups of triggers, not multiple groups..."
362 | default: []
363 | selector:
364 | action: {}
365 | 1_from_2:
366 | name: "Group 3 actions \U0001F350 Flip the cube to side 1 from side 2"
367 | description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 1
368 | and the ANY \U0001F34A automations will also trigger.\nI suggest using only
369 | one of the three groups of triggers, not multiple groups..."
370 | default: []
371 | selector:
372 | action: {}
373 | 1_from_3:
374 | name: "Group 3 actions \U0001F350 Flip the cube to side 1 from side 3"
375 | description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 1
376 | and the ANY \U0001F34A automations will also trigger.\nI suggest using only
377 | one of the three groups of triggers, not multiple groups..."
378 | default: []
379 | selector:
380 | action: {}
381 | 1_from_4:
382 | name: "Group 3 actions \U0001F350 Flip the cube to side 1 from side 4"
383 | description: "**!!Warning!!** The flip 180 automations \U0001F34E for side 1
384 | and the ANY \U0001F34A automations will also trigger.\nI suggest using only
385 | one of the three groups of triggers, not multiple groups..."
386 | default: []
387 | selector:
388 | action: {}
389 | 1_from_5:
390 | name: "Group 3 actions \U0001F350 Flip the cube to side 1 from side 5"
391 | description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 1
392 | and the ANY \U0001F34A automations will also trigger.\nI suggest using only
393 | one of the three groups of triggers, not multiple groups..."
394 | default: []
395 | selector:
396 | action: {}
397 | 2_from_0:
398 | name: "Group 3 actions \U0001F350 Flip the cube to side 2 from side 0"
399 | description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 2
400 | and the ANY \U0001F34A automations will also trigger.\nI suggest using only
401 | one of the three groups of triggers, not multiple groups..."
402 | default: []
403 | selector:
404 | action: {}
405 | 2_from_1:
406 | name: "Group 3 actions \U0001F350 Flip the cube to side 2 from side 1"
407 | description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 2
408 | and the ANY \U0001F34A automations will also trigger.\nI suggest using only
409 | one of the three groups of triggers, not multiple groups..."
410 | default: []
411 | selector:
412 | action: {}
413 | 2_from_3:
414 | name: "Group 3 actions \U0001F350 Flip the cube to side 2 from side 3"
415 | description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 2
416 | and the ANY \U0001F34A automations will also trigger.\nI suggest using only
417 | one of the three groups of triggers, not multiple groups..."
418 | default: []
419 | selector:
420 | action: {}
421 | 2_from_4:
422 | name: "Group 3 actions \U0001F350 Flip the cube to side 2 from side 4"
423 | description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 2
424 | and the ANY \U0001F34A automations will also trigger.\nI suggest using only
425 | one of the three groups of triggers, not multiple groups..."
426 | default: []
427 | selector:
428 | action: {}
429 | 2_from_5:
430 | name: "Group 3 actions \U0001F350 Flip the cube to side 2 from side 5"
431 | description: "**!!Warning!!** The flip 180 automations \U0001F34E for side 2
432 | and the ANY \U0001F34A automations will also trigger.\nI suggest using only
433 | one of the three groups of triggers, not multiple groups..."
434 | default: []
435 | selector:
436 | action: {}
437 | 3_from_0:
438 | name: "Group 3 actions \U0001F350 Flip the cube to side 3 from side 0"
439 | description: "**!!Warning!!** The flip 180 automations \U0001F34E for side 3
440 | and the ANY \U0001F34A automations will also trigger.\nI suggest using only
441 | one of the three groups of triggers, not multiple groups..."
442 | default: []
443 | selector:
444 | action: {}
445 | 3_from_1:
446 | name: "Group 3 actions \U0001F350 Flip the cube to side 3 from side 1"
447 | description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 3
448 | and the ANY \U0001F34A automations will also trigger.\nI suggest using only
449 | one of the three groups of triggers, not multiple groups..."
450 | default: []
451 | selector:
452 | action: {}
453 | 3_from_2:
454 | name: "Group 3 actions \U0001F350 Flip the cube to side 3 from side 2"
455 | description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 3
456 | and the ANY \U0001F34A automations will also trigger.\nI suggest using only
457 | one of the three groups of triggers, not multiple groups..."
458 | default: []
459 | selector:
460 | action: {}
461 | 3_from_4:
462 | name: "Group 3 actions \U0001F350 Flip the cube to side 3 from side 4"
463 | description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 3
464 | and the ANY \U0001F34A automations will also trigger.\nI suggest using only
465 | one of the three groups of triggers, not multiple groups..."
466 | default: []
467 | selector:
468 | action: {}
469 | 3_from_5:
470 | name: "Group 3 actions \U0001F350 Flip the cube to side 3 from side 5"
471 | description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 3
472 | and the ANY \U0001F34A automations will also trigger.\nI suggest using only
473 | one of the three groups of triggers, not multiple groups..."
474 | default: []
475 | selector:
476 | action: {}
477 | 4_from_0:
478 | name: "Group 3 actions \U0001F350 Flip the cube to side 4 from side 0"
479 | description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 4
480 | and the ANY \U0001F34A automations will also trigger.\nI suggest using only
481 | one of the three groups of triggers, not multiple groups..."
482 | default: []
483 | selector:
484 | action: {}
485 | 4_from_1:
486 | name: "Group 3 actions \U0001F350 Flip the cube to side 4 from side 1"
487 | description: "**!!Warning!!** The flip 180 automations \U0001F34E for side 4
488 | and the ANY \U0001F34A automations will also trigger.\nI suggest using only
489 | one of the three groups of triggers, not multiple groups..."
490 | default: []
491 | selector:
492 | action: {}
493 | 4_from_2:
494 | name: "Group 3 actions \U0001F350 Flip the cube to side 4 from side 2"
495 | description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 4
496 | and the ANY \U0001F34A automations will also trigger.\nI suggest using only
497 | one of the three groups of triggers, not multiple groups..."
498 | default: []
499 | selector:
500 | action: {}
501 | 4_from_3:
502 | name: "Group 3 actions \U0001F350 Flip the cube to side 4 from side 3"
503 | description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 4
504 | and the ANY \U0001F34A automations will also trigger.\nI suggest using only
505 | one of the three groups of triggers, not multiple groups..."
506 | default: []
507 | selector:
508 | action: {}
509 | 4_from_5:
510 | name: "Group 3 actions \U0001F350 Flip the cube to side 4 from side 5"
511 | description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 4
512 | and the ANY \U0001F34A automations will also trigger.\nI suggest using only
513 | one of the three groups of triggers, not multiple groups..."
514 | default: []
515 | selector:
516 | action: {}
517 | 5_from_0:
518 | name: "Group 3 actions \U0001F350 Flip the cube to side 5 from side 0"
519 | description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 5
520 | and the ANY \U0001F34A automations will also trigger.\nI suggest using only
521 | one of the three groups of triggers, not multiple groups..."
522 | default: []
523 | selector:
524 | action: {}
525 | 5_from_1:
526 | name: "Group 3 actions \U0001F350 Flip the cube to side 5 from side 1"
527 | description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 5
528 | and the ANY \U0001F34A automations will also trigger. \U0001F34E\U0001F350\nI
529 | suggest using only one of the three groups of triggers, not multiple groups..."
530 | default: []
531 | selector:
532 | action: {}
533 | 5_from_2:
534 | name: "Group 3 actions \U0001F350 Flip the cube to side 5 from side 2"
535 | description: "**!!Warning!!** The flip 180 automations \U0001F34E for side 5
536 | and the ANY \U0001F34A automations will also trigger.\nI suggest using only
537 | one of the three groups of triggers, not multiple groups..."
538 | default: []
539 | selector:
540 | action: {}
541 | 5_from_3:
542 | name: "Group 3 actions \U0001F350 Flip the cube to side 5 from side 3"
543 | description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 5
544 | and the ANY \U0001F34A automations will also trigger.\nI suggest using only
545 | one of the three groups of triggers, not multiple groups..."
546 | default: []
547 | selector:
548 | action: {}
549 | 5_from_4:
550 | name: "Group 3 actions \U0001F350 Flip the cube to side 5 from side 4"
551 | description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 5
552 | and the ANY \U0001F34A automations will also trigger.\nI suggest using only
553 | one of the three groups of triggers, not multiple groups..."
554 | default: []
555 | selector:
556 | action: {}
557 | mode: single
558 | max_exceeded: silent
559 | trigger:
560 | - platform: state
561 | entity_id: !input remote
562 | condition:
563 | condition: template
564 | value_template: '{{ trigger.to_state.attributes.action in (''rotate_right'', ''rotate_left'',
565 | ''flip90'', ''flip180'', ''slide'', ''tap'', ''shake'', ''fall'') }}'
566 | action:
567 | - variables:
568 | action: '{{ trigger.to_state.attributes.action }}'
569 | side: '{{ trigger.to_state.attributes.side }}'
570 | last_side: '{{ trigger.from_state.attributes.side }}'
571 | entity_id: !input remote
572 | friendly_name: '{{ trigger.to_state.attributes.friendly_name }}'
573 | - alias: Fire Last Action event
574 | event: cube_last_action
575 | event_data:
576 | action: '{{ action }}'
577 | side: '{{ side }}'
578 | last_side: '{{ last_side }}'
579 | entity_id: '{{ entity_id }}'
580 | friendly_name: '{{ friendly_name }}'
581 | - alias: "Group 2 \U0001F34A and No Group \U0001F369 These are action events for ANY
582 | Side"
583 | choose:
584 | - conditions: '{{ action == "slide" }}'
585 | sequence: !input slide_any
586 | - conditions: '{{ action == "tap" }}'
587 | sequence: !input doubletap_any
588 | - conditions: '{{ action == "flip90" }}'
589 | sequence: !input flipped90_any
590 | - conditions: '{{ action == "flip180" }}'
591 | sequence: !input flipped180_any
592 | - conditions: '{{ action == "rotate_right" }}'
593 | sequence: !input rotate_cw_any
594 | - conditions: '{{ action == "rotate_left" }}'
595 | sequence: !input rotate_ccw_any
596 | - conditions: '{{ action == "shake" }}'
597 | sequence: !input shake
598 | - conditions: '{{ action == "fall" }}'
599 | sequence: !input fall
600 | - alias: "Group 1 \U0001F34E These are action events based on the action broken down
601 | by side"
602 | choose:
603 | - conditions: '{{ action == "slide" }}'
604 | sequence:
605 | - alias: These are slide events
606 | choose:
607 | - conditions: '{{ side == 0 }}'
608 | sequence: !input slide_face_0
609 | - conditions: '{{ side == 1 }}'
610 | sequence: !input slide_face_1
611 | - conditions: '{{ side == 2 }}'
612 | sequence: !input slide_face_2
613 | - conditions: '{{ side == 3 }}'
614 | sequence: !input slide_face_3
615 | - conditions: '{{ side == 4 }}'
616 | sequence: !input slide_face_4
617 | - conditions: '{{ side == 5 }}'
618 | sequence: !input slide_face_5
619 | - conditions: '{{ action == "tap" }}'
620 | sequence:
621 | - alias: These are doubletap events
622 | choose:
623 | - conditions: '{{ side == 0 }}'
624 | sequence: !input doubletap_face_0
625 | - conditions: '{{ side == 1 }}'
626 | sequence: !input doubletap_face_1
627 | - conditions: '{{ side == 2 }}'
628 | sequence: !input doubletap_face_2
629 | - conditions: '{{ side == 3 }}'
630 | sequence: !input doubletap_face_3
631 | - conditions: '{{ side == 4 }}'
632 | sequence: !input doubletap_face_4
633 | - conditions: '{{ side == 5 }}'
634 | sequence: !input doubletap_face_5
635 | - conditions: '{{ action == "flip90" }}'
636 | sequence:
637 | - alias: These are flipped90 events
638 | choose:
639 | - conditions: '{{ side == 0 }}'
640 | sequence: !input flipped90_face_0
641 | - conditions: '{{ side == 1 }}'
642 | sequence: !input flipped90_face_1
643 | - conditions: '{{ side == 2 }}'
644 | sequence: !input flipped90_face_2
645 | - conditions: '{{ side == 3 }}'
646 | sequence: !input flipped90_face_3
647 | - conditions: '{{ side == 4 }}'
648 | sequence: !input flipped90_face_4
649 | - conditions: '{{ side == 5 }}'
650 | sequence: !input flipped90_face_5
651 | - conditions: '{{ action == "flip180" }}'
652 | sequence:
653 | - alias: These are flipped180 events
654 | choose:
655 | - conditions: '{{ side == 0 }}'
656 | sequence: !input flipped180_face_0
657 | - conditions: '{{ side == 1 }}'
658 | sequence: !input flipped180_face_1
659 | - conditions: '{{ side == 2 }}'
660 | sequence: !input flipped180_face_2
661 | - conditions: '{{ side == 3 }}'
662 | sequence: !input flipped180_face_3
663 | - conditions: '{{ side == 4 }}'
664 | sequence: !input flipped180_face_4
665 | - conditions: '{{ side == 5 }}'
666 | sequence: !input flipped180_face_5
667 | - conditions: '{{ action == "rotate_right" }}'
668 | sequence:
669 | - alias: These are rotate CW events
670 | choose:
671 | - conditions: '{{ side == 0 }}'
672 | sequence: !input rotate_cw_face_0
673 | - conditions: '{{ side == 1 }}'
674 | sequence: !input rotate_cw_face_1
675 | - conditions: '{{ side == 2 }}'
676 | sequence: !input rotate_cw_face_2
677 | - conditions: '{{ side == 3 }}'
678 | sequence: !input rotate_cw_face_3
679 | - conditions: '{{ side == 4 }}'
680 | sequence: !input rotate_cw_face_4
681 | - conditions: '{{ side == 5 }}'
682 | sequence: !input rotate_cw_face_5
683 | - conditions: '{{ action == "rotate_left" }}'
684 | sequence:
685 | - alias: These are rotate CCW events
686 | choose:
687 | - conditions: '{{ side == 0 }}'
688 | sequence: !input rotate_ccw_face_0
689 | - conditions: '{{ side == 1 }}'
690 | sequence: !input rotate_ccw_face_1
691 | - conditions: '{{ side == 2 }}'
692 | sequence: !input rotate_ccw_face_2
693 | - conditions: '{{ side == 3 }}'
694 | sequence: !input rotate_ccw_face_3
695 | - conditions: '{{ side == 4 }}'
696 | sequence: !input rotate_ccw_face_4
697 | - conditions: '{{ side == 5 }}'
698 | sequence: !input rotate_ccw_face_5
699 | - alias: "Group 3 \U0001F350 Side to side jump events"
700 | choose:
701 | - conditions: '{{ side == 0 }}'
702 | sequence:
703 | - alias: To side 0 from any events
704 | choose:
705 | - conditions: '{{ last_side == 1 }}'
706 | sequence: !input 0_from_1
707 | - conditions: '{{ last_side == 2 }}'
708 | sequence: !input 0_from_2
709 | - conditions: '{{ last_side == 3 }}'
710 | sequence: !input 0_from_3
711 | - conditions: '{{ last_side == 4 }}'
712 | sequence: !input 0_from_4
713 | - conditions: '{{ last_side == 5 }}'
714 | sequence: !input 0_from_5
715 | - conditions: '{{ side == 1 }}'
716 | sequence:
717 | - alias: To side 1 from any events
718 | choose:
719 | - conditions: '{{ last_side == 0 }}'
720 | sequence: !input 1_from_0
721 | - conditions: '{{ last_side == 2 }}'
722 | sequence: !input 1_from_2
723 | - conditions: '{{ last_side == 3 }}'
724 | sequence: !input 1_from_3
725 | - conditions: '{{ last_side == 4 }}'
726 | sequence: !input 1_from_4
727 | - conditions: '{{ last_side == 5 }}'
728 | sequence: !input 1_from_5
729 | - conditions: '{{ side == 2 }}'
730 | sequence:
731 | - alias: To side 2 from any events
732 | choose:
733 | - conditions: '{{ last_side == 0 }}'
734 | sequence: !input 2_from_0
735 | - conditions: '{{ last_side == 1 }}'
736 | sequence: !input 2_from_1
737 | - conditions: '{{ last_side == 3 }}'
738 | sequence: !input 2_from_3
739 | - conditions: '{{ last_side == 4 }}'
740 | sequence: !input 2_from_4
741 | - conditions: '{{ last_side == 5 }}'
742 | sequence: !input 2_from_5
743 | - conditions: '{{ side == 3 }}'
744 | sequence:
745 | - alias: To side 3 from any events
746 | choose:
747 | - conditions: '{{ last_side == 0 }}'
748 | sequence: !input 3_from_0
749 | - conditions: '{{ last_side == 1 }}'
750 | sequence: !input 3_from_1
751 | - conditions: '{{ last_side == 2 }}'
752 | sequence: !input 3_from_2
753 | - conditions: '{{ last_side == 4 }}'
754 | sequence: !input 3_from_4
755 | - conditions: '{{ last_side == 5 }}'
756 | sequence: !input 3_from_5
757 | - conditions: '{{ side == 4 }}'
758 | sequence:
759 | - alias: To side 4 from any events
760 | choose:
761 | - conditions: '{{ last_side == 0 }}'
762 | sequence: !input 4_from_0
763 | - conditions: '{{ last_side == 1 }}'
764 | sequence: !input 4_from_1
765 | - conditions: '{{ last_side == 2 }}'
766 | sequence: !input 4_from_2
767 | - conditions: '{{ last_side == 3 }}'
768 | sequence: !input 4_from_3
769 | - conditions: '{{ last_side == 5 }}'
770 | sequence: !input 4_from_5
771 | - conditions: '{{ side == 5 }}'
772 | sequence:
773 | - alias: To side 5 from any events
774 | choose:
775 | - conditions: '{{ last_side == 0 }}'
776 | sequence: !input 5_from_0
777 | - conditions: '{{ last_side == 1 }}'
778 | sequence: !input 5_from_1
779 | - conditions: '{{ last_side == 2 }}'
780 | sequence: !input 5_from_2
781 | - conditions: '{{ last_side == 3 }}'
782 | sequence: !input 5_from_3
783 | - conditions: '{{ last_side == 4 }}'
784 | sequence: !input 5_from_4
785 | - alias: Delay ⏱ for debounce so toggle functions work. Also blueprint is in single
786 | mode.
787 | delay: 00:00:01
788 |
--------------------------------------------------------------------------------
/blueprints/automation/cvroque/webostv_turn_on.yaml:
--------------------------------------------------------------------------------
1 | blueprint:
2 | name: LG webOS Smart TV - Turn On Action
3 | description: "\n## LG webOS Smart TV - Turn On Action for 2022.2+\n\nThis blueprint
4 | will run anytime the user turns the media player on through Home Assistant (UI
5 | or service).\n\nAdding this blueprint will allow the user to turn on the LG webOS
6 | TV through the UI after updating to HA 2022.2, without this blueprint or similar
7 | automation the Turn On button won't be displayed due to a breaking change. This
8 | is basically a shortcut to manually adding the automation described in the [official
9 | documentation][1].\n\nThe default action is to send a Wake On Lan magic packet
10 | in order to turn the TV on. Aditionally you can also setup custom actions for
11 | alternate solutions such as: using an IR remote, turning a smart socket on or
12 | calling an script. This is also useful for TV models connected through Wireless
13 | that have issues with Wake on Lan.\n\n\n### Requirements:\n- [LG webOS Smart TV][2]
14 | integration\n- [Wake On Lan][3] added to configuration.yaml\n\n### Changelog:\n-
15 | 2022.02.03 - First release\n- 2022.02.06 - Added austom actions\n- 2022.04.27
16 | - Added actions to run after TV is turned On\n \n\n[1]: https://www.home-assistant.io/integrations/webostv/#turn-on-action\n[2]:
17 | https://www.home-assistant.io/integrations/webostv/\n[3]: https://www.home-assistant.io/integrations/wake_on_lan/\n"
18 | domain: automation
19 | source_url: https://gist.github.com/cvroque/6780ca0869ef781e9de3b506fd501f78#file-webostv_turn_on-yaml
20 | input:
21 | webostv:
22 | name: LG webOS TV
23 | description: Select your media player entity
24 | selector:
25 | entity:
26 | domain: media_player
27 | integration: webostv
28 | multiple: false
29 | webostv_mac:
30 | name: LG webOS TV MAC address
31 | description: The MAC address of the selected TV. You can get this information
32 | on your TV network settings or through your router.
33 | default: AA-BB-CC-DD-EE-FF
34 | on_action:
35 | name: Actions to run after TV is turned On (Optional)
36 | description: Select actions to run after the TV is turned on. Useful for setting
37 | a default volume or changing source automatically.
38 | default: []
39 | selector:
40 | action: {}
41 | select_action:
42 | name: Enable Custom Actions?
43 | description: When Off the default action is to send a magic packet, when On
44 | the custom actions will replace the magic packet.
45 | default: false
46 | selector:
47 | boolean: {}
48 | custom_action:
49 | name: Custom Actions (Optional)
50 | description: When custom actions are enabled the actions added here will replace
51 | the magic packet. Useful for TVs being turned on through an IR remote, script
52 | or similar.
53 | default: []
54 | selector:
55 | action: {}
56 | variables:
57 | select_action: !input select_action
58 | trigger:
59 | - platform: webostv.turn_on
60 | entity_id: !input webostv
61 | action:
62 | - choose:
63 | - conditions:
64 | - '{{ select_action }}'
65 | sequence: !input custom_action
66 | default:
67 | - service: wake_on_lan.send_magic_packet
68 | data:
69 | mac: !input webostv_mac
70 | - wait_for_trigger:
71 | - platform: state
72 | entity_id: !input webostv
73 | to: 'on'
74 | timeout: 00:00:30
75 | - choose: []
76 | default: !input on_action
77 | mode: queued
78 | max_exceeded: silent
79 |
--------------------------------------------------------------------------------
/blueprints/automation/homeassistant/motion_light.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | blueprint:
3 | name: Motion-activated Light
4 | description: Turn on a light when motion is detected.
5 | domain: automation
6 | # yamllint disable-line rule:line-length
7 | source_url: https://github.com/home-assistant/core/blob/dev/homeassistant/components/automation/blueprints/motion_light.yaml
8 | input:
9 | motion_entity:
10 | name: Motion Sensor
11 | selector:
12 | entity:
13 | domain: binary_sensor
14 | device_class: motion
15 | light_target:
16 | name: Light
17 | selector:
18 | target:
19 | entity:
20 | domain: light
21 | no_motion_wait:
22 | name: Wait time
23 | description: Time to leave the light on after last motion is detected.
24 | default: 120
25 | selector:
26 | number:
27 | min: 0
28 | max: 3600
29 | unit_of_measurement: seconds
30 |
31 | # If motion is detected within the delay,
32 | # we restart the script.
33 | mode: restart
34 | max_exceeded: silent
35 |
36 | trigger:
37 | platform: state
38 | entity_id: !input motion_entity
39 | from: "off"
40 | to: "on"
41 |
42 | action:
43 | - service: light.turn_on
44 | target: !input light_target
45 | - wait_for_trigger:
46 | platform: state
47 | entity_id: !input motion_entity
48 | from: "on"
49 | to: "off"
50 | - delay: !input no_motion_wait
51 | - service: light.turn_off
52 | target: !input light_target
53 |
--------------------------------------------------------------------------------
/blueprints/automation/homeassistant/notify_leaving_zone.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | blueprint:
3 | name: Zone Notification
4 | description: Send a notification to a device when a person leaves
5 | a specific zone.
6 | domain: automation
7 | # yamllint disable-line rule:line-length
8 | source_url: https://github.com/home-assistant/core/blob/dev/homeassistant/components/automation/blueprints/notify_leaving_zone.yaml
9 | input:
10 | person_entity:
11 | name: Person
12 | selector:
13 | entity:
14 | domain: person
15 | zone_entity:
16 | name: Zone
17 | selector:
18 | entity:
19 | domain: zone
20 | notify_device:
21 | name: Device to notify
22 | description: Device needs to run the official Home Assistant app to
23 | receive notifications.
24 | selector:
25 | device:
26 | integration: mobile_app
27 |
28 | trigger:
29 | platform: state
30 | entity_id: !input person_entity
31 |
32 | variables:
33 | zone_entity: !input zone_entity
34 | # This is the state of the person when it's in this zone.
35 | zone_state: "{{ states[zone_entity].name }}"
36 | person_entity: !input person_entity
37 | person_name: "{{ states[person_entity].name }}"
38 |
39 | condition:
40 | condition: template
41 | value_template: "{{ trigger.from_state.state ==
42 | zone_state and trigger.to_state.state != zone_state }}"
43 |
44 | action:
45 | domain: mobile_app
46 | type: notify
47 | device_id: !input notify_device
48 | message: "{{ person_name }} has left {{ zone_state }}"
49 |
--------------------------------------------------------------------------------
/blueprints/automation/mannerisms/zha-philips-hue-dimmer-switch-individual-buttons-with-long-presses.yaml:
--------------------------------------------------------------------------------
1 | blueprint:
2 | name: ZHA - Philips Hue Dimmer Switch (individual buttons)
3 | description: 'All four buttons are individual buttons with short,
4 |
5 | long and double press actions for scenes or automations
6 |
7 | '
8 | domain: automation
9 | input:
10 | remote:
11 | name: Remote
12 | description: The remote to use
13 | selector:
14 | device:
15 | integration: zha
16 | manufacturer: Philips
17 | entity:
18 | domain: sensor
19 | device_class: battery
20 | multiple: false
21 | button_1_single_press:
22 | name: Button 1 (ON) Single Press
23 | description: Action to run on single press
24 | default: []
25 | selector:
26 | action: {}
27 | button_1_long_press:
28 | name: Button 1 (ON) Long Press
29 | description: Action to run on long press
30 | default: []
31 | selector:
32 | action: {}
33 | button_1_double_press:
34 | name: Button 1 (ON) Double Press
35 | description: Action to run on double press
36 | default: []
37 | selector:
38 | action: {}
39 | button_2_single_press:
40 | name: Button 2 (UP) Single Press
41 | description: Action to run on single press
42 | default: []
43 | selector:
44 | action: {}
45 | button_2_long_press:
46 | name: Button 2 (UP) Long Press
47 | description: Action to run on long press
48 | default: []
49 | selector:
50 | action: {}
51 | button_2_double_press:
52 | name: Button 2 (UP) Double Press
53 | description: Action to run on double press
54 | default: []
55 | selector:
56 | action: {}
57 | button_3_single_press:
58 | name: Button 3 (DOWN) Single Press
59 | description: Action to run on single press
60 | default: []
61 | selector:
62 | action: {}
63 | button_3_long_press:
64 | name: Button 3 (DOWN) Long Press
65 | description: Action to run on long press
66 | default: []
67 | selector:
68 | action: {}
69 | button_3_double_press:
70 | name: Button 3 (DOWN) Double Press
71 | description: Action to run on double press
72 | default: []
73 | selector:
74 | action: {}
75 | button_4_single_press:
76 | name: Button 4 (OFF) Single Press
77 | description: Action to run on single press
78 | default: []
79 | selector:
80 | action: {}
81 | button_4_long_press:
82 | name: Button 4 (OFF) Long Press
83 | description: Action to run on long press
84 | default: []
85 | selector:
86 | action: {}
87 | button_4_double_press:
88 | name: Button 4 (OFF) Double Press
89 | description: Action to run on double press
90 | default: []
91 | selector:
92 | action: {}
93 | source_url: https://community.home-assistant.io/t/zha-philips-hue-dimmer-switch-individual-buttons-with-long-presses/261012
94 | mode: restart
95 | max_exceeded: silent
96 | trigger:
97 | - platform: event
98 | event_type: zha_event
99 | event_data:
100 | device_id: !input remote
101 | action:
102 | - variables:
103 | command: '{{ trigger.event.data.command }}'
104 | - choose:
105 | - conditions:
106 | - '{{ command == ''on_short_release'' }}'
107 | sequence: !input button_1_single_press
108 | - conditions:
109 | - '{{ command == ''on_hold'' }}'
110 | sequence: !input button_1_long_press
111 | - conditions:
112 | - '{{ command == ''on_double_press'' }}'
113 | sequence: !input button_1_double_press
114 | - conditions:
115 | - '{{ command == ''up_short_release'' }}'
116 | sequence: !input button_2_single_press
117 | - conditions:
118 | - '{{ command == ''up_hold'' }}'
119 | sequence: !input button_2_long_press
120 | - conditions:
121 | - '{{ command == ''up_double_press'' }}'
122 | sequence: !input button_2_double_press
123 | - conditions:
124 | - '{{ command == ''down_short_release'' }}'
125 | sequence: !input button_3_single_press
126 | - conditions:
127 | - '{{ command == ''down_hold'' }}'
128 | sequence: !input button_3_long_press
129 | - conditions:
130 | - '{{ command == ''down_double_press'' }}'
131 | sequence: !input button_3_double_press
132 | - conditions:
133 | - '{{ command == ''off_short_release'' }}'
134 | sequence: !input button_4_single_press
135 | - conditions:
136 | - '{{ command == ''off_hold'' }}'
137 | sequence: !input button_4_long_press
138 | - conditions:
139 | - '{{ command == ''off_double_press'' }}'
140 | sequence: !input button_4_double_press
141 |
--------------------------------------------------------------------------------
/blueprints/automation/metbril/actionable_alert.yaml:
--------------------------------------------------------------------------------
1 | blueprint:
2 | name: Actionable Alert
3 | description: >
4 | Trigger an alert based on the state of a given sensor.
5 | An action is executed and repeats as long as the sensor is in the alert state.
6 | domain: automation
7 | # source_url: https://gist.github.com/pavax/08705e383bdd3b58ea7b75a1f01c7e54
8 | input:
9 | sensor_entity:
10 | name: Sensor Entity
11 | description: "Sensor that triggers an alert"
12 | default:
13 | selector:
14 | entity:
15 | alert_state:
16 | name: Sensor Alert state
17 | description: "Sensor state that triggers the alert notification"
18 | default: "on"
19 | initial_delay:
20 | name: Initial Alert Delay
21 | description: "Time to wait until an alert notification will be send (inital)"
22 | default: 120
23 | selector:
24 | number:
25 | min: 0
26 | max: 3600
27 | unit_of_measurement: seconds
28 | repeat_delay:
29 | name: Repeat Alert Delay
30 | description: "Time to wait until an alert notification will be send (subsequently)"
31 | default: 120
32 | selector:
33 | number:
34 | min: 0
35 | max: 3600
36 | unit_of_measurement: seconds
37 | max_alerts:
38 | name: Max Alert Notifications
39 | description: "How often should the alert get triggered while the alert is active"
40 | default: 3
41 | selector:
42 | number:
43 | min: 0
44 | max: 100
45 | unit_of_measurement: count
46 | notify_message:
47 | name: Notifcation Message (Optional)
48 | description: 'Default: "Alert {{ entity_name }} triggered"'
49 | default: "Alert {{ entity_name }} triggered"
50 | resolved_message:
51 | name: Message when the alert is resolved (Optional)
52 | description: 'Default: "Alert {{ entity_name }} resolved"'
53 | default: "Alert {{ entity_name }} resolved"
54 | alert_action:
55 | name: Alert Action (Optional)
56 | description: "Action to run while the alert is active. You can reuse the {{ notify_message }} variable"
57 | default: []
58 | selector:
59 | action:
60 | resolved_action:
61 | name: Resolved Action (Optional)
62 | description: "Action to run after an alert was resolved. You can reuse the {{ resolved_message }} variable"
63 | default: []
64 | selector:
65 | action:
66 | dismiss_entity:
67 | name: Dismiss Alert (Optional)
68 | description: "Input Boolean to dismiss an alert"
69 | default:
70 | selector:
71 | entity:
72 | domain: input_boolean
73 | condition_entity:
74 | name: Condition Entity (Optional)
75 | description: "Condition Entity before an alert gets triggered"
76 | default:
77 | selector:
78 | entity:
79 | condition_entity_state:
80 | name: Condition Entity state (Optional)
81 | description: "State of the condition entity"
82 | default: "on"
83 |
84 | mode: restart
85 | max_exceeded: silent
86 |
87 | variables:
88 | sensor_entity: !input sensor_entity
89 | notify_message: !input notify_message
90 | resolved_message: !input resolved_message
91 | entity_name: "{{ state_attr(sensor_entity,'friendly_name') }}"
92 | alert_action: !input alert_action
93 | alert_state: !input alert_state
94 | dismiss_entity: !input dismiss_entity
95 | resolved_action: !input resolved_action
96 | send_notification: "false"
97 | initial_delay: !input initial_delay
98 | repeat_delay: !input repeat_delay
99 | condition_entity: !input condition_entity
100 | condition_entity_state: !input condition_entity_state
101 |
102 | trigger:
103 | - platform: state
104 | entity_id: !input sensor_entity
105 | to: !input alert_state
106 | - platform: homeassistant
107 | event: start
108 |
109 | condition:
110 | - condition: template
111 | value_template: "{{ is_state(sensor_entity, alert_state) }}"
112 | - condition: template
113 | value_template: "{{ condition_entity == None or is_state(condition_entity, condition_entity_state) }}"
114 |
115 | action:
116 | - choose:
117 | - conditions: "{{ dismiss_entity != None }}"
118 | sequence:
119 | - service: input_boolean.turn_on
120 | data:
121 | entity_id: !input dismiss_entity
122 |
123 | # Initial Wait
124 | - wait_for_trigger:
125 | - platform: template
126 | value_template: "{{ not is_state(sensor_entity, alert_state)}}"
127 | - platform: template
128 | value_template: "{{ dismiss_entity != None and not is_state(dismiss_entity, 'on') }}"
129 | timeout: !input initial_delay
130 |
131 | # None = alert was not resolved or dimissed in the specified wait-time thus we need to send notifications.
132 | - variables:
133 | send_notification: "{{ wait.trigger == None }}"
134 |
135 | - repeat:
136 | count: !input max_alerts
137 | sequence:
138 | - variables:
139 | repeat_count: "{{ repeat.index }}"
140 |
141 | # Break conditions (aka. stop the loop)
142 | - condition: template
143 | value_template: "{{ is_state(sensor_entity, alert_state)}}"
144 | - condition: template
145 | value_template: "{{ dismiss_entity == None or is_state(dismiss_entity, 'on') }}"
146 |
147 | # Notification Actions
148 | - choose:
149 | - conditions: "{{ alert_action is defined and alert_action|length > 0 }}"
150 | sequence: !input alert_action
151 | # Wait
152 | - wait_for_trigger:
153 | - platform: template
154 | value_template: "{{ not is_state(sensor_entity, alert_state)}}"
155 | - platform: template
156 | value_template: "{{ dismiss_entity != None and not is_state(dismiss_entity, 'on') }}"
157 | timeout: !input repeat_delay
158 |
159 | # Repeat finished
160 | - choose:
161 | # If Alert was dismissed
162 | - conditions: "{{ send_notification and dismiss_entity != None and not is_state(dismiss_entity, 'on') }}"
163 | sequence:
164 | - service: system_log.write
165 | data:
166 | message: "Alert {{ entity_name }} dismissed"
167 | level: warning
168 | # If Alert was resolved
169 | - conditions: "{{ send_notification and not is_state(sensor_entity, alert_state) }}"
170 | sequence:
171 | - choose:
172 | - conditions: "{{ resolved_action is defined and resolved_action|length > 0 }}"
173 | sequence: !input resolved_action
174 | - choose:
175 | - conditions: "{{ dismiss_entity != None }}"
176 | sequence:
177 | - service: input_boolean.turn_off
178 | data:
179 | entity_id: !input dismiss_entity
180 |
--------------------------------------------------------------------------------
/blueprints/automation/metbril/always_on.yaml:
--------------------------------------------------------------------------------
1 | blueprint:
2 | name: Always On
3 | description: Always keep on a switch. If it is turned off, then turn it back on.
4 | source_url: https://github.com/metbril/home-assistant-blueprints/blob/main/automation/always_on.yaml
5 | domain: automation
6 | input:
7 | target_entity:
8 | name: Entity to always keep on
9 | selector:
10 | entity:
11 | domain:
12 | - light
13 | - switch
14 | - input_boolean
15 | multiple: false
16 | on_duration:
17 | name: Duration before target entity is switched off
18 | selector:
19 | duration: {}
20 | trigger:
21 | - platform: state
22 | entity_id: !input target_entity
23 | from: 'on'
24 | to: 'off'
25 | for: !input on_duration
26 | id: by_entity
27 | - platform: homeassistant
28 | event: start
29 | id: by_start
30 | condition:
31 | - condition: state
32 | entity_id: !input target_entity
33 | state: 'off'
34 | action:
35 | - variables:
36 | target_entity: !input target_entity
37 | - service: homeassistant.turn_on
38 | target:
39 | entity_id: '{{ target_entity }}'
40 | - service: persistent_notification.create
41 | data:
42 | message: 'Automation switched on entity: {{ state_attr(target_entity, ''friendly_name'')
43 | }}'
44 | mode: single
45 |
--------------------------------------------------------------------------------
/blueprints/automation/metbril/appliance_has_finished.yaml:
--------------------------------------------------------------------------------
1 | ## Perform actions when an appliance has finished
2 | ##
3 | ## This blueprint is my improved version of an original blueprint by @sbyx:
4 | ## - Hysteresis presented as a duration selector. (https://www.home-assistant.io/docs/blueprint/selectors/#duration-selector)
5 | ## - Entities limited to power sensors by device class (https://www.home-assistant.io/docs/blueprint/selectors/#device_class)
6 | ##
7 | ## Original blueprint:
8 | ## https://gist.github.com/sbyx/6d8344d3575c9865657ac51915684696
9 | ##
10 | ## Community thread:
11 | ## https://community.home-assistant.io/t/notify-or-do-something-when-an-appliance-like-a-dishwasher-or-washing-machine-finishes/254841
12 | ##
13 |
14 | blueprint:
15 | name: Appliance has finished
16 | description: Perform one or more actions when an appliance
17 | (like a washing machine or dishwasher)
18 | has started and finished as detected by a power sensor.
19 | source_url: https://github.com/metbril/home-assistant-blueprints/blob/main/automation/appliance_has_finished.yaml
20 | domain: automation
21 |
22 | input:
23 | power_sensor:
24 | name: Power Sensor
25 | description: Power sensor entity (e.g. from a smart plug device).
26 | selector:
27 | entity:
28 | domain: sensor
29 | device_class: power
30 | multiple: false
31 |
32 | energy_sensor:
33 | name: Energy Sensor
34 | description: Energy sensor entity (e.g. from a smart plug device).
35 | selector:
36 | entity:
37 | domain: sensor
38 | device_class: energy
39 | multiple: false
40 |
41 | price_sensor:
42 | name: Energy Price Sensor
43 | description: Peak price energy sensor entity.
44 | selector:
45 | entity:
46 | domain: sensor
47 | multiple: false
48 |
49 | starting_threshold:
50 | name: Starting power threshold
51 | description: Power threshold above which we assume the appliance has started.
52 | default: 5
53 | selector:
54 | number:
55 | min: 1.0
56 | max: 100.0
57 | step: 1.0
58 | unit_of_measurement: W
59 | mode: slider
60 |
61 | starting_hysteresis:
62 | name: Starting hysteresis
63 | description: Time duration the power measurement has to stay above the starting
64 | power threshold.
65 | default:
66 | minutes: 5
67 | selector:
68 | duration:
69 |
70 | finishing_threshold:
71 | name: Finishing power threshold
72 | description: Power threshold below which we assume the appliance has finished.
73 | default: 5
74 | selector:
75 | number:
76 | min: 1.0
77 | max: 100.0
78 | unit_of_measurement: W
79 | mode: slider
80 | step: 1.0
81 |
82 | finishing_hysteresis:
83 | name: Finishing hysteresis
84 | description: Time duration the power measurement has to stay below the finishing
85 | power threshold.
86 | default:
87 | minutes: 5
88 | selector:
89 | duration:
90 |
91 | wait_timeout:
92 | name: Wait timeout
93 | description: Time duration the automation is waiting for the appliance to finish.
94 | power threshold.
95 | selector:
96 | duration:
97 | default:
98 | hours: 2
99 |
100 | actions:
101 | name: Actions
102 | description: Actions when appliance has finished (e.g. pushing a notification, TTS announcement, ...)
103 | selector:
104 | action: {}
105 | pre_actions:
106 | name: Actions
107 | description: Actions when starting threshhold is crossed
108 | selector:
109 | action: {}
110 |
111 | trigger:
112 | - platform: numeric_state
113 | entity_id: !input power_sensor
114 | for:
115 | !input starting_hysteresis
116 | above: !input starting_threshold
117 |
118 | condition: []
119 |
120 | action:
121 | - choose: []
122 | default: !input pre_actions
123 |
124 | - wait_for_trigger:
125 | - platform: numeric_state
126 | entity_id: !input power_sensor
127 | below: !input finishing_threshold
128 | for:
129 | !input finishing_hysteresis
130 | timeout: !input wait_timeout
131 | continue_on_timeout: false
132 |
133 | - choose: []
134 | default: !input actions
135 |
136 | mode: single
137 | max_exceeded: silent
--------------------------------------------------------------------------------
/blueprints/automation/metbril/appliance_running.yaml:
--------------------------------------------------------------------------------
1 | ## Running a household appliance
2 | ##
3 | blueprint:
4 | name: Appliance Running
5 | description: Perform actions when a household appliance
6 | (like a washing machine or dishwasher) has started or finished
7 | as detected by a power sensor.
8 | source_url: https://github.com/metbril/home-assistant-blueprints/blob/main/automation/appliance_running.yaml
9 | domain: automation
10 |
11 | input:
12 | power_sensor:
13 | name: Power Sensor
14 | description: Power sensor entity (e.g. from a smart plug device).
15 | selector:
16 | entity:
17 | domain: sensor
18 | device_class: power
19 | multiple: false
20 |
21 | starting_threshold:
22 | name: Starting power threshold
23 | description: Power threshold above which we assume the appliance has started.
24 | default: 5
25 | selector:
26 | number:
27 | min: 1.0
28 | max: 100.0
29 | step: 1.0
30 | unit_of_measurement: W
31 | mode: slider
32 |
33 | starting_hysteresis:
34 | name: Starting hysteresis
35 | description:
36 | Time duration the power measurement has to stay above the starting
37 | power threshold.
38 | default:
39 | minutes: 5
40 | selector:
41 | duration:
42 |
43 | finishing_threshold:
44 | name: Finishing power threshold
45 | description: Power threshold below which we assume the appliance has finished.
46 | default: 5
47 | selector:
48 | number:
49 | min: 1.0
50 | max: 100.0
51 | unit_of_measurement: W
52 | mode: slider
53 | step: 1.0
54 |
55 | finishing_hysteresis:
56 | name: Finishing hysteresis
57 | description:
58 | Time duration the power measurement has to stay below the finishing
59 | power threshold.
60 | default:
61 | minutes: 5
62 | selector:
63 | duration:
64 |
65 | starting_actions:
66 | name: Starting Actions
67 | description: Actions when starting threshhold is crossed.
68 | To skip, enter a 'Wait for delay' action of `0` seconds.
69 | selector:
70 | action: {}
71 |
72 | finishing_actions:
73 | name: Finishing Actions
74 | description: Actions (e.g. pushing a notification, TTS announcement, ...)
75 | To skip, enter a 'Wait for delay' action of `0` seconds.
76 | selector:
77 | action: {}
78 |
79 | mode: single
80 | max_exceeded: silent
81 |
82 | trigger:
83 | - id: started
84 | platform: numeric_state
85 | entity_id: !input power_sensor
86 | for: !input starting_hysteresis
87 | above: !input starting_threshold
88 |
89 | - id: finished
90 | platform: numeric_state
91 | entity_id: !input power_sensor
92 | for: !input starting_hysteresis
93 | below: !input finishing_threshold
94 |
95 | condition: []
96 |
97 | action:
98 | - choose:
99 | - conditions:
100 | - condition: trigger
101 | id: started
102 | sequence: !input starting_actions
103 |
104 | - conditions:
105 | - condition: trigger
106 | id: finished
107 | sequence: !input finishing_actions
108 |
--------------------------------------------------------------------------------
/blueprints/automation/metbril/zha_ikea_tradfri_2button_onoff_brightness.yaml:
--------------------------------------------------------------------------------
1 | blueprint:
2 | source_url: https://github.com/metbril/home-assistant-blueprints/blob/main/automation/zha_ikea_tradfri_2button_onoff_brightness.yaml
3 | name: ZHA - IKEA TRADFRI - 2 Button Remote - On/Off and Brightness
4 | description: Simulate IKEA TRADFRI 2 button remote connected through ZHA.
5 | domain: automation
6 | input:
7 | remote:
8 | name: IKEA TRADFRI remote control
9 | description: Select the remote control to use.
10 | selector:
11 | device:
12 | integration: zha
13 | manufacturer: IKEA of Sweden
14 | model: TRADFRI on/off switch
15 | multiple: false
16 | light:
17 | name: Light
18 | description: Select the light entity to control.
19 | selector:
20 | entity:
21 | domain: light
22 | multiple: false
23 | speed:
24 | name: Speed
25 | description: The speed in which to update the light when the button is held.
26 | selector:
27 | number:
28 | min: 100.0
29 | max: 1000.0
30 | step: 100.0
31 | unit_of_measurement: milliseconds
32 | mode: slider
33 | default: 500
34 | mode: restart
35 | max_exceeded: silent
36 | variables:
37 | var_speed: !input speed
38 | transition_speed: '{{ (var_speed / 1000) | float(0) }}'
39 | trigger:
40 | - platform: event
41 | event_type: zha_event
42 | event_data:
43 | device_id: !input remote
44 | action:
45 | - choose:
46 | - conditions: '{{ trigger.event.data.command == "on" }}'
47 | sequence:
48 | - service: light.turn_on
49 | target:
50 | entity_id: !input light
51 | data:
52 | transition: '{{ transition_speed }}'
53 | - conditions: '{{ trigger.event.data.command == "move_with_on_off" }}'
54 | sequence:
55 | - repeat:
56 | while: []
57 | sequence:
58 | - service: light.turn_on
59 | target:
60 | entity_id: !input light
61 | data:
62 | brightness_step_pct: 10
63 | transition: '{{ transition_speed }}'
64 | - delay:
65 | milliseconds: !input speed
66 | - conditions: '{{ trigger.event.data.command == "off" }}'
67 | sequence:
68 | - service: light.turn_off
69 | target:
70 | entity_id: !input light
71 | data:
72 | transition: '{{ transition_speed }}'
73 | - conditions: '{{ trigger.event.data.command == "move" }}'
74 | sequence:
75 | - repeat:
76 | while: []
77 | sequence:
78 | - service: light.turn_on
79 | target:
80 | entity_id: !input light
81 | data:
82 | brightness_step_pct: -10
83 | transition: '{{ transition_speed }}'
84 | - delay:
85 | milliseconds: !input speed
86 | default: []
87 |
--------------------------------------------------------------------------------
/blueprints/automation/michal-stelmach/meteoalarm_mobile.yaml:
--------------------------------------------------------------------------------
1 | blueprint:
2 | name: MeteoAlarm notification
3 | description: 'Modified for official HA MeteoAlarm integration
4 |
5 | Send a notification when there''s new weather aleft form MeteoAlarm
6 |
7 |
8 | Available message elements:
9 |
10 | - {{ alert_name }} = Event,
11 |
12 | - {{ alert_level }} = Awerness level,
13 |
14 | - {{ alert_type }} = Awerness type,
15 |
16 | - {{ alert_issued }} = Effective,
17 |
18 | - {{ alert_start }} = Onset,
19 |
20 | - {{ alert_end }} = Expires,
21 |
22 | - {{ alert_content }} = Descrpition,
23 |
24 | - {{ alert_instruction }} = Instruction
25 |
26 | '
27 | domain: automation
28 | input:
29 | alert:
30 | name: MeteoAlarm sensor
31 | description: The sensor which indicates if there's an alert
32 | selector:
33 | entity:
34 | domain: binary_sensor
35 | notification_title:
36 | name: Notification title
37 | description: 'Default: "{{ alert_name }}"'
38 | default: '{{ alert_name }}'
39 | include_whole_alert:
40 | name: Include detailed data from alert
41 | description: 'Toggle if you''d like to receive whole alert within the notification,
42 | default is true; When false only alert level and alert type will be send
43 |
44 | '
45 | selector:
46 | boolean: {}
47 | default: true
48 | custom_message:
49 | name: Send alert with custom message
50 | description: Toggle if you'd like to customize notification, default is false
51 | selector:
52 | boolean: {}
53 | default: false
54 | notification_message:
55 | name: Custom notification message (optional)
56 | description: Create customized message
57 | default: '{{ alert_type }}: {{ alert_start }}-{{ alert_end }}: {{ alert_content }}'
58 | notify_device:
59 | name: Device to notify
60 | description: Choose device that runs official HA app
61 | selector:
62 | device:
63 | integration: mobile_app
64 | source_url: https://gist.github.com/michal-stelmach/4e51717da785945c4befb4d830e91d35
65 | trigger:
66 | platform: state
67 | entity_id: !input 'alert'
68 | to: 'on'
69 | variables:
70 | alert: !input 'alert'
71 | alert_name: '{{ states[alert].attributes.event }}'
72 | alert_issued: '{{ as_datetime(states[alert].attributes.effective).strftime(''%d.%m.%Y
73 | %H:%M'') }}'
74 | alert_start: '{{ as_datetime(states[alert].attributes.onset).strftime(''%d.%m.%Y
75 | %H:%M'') }}'
76 | alert_end: '{{ as_datetime(states[alert].attributes.expires).strftime(''%d.%m.%Y
77 | %H:%M'') }}'
78 | alert_type: '{{ states[alert].attributes.awareness_type.title()|regex_replace(find=''[1-9];
79 | '', replace='''', ignorecase=True) }}'
80 | alert_level: '{{ states[alert].attributes.awareness_level.title()|regex_replace(find=''[1-9];
81 | '', replace='''', ignorecase=True)|regex_replace(find=''; [a-z]*'', replace='''',
82 | ignorecase=True) }}'
83 | alert_content: '{{ states[alert].attributes.description }}'
84 | alert_instruction: '{{ states[alert].attributes.instruction }}'
85 | include_whole_alert: !input 'include_whole_alert'
86 | notification_title: !input 'notification_title'
87 | custom_message: !input 'custom_message'
88 | notification_message: !input 'notification_message'
89 | notify_device: !input 'notify_device'
90 | action:
91 | - device_id: !input 'notify_device'
92 | domain: mobile_app
93 | type: notify
94 | title: '{{ notification_title }}'
95 | message: "{% if include_whole_alert %}\n{% if custom_message %}\n{{ notification_message\
96 | \ }}\n{% else %}\n{{ alert_level }} MeteoAlarm: {{ alert_type }} :: \nFrom {{\
97 | \ alert_start }} To {{ alert_end }} :: \n{{ alert_content }}\n{% endif %}\n\
98 | {% else %}\nMeteoAlarm: {{ alert_level }}: {{ alert_type }}\n{% endif %}\n"
99 |
--------------------------------------------------------------------------------
/blueprints/automation/niro1987/lightsaver.yaml:
--------------------------------------------------------------------------------
1 | blueprint:
2 | source_url: https://github.com/niro1987/homeassistant-config/blob/main/blueprints/automation/niro1987/lightsaver.yaml
3 | name: Lightsaver
4 | description: Turn off the lights in a room when unnecessary. Requires the `sun`
5 | integration.
6 | domain: automation
7 | input:
8 | light:
9 | name: Light
10 | description: The light entity to turn off.
11 | selector:
12 | entity:
13 | domain: light
14 | multiple: false
15 | off_delay:
16 | name: Off Delay
17 | description: The time in minutes before the light turns off.
18 | selector:
19 | number:
20 | step: 1.0
21 | min: 1.0
22 | max: 60.0
23 | mode: slider
24 | unit_of_measurement: minutes
25 | default: 5
26 | sunrise_delay:
27 | name: Sunrise Delay
28 | description: The time in minutes after sunrise and before sunset in between
29 | of wich the lights should be turned off.
30 | selector:
31 | number:
32 | step: 1.0
33 | min: 1.0
34 | max: 60.0
35 | mode: slider
36 | unit_of_measurement: minutes
37 | default: 5
38 | sunset_delay:
39 | name: Sunset Delay
40 | description: The time in minutes after sunrise and before sunset in between
41 | of wich the lights should be turned off.
42 | selector:
43 | number:
44 | step: 1.0
45 | min: -60.0
46 | max: -1.0
47 | mode: slider
48 | unit_of_measurement: minutes
49 | default: -5
50 | mode: single
51 | max_exceeded: silent
52 | trigger:
53 | - platform: state
54 | entity_id: !input light
55 | to: 'on'
56 | for:
57 | minutes: !input off_delay
58 | condition:
59 | - condition: sun
60 | after: sunrise
61 | after_offset:
62 | minutes: !input sunrise_delay
63 | - condition: sun
64 | before: sunset
65 | before_offset:
66 | minutes: !input sunset_delay
67 | action:
68 | - service: light.turn_off
69 | target:
70 | entity_id: !input light
71 |
--------------------------------------------------------------------------------
/blueprints/automation/samnewman86/another-deconz-ikea-5-button-remote-blueprint-this-time-with-long-press-on-all-buttons.yaml:
--------------------------------------------------------------------------------
1 | blueprint:
2 | name: deCONZ - IKEA five button remote
3 | description: 'Control anything using IKEA five button remote
4 |
5 | '
6 | domain: automation
7 | input:
8 | remote:
9 | name: Remote
10 | description: IKEA remote to use
11 | selector:
12 | device:
13 | integration: deconz
14 | manufacturer: IKEA of Sweden
15 | model: TRADFRI remote control
16 | multiple: false
17 | button_on_off_short:
18 | name: On off button short press
19 | description: Action to run on press on off button
20 | default: []
21 | selector:
22 | action: {}
23 | button_on_off_long:
24 | name: On off button long press
25 | description: Action to run on press on off button
26 | default: []
27 | selector:
28 | action: {}
29 | button_brightness_up_short:
30 | name: Brightness up button - short press
31 | description: Action to run on short brightness up press
32 | default: []
33 | selector:
34 | action: {}
35 | button_brightness_up_long:
36 | name: Brightness up button - long press
37 | description: Action to run on long brightness up press
38 | default: []
39 | selector:
40 | action: {}
41 | button_brightness_up_long_release:
42 | name: Brightness up button - long press release
43 | description: Action to run on long brightness up release
44 | default: []
45 | selector:
46 | action: {}
47 | button_brightness_down_short:
48 | name: Brightness down button - short press
49 | description: Action to run on short brightness down press
50 | default: []
51 | selector:
52 | action: {}
53 | button_brightness_down_long:
54 | name: Brightness down button - long press
55 | description: Action to run on long brightness down press
56 | default: []
57 | selector:
58 | action: {}
59 | button_brightness_down_long_release:
60 | name: Brightness down button - long press release
61 | description: Action to run on long brightness down release
62 | default: []
63 | selector:
64 | action: {}
65 | button_left_short:
66 | name: Left button - short press
67 | description: Action to run on short left button press
68 | default: []
69 | selector:
70 | action: {}
71 | button_left_long:
72 | name: Left button - long press
73 | description: Action to run on long left button press
74 | default: []
75 | selector:
76 | action: {}
77 | button_right_short:
78 | name: Right button - short press
79 | description: Action to run on short right button press
80 | default: []
81 | selector:
82 | action: {}
83 | button_right_long:
84 | name: Right button - long press
85 | description: Action to run on long right button press
86 | default: []
87 | selector:
88 | action: {}
89 | source_url: https://community.home-assistant.io/t/another-deconz-ikea-5-button-remote-blueprint-this-time-with-long-press-on-all-buttons/258743
90 | mode: restart
91 | max_exceeded: silent
92 | trigger:
93 | - platform: event
94 | event_type: deconz_event
95 | event_data:
96 | device_id: !input remote
97 | action:
98 | - variables:
99 | event: '{{ trigger.event.data.event }}'
100 | - choose:
101 | - conditions:
102 | - '{{ event == 1002 }}'
103 | sequence: !input button_on_off_short
104 | - conditions:
105 | - '{{ event == 1001 }}'
106 | sequence: !input button_on_off_long
107 | - conditions:
108 | - '{{ event == 2003 }}'
109 | sequence: !input button_brightness_up_long_release
110 | - conditions:
111 | - '{{ event == 2002 }}'
112 | sequence: !input button_brightness_up_short
113 | - conditions:
114 | - '{{ event == 2001 }}'
115 | sequence: !input button_brightness_up_long
116 | - conditions:
117 | - '{{ event == 3003 }}'
118 | sequence: !input button_brightness_down_long_release
119 | - conditions:
120 | - '{{ event == 3002 }}'
121 | sequence: !input button_brightness_down_short
122 | - conditions:
123 | - '{{ event == 3001 }}'
124 | sequence: !input button_brightness_down_long
125 | - conditions:
126 | - '{{ event == 4002 }}'
127 | sequence: !input button_left_short
128 | - conditions:
129 | - '{{ event == 4001 }}'
130 | sequence: !input button_left_long
131 | - conditions:
132 | - '{{ event == 5002 }}'
133 | sequence: !input button_right_short
134 | - conditions:
135 | - '{{ event == 5001 }}'
136 | sequence: !input button_right_long
137 |
--------------------------------------------------------------------------------
/blueprints/automation/sbyx/low-battery-level-detection-notification-for-all-battery-sensors.yaml:
--------------------------------------------------------------------------------
1 | blueprint:
2 | name: Low battery level detection & notification for all battery sensors
3 | description: Regularly test all sensors with 'battery' device-class for crossing
4 | a certain battery level threshold and if so execute an action.
5 | domain: automation
6 | input:
7 | threshold:
8 | name: Battery warning level threshold
9 | description: Battery sensors below threshold are assumed to be low-battery (as
10 | well as binary battery sensors with value 'on').
11 | default: 20
12 | selector:
13 | number:
14 | min: 5.0
15 | max: 100.0
16 | unit_of_measurement: '%'
17 | mode: slider
18 | step: 5.0
19 | time:
20 | name: Time to test on
21 | description: Test is run at configured time
22 | default: '10:00:00'
23 | selector:
24 | time: {}
25 | day:
26 | name: Weekday to test on
27 | description: 'Test is run at configured time either everyday (0) or on a given
28 | weekday (1: Monday ... 7: Sunday)'
29 | default: 0
30 | selector:
31 | number:
32 | min: 0.0
33 | max: 7.0
34 | mode: slider
35 | step: 1.0
36 | exclude:
37 | name: Excluded Sensors
38 | description: Battery sensors (e.g. smartphone) to exclude from detection. Only
39 | entities are supported, devices must be expanded!
40 | default:
41 | entity_id: []
42 | selector:
43 | target:
44 | entity:
45 | device_class: battery
46 | actions:
47 | name: Actions
48 | description: Notifications or similar to be run. {{sensors}} is replaced with
49 | the names of sensors being low on battery.
50 | selector:
51 | action: {}
52 | source_url: https://gist.github.com/sbyx/1f6f434f0903b872b84c4302637d0890
53 | variables:
54 | day: !input day
55 | threshold: !input threshold
56 | exclude: !input exclude
57 | sensors: "{% set result = namespace(sensors=[]) %} {% for state in states.sensor
58 | | selectattr('attributes.device_class', '==', 'battery') %}\n {% if 0 <= state.state
59 | | int(-1) < threshold | int and not state.entity_id in exclude.entity_id %}\n
60 | \ {% set result.sensors = result.sensors + [state.name ~ ' (' ~ state.state
61 | ~ ' %)'] %}\n {% endif %}\n{% endfor %} {% for state in states.binary_sensor
62 | | selectattr('attributes.device_class', '==', 'battery') | selectattr('state',
63 | '==', 'on') %}\n {% if not state.entity_id in exclude.entity_id %}\n {% set
64 | result.sensors = result.sensors + [state.name] %}\n {% endif %}\n{% endfor %}
65 | {{result.sensors|join(', ')}}"
66 | trigger:
67 | - platform: time
68 | at: !input time
69 | condition:
70 | - '{{ sensors != '''' and (day | int == 0 or day | int == now().isoweekday()) }}'
71 | action:
72 | - choose: []
73 | default: !input actions
74 | mode: single
75 |
--------------------------------------------------------------------------------
/blueprints/automation/seamus65/zha-ikea-symfonisk-sound-controller-for-media-the-spinny-one.yaml:
--------------------------------------------------------------------------------
1 | blueprint:
2 | name: ZHA - IKEA Symfonisk sound controller for media
3 | description: 'Control media with an IKEA Symfonisk sound controller (the spinny
4 | ones).
5 |
6 | Single press will toggle Play/Pause on your selected media player.
7 |
8 | You can set functions for double press and triple press.
9 |
10 | Rotating left/right will change the volume smoothly of the selected media player,
11 | if that function is possible.'
12 | domain: automation
13 | input:
14 | remote:
15 | name: Remote
16 | description: IKEA Symfonisk controller to use
17 | selector:
18 | device:
19 | integration: zha
20 | manufacturer: IKEA of Sweden
21 | model: SYMFONISK Sound Controller
22 | media_player:
23 | name: Media Player
24 | description: The media player to control
25 | selector:
26 | target:
27 | entity:
28 | domain: media_player
29 | double_press:
30 | name: Double press
31 | description: Action to run on double press
32 | default: []
33 | selector:
34 | action: {}
35 | triple_press:
36 | name: Triple press
37 | description: Action to run on triple press
38 | default: []
39 | selector:
40 | action: {}
41 | source_url: https://community.home-assistant.io/t/zha-ikea-symfonisk-sound-controller-for-media-the-spinny-one/266130
42 | mode: single
43 | max_exceeded: silent
44 | trigger:
45 | - platform: event
46 | event_type: zha_event
47 | event_data:
48 | device_id: !input 'remote'
49 | action:
50 | - variables:
51 | command: '{{ trigger.event.data.command }}'
52 | cluster_id: '{{ trigger.event.data.cluster_id }}'
53 | endpoint_id: '{{ trigger.event.data.endpoint_id }}'
54 | args: '{{ trigger.event.data.args }}'
55 | - choose:
56 | - conditions:
57 | - '{{ command == ''toggle'' }}'
58 | - '{{ cluster_id == 6 }}'
59 | - '{{ endpoint_id == 1 }}'
60 | sequence:
61 | - service: media_player.media_play_pause
62 | target: !input 'media_player'
63 | - conditions:
64 | - '{{ command == ''step'' }}'
65 | - '{{ cluster_id == 8 }}'
66 | - '{{ endpoint_id == 1 }}'
67 | - '{{ args == [0, 1, 0] }}'
68 | sequence: !input 'double_press'
69 | - conditions:
70 | - '{{ command == ''step'' }}'
71 | - '{{ cluster_id == 8 }}'
72 | - '{{ endpoint_id == 1 }}'
73 | - '{{ args == [1, 1, 0] }}'
74 | sequence: !input 'triple_press'
75 | - conditions:
76 | - '{{ command == ''move'' }}'
77 | - '{{ cluster_id == 8 }}'
78 | - '{{ endpoint_id == 1 }}'
79 | - '{{ args == [0, 195] }}'
80 | sequence:
81 | - service: media_player.volume_up
82 | target: !input 'media_player'
83 | - delay: 1
84 | - conditions:
85 | - '{{ command == ''move'' }}'
86 | - '{{ cluster_id == 8 }}'
87 | - '{{ endpoint_id == 1 }}'
88 | - '{{ args == [1, 195] }}'
89 | sequence:
90 | - service: media_player.volume_down
91 | target: !input 'media_player'
92 | - delay: 1
93 |
--------------------------------------------------------------------------------
/blueprints/script/Talvish/sonos_say.yaml:
--------------------------------------------------------------------------------
1 | blueprint:
2 | name: Text-to-Speech on Sonos
3 | description: 'This blueprint is used to add a script that will say messages on Sonos
4 | speakers. The script handles oddities to ensure a proper experience including
5 | saving/restore state, handling speaker groups, pausing music, disabling repeat,
6 | adding delays, etc.
7 |
8 | I recommend setting the mode to parallel if you will use this script on more than
9 | one speaker.'
10 | domain: script
11 | input:
12 | tts_service_name:
13 | name: Text-To-Speech Service Name
14 | description: The text-to-speech service to use when saying the message. This
15 | must match your Home Assistant configuration.
16 | default: google_translate_say
17 | selector:
18 | text: {}
19 | tts_language:
20 | name: Language
21 | description: The language to use with the text-to-speech service.
22 | default: en
23 | selector:
24 | text: {}
25 | source_url: https://github.com/Talvish/home-assistant-blueprints/blob/main/script/sonos_say.yaml
26 | fields:
27 | entity_id:
28 | description: The entity id of the Sonos speaker that will play the message.
29 | name: Entity
30 | required: true
31 | selector:
32 | entity:
33 | domain: media_player
34 | integration: sonos
35 | message:
36 | description: The text that will be played.
37 | name: Message
38 | required: true
39 | selector:
40 | text:
41 | volume_level:
42 | name: Volume Level
43 | description: Float for volume level. Range 0..1. If value isn't given, volume
44 | isn't changed. The volume will revert to the previous level after it plays the
45 | message.
46 | required: false
47 | selector:
48 | number:
49 | min: 0
50 | max: 1
51 | step: 0.01
52 | mode: slider
53 | max_wait:
54 | name: Maximum Wait
55 | description: The maximum number of seconds that the system will wait for the message
56 | to play before continuing with the script. If the value is too short, the message
57 | may get cut off. If this value isn't given, the system will calculate a value
58 | based on the length of the string. This is likely fine for languages such as
59 | English and French, but likely too short for languages such as Chinese.
60 | required: false
61 | selector:
62 | number:
63 | min: 1
64 | max: 60
65 | step: 0.25
66 | unit_of_measurement: seconds
67 | mode: slider
68 | variables:
69 | entity_group_leader: "{# we see if in a group since the repeat is typically controlled
70 | by it #} {# we use this for doing all the work since it is the primary speaker
71 | #} {# and everything will be shared across speakers anyhow #} {%- set group_members
72 | = state_attr( entity_id, \"group_members\" ) -%} {%- if group_members == None
73 | -%}\n {# we maybe on an older version of HA, so look for a different group name#}\n
74 | \ {%- set group_members = state_attr( entity_id, \"sonos_group\" ) -%}\n {%-
75 | if group_members == None -%}\n {{ entity_id }}\n {%- else -%}\n {{ group_members[0]
76 | }}\n {%- endif -%}\n{%- else -%}\n {# the first seems to be the control, at
77 | least on Sonos #}\n {{ group_members[0] }}\n{%- endif -%}"
78 | entity_repeat_state: "{# we grab the repeat state so that if in repeat mode we turn
79 | off #} {# and also sanity check that we got a value otherwise default to off #}
80 | {%- set repeat = state_attr( entity_group_leader, \"repeat\" ) -%} {%- if repeat
81 | == None -%}\n off\n{%- else -%}\n {{ repeat }}\n{%- endif -%}"
82 | tts_hack: !input tts_service_name
83 | tts_engine: "{%- if tts_hack is undefined or tts_hack== None or tts_hack == \"\"
84 | -%}\n tts.google_translate_say\n{%- else -%}\n tts.{{ tts_hack }}\n{%- endif
85 | -%}"
86 | lang_hack: !input tts_language
87 | tts_language: "{%- if lang_hack is undefined or lang_hack== None or lang_hack ==
88 | \"\" -%}\n \"en\"\n{%- else -%}\n {{ lang_hack }}\n{%- endif -%}"
89 | fixed_delay: '{# we use a rough estimate of speaking 16 characters per second, which
90 | is #} {# high, but we put min of 1 second and max of 4 regardless for the fixed
91 | delay #} {# this fixed delay seems to increase the chance of proper playback #}
92 | {% set delay = ( message | length ) / 16 %} {{ delay if ( delay >= 1 and delay
93 | <= 4 ) else 4 if delay >= 4 else 1 }}'
94 | wait_delay: "{%- if max_wait is undefined or max_wait == None or not (max_wait is
95 | number) -%}\n {# if we have a bad or missing max_wait then we calculate something
96 | based #}\n {# on the number of characters, which is great more for western languages
97 | #}\n {# others may get cut off #}\n {% set delay = ( ( message | length ) /
98 | 10 ) - fixed_delay %}\n {{ delay if delay >= 1 else 1 }}\n{%- elif max_wait <
99 | 1 -%}\n 1\n{%- else -%}\n {{ max_wait }}\n{%- endif -%}"
100 | sequence:
101 | - service: sonos.snapshot
102 | data:
103 | entity_id: '{{ entity_group_leader }}'
104 | with_group: true
105 | - choose:
106 | - conditions: '{{ volume_level is defined }}
107 |
108 | '
109 | sequence:
110 | - choose:
111 | - conditions:
112 | - condition: template
113 | value_template: '{{ is_state(entity_group_leader, ''playing'') }}
114 |
115 | '
116 | sequence:
117 | - service: media_player.media_pause
118 | data:
119 | entity_id: '{{ entity_group_leader }}
120 |
121 | '
122 | - wait_template: '{{ states( entity_id ) != ''playing'' }}'
123 | timeout:
124 | seconds: 2
125 | default: []
126 | - service: media_player.volume_set
127 | data:
128 | volume_level: '{{ volume_level }}'
129 | entity_id: '{{ entity_id }}'
130 | - choose:
131 | - conditions: '{{ entity_repeat_state != "off" }}
132 |
133 | '
134 | sequence:
135 | - service: media_player.repeat_set
136 | data:
137 | repeat: 'off'
138 | entity_id: '{{ entity_group_leader }}'
139 | - wait_template: '{{ state_attr( entity_group_leader, ''repeat'' ) == ''off''
140 | }}'
141 | timeout:
142 | seconds: 4
143 | default: []
144 | - service: '{{ tts_engine }}'
145 | data:
146 | entity_id: '{{ entity_group_leader }}'
147 | message: '{{ message }}'
148 | language: '{{ tts_language }}'
149 | - service: media_player.repeat_set
150 | data:
151 | repeat: 'off'
152 | entity_id: '{{ entity_group_leader }}'
153 | - wait_template: '{{ states( entity_id ) == ''playing'' }}'
154 | timeout:
155 | seconds: 2
156 | - delay:
157 | seconds: '{{ fixed_delay | int }}
158 |
159 | '
160 | milliseconds: '{{ ( ( fixed_delay - ( fixed_delay | int ) ) * 1000 ) | int }}
161 |
162 | '
163 | - wait_template: '{{ states( entity_id ) != ''playing'' }}'
164 | timeout:
165 | seconds: '{{ wait_delay | int }}
166 |
167 | '
168 | milliseconds: '{{ ( ( wait_delay - ( wait_delay | int ) ) * 1000 ) | int }}
169 |
170 | '
171 | - service: sonos.restore
172 | data:
173 | entity_id: '{{ entity_group_leader }}'
174 | with_group: true
175 | mode: parallel
176 | max_exceeded: silent
177 | icon: mdi:account-voice
178 |
--------------------------------------------------------------------------------
/blueprints/script/homeassistant/confirmable_notification.yaml:
--------------------------------------------------------------------------------
1 | blueprint:
2 | name: Confirmable Notification
3 | description: >-
4 | A script that sends an actionable notification with a confirmation before
5 | running the specified action.
6 | domain: script
7 | source_url: https://github.com/home-assistant/core/blob/master/homeassistant/components/script/blueprints/confirmable_notification.yaml
8 | input:
9 | notify_device:
10 | name: Device to notify
11 | description: Device needs to run the official Home Assistant app to receive notifications.
12 | selector:
13 | device:
14 | integration: mobile_app
15 | title:
16 | name: "Title"
17 | description: "The title of the button shown in the notification."
18 | default: ""
19 | selector:
20 | text:
21 | message:
22 | name: "Message"
23 | description: "The message body"
24 | selector:
25 | text:
26 | confirm_text:
27 | name: "Confirmation Text"
28 | description: "Text to show on the confirmation button"
29 | default: "Confirm"
30 | selector:
31 | text:
32 | confirm_action:
33 | name: "Confirmation Action"
34 | description: "Action to run when notification is confirmed"
35 | default: []
36 | selector:
37 | action:
38 | dismiss_text:
39 | name: "Dismiss Text"
40 | description: "Text to show on the dismiss button"
41 | default: "Dismiss"
42 | selector:
43 | text:
44 | dismiss_action:
45 | name: "Dismiss Action"
46 | description: "Action to run when notification is dismissed"
47 | default: []
48 | selector:
49 | action:
50 |
51 | mode: restart
52 |
53 | sequence:
54 | - alias: "Send notification"
55 | domain: mobile_app
56 | type: notify
57 | device_id: !input notify_device
58 | title: !input title
59 | message: !input message
60 | data:
61 | actions:
62 | - action: "CONFIRM"
63 | title: !input confirm_text
64 | - action: "DISMISS"
65 | title: !input dismiss_text
66 | - alias: "Awaiting response"
67 | wait_for_trigger:
68 | - platform: event
69 | event_type: mobile_app_notification_action
70 | - choose:
71 | - conditions: "{{ wait.trigger.event.data.action == 'CONFIRM' }}"
72 | sequence: !input confirm_action
73 | - conditions: "{{ wait.trigger.event.data.action == 'DISMISS' }}"
74 | sequence: !input dismiss_action
75 |
--------------------------------------------------------------------------------
/configuration.yaml:
--------------------------------------------------------------------------------
1 | homeassistant:
2 | allowlist_external_dirs:
3 | - !secret allowlist_dir_config
4 | - !secret allowlist_dir_ssl
5 |
6 | customize: !include includes/customize.yaml
7 |
8 | customize_glob: !include includes/customize_glob.yaml
9 |
10 | default_config:
11 |
12 | automation: !include automations.yaml # UI editor
13 | scene: !include scenes.yaml # UI editor
14 | script: !include scripts.yaml # UI editor
15 |
16 | automation split: !include_dir_merge_list includes/automation
17 | alert: !include includes/alert.yaml
18 | climate: !include includes/climate.yaml
19 | group: !include includes/group.yaml
20 | logger: !include includes/logger.yaml
21 | notify: !include includes/notify.yaml
22 | rest_command: !include includes/rest_command.yaml
23 | sensor: !include_dir_merge_list includes/sensor
24 | template: !include_dir_merge_list includes/template
25 |
26 | frontend:
27 | themes: !include_dir_merge_named themes ## location needed for HACS
28 |
29 | http:
30 | ip_ban_enabled: true
31 | login_attempts_threshold: 3
32 |
33 | ios:
34 |
35 | recorder:
36 | auto_purge: true # default = true
37 | purge_keep_days: 7 # default = 10
38 | include:
39 | entities: []
40 | exclude:
41 | domains:
42 | # - device_tracker # for privacy
43 | entities: []
44 |
45 | wake_on_lan: # Required to power on WebOS TV
46 |
--------------------------------------------------------------------------------
/includes/alert.yaml:
--------------------------------------------------------------------------------
1 | # Alerts
2 | # https://www.home-assistant.io/integrations/alert/
3 |
4 | front_door:
5 | name: Voordeur is open
6 | done_message: Voordeur is gesloten
7 | entity_id: binary_sensor.front_door_contact
8 | state: "on"
9 | repeat:
10 | - 5
11 | - 10
12 | - 15
13 | - 30
14 | can_acknowledge: true
15 | skip_first: true
16 | notifiers:
17 | - robert
18 |
--------------------------------------------------------------------------------
/includes/automation/random_house_stats.yaml:
--------------------------------------------------------------------------------
1 | # Inspired by:
2 | # https://github.com/CCOSTAN/Home-AssistantConfig/blob/5c020091a89fac5e8419c97ad7df2d37341b91c3/config/packages/twitter.yaml
3 | #
4 | - alias: 'Toot: Random House stats'
5 | id: b274a40d-cb67-4d6a-94d1-5fa685ae5ea4
6 | initial_state: true
7 | mode: single
8 |
9 | trigger:
10 | - platform: time_pattern
11 | minutes: "0" # every hour at 0 minutes
12 |
13 | condition: []
14 |
15 | action:
16 | - delay:
17 | minutes: '{{ range(0,59) | random | int }}'
18 | - variables:
19 | pick: >-
20 | {{ [
21 | "robot",
22 | "host",
23 | "speedtest",
24 | "internet",
25 | "weather",
26 | "promo"
27 | ] | random }}
28 | message: >-
29 | {%- macro relative(dt) -%}
30 | {{ relative_time(dt)
31 | .replace('years','jaren')
32 | .replace('year','jaar')
33 | .replace('months',',maanden')
34 | .replace('month','maand')
35 | .replace('days','dagen')
36 | .replace('day','dag')
37 | .replace('hours','uren')
38 | .replace('hour','uur')
39 | .replace('minutes','minuten')
40 | .replace('minute','minuut')
41 | .replace('seconds','seconden')
42 | .replace('second','seconde')
43 | }}
44 | {%- endmacro -%}
45 | {{ {
46 | "robot": [
47 | "Biep-bop-biep-boep. Ik ben een #RoBot 🤖 bestuurd door @ro@mastodon.nl",
48 | "Home Assistant is beschikbaar sinds {{ relative(as_datetime(states('sensor.uptime'))) }} ⏱ geleden. (https://github.com/metbril/home-assistant-config)",
49 | "Home Assistant gebruikt momenteel {{ states('sensor.disk_use_percent') | replace('.', ',') }}% van de harde schijf. (https://github.com/metbril/home-assistant-config)",
50 | "Ik draai op Home Assistant versie {{ state_attr('update.home_assistant_core_update', 'installed_version') }} (https://github.com/metbril/home-assistant-config)",
51 | "{{ states('sensor.yaml_config_lines') }} regels Home Assistant configuratie draaien sinds {{ states('sensor.uptime') | as_timestamp | timestamp_custom('%d-%m-%Y %H:%M') }}. (https://github.com/metbril/home-assistant-config)",
52 | "Het Domus Sapiens huis draait nu op {{ states('sensor.yaml_config_lines') }} regels YAML-code. Neem een kijkje in mijn hoofd. (https://github.com/metbril/home-assistant-config)",
53 | "{{ ((states('sensor.sensor_entities_count') | int) + (states('sensor.binary_sensor_entities_count') | int)) }} sensoren voeden mijn Smart Home. (https://github.com/metbril/home-assistant-config)",
54 | "Ik houd van {{ states('sensor.update_entities_count') }} onderdelen bij of er een software update beschikbaar is.",
55 | "{{ states('sensor.automation_entities_count') }} automatiseringen en {{ states('sensor.script_entities_count') }} scripts maken mijn huis slim. (https://github.com/metbril/home-assistant-config)",
56 | "Let maar niet op mij. Ik hou alleen maar {{ states('sensor.light_entities_count')}} lampen en {{ states('sensor.device_tracker_entities_count') }} apparaten in huis in de gaten. (https://github.com/metbril/home-assistant-config)"
57 | ],
58 | "host": [
59 | "De laatste 🗄️ #backup van Home Assistant is {{ relative(as_datetime(state_attr('sensor.backup_state', 'last_backup'))) }} oud.",
60 | "Op {{ as_timestamp(state_attr('sensor.backup_state','last_backup')) | timestamp_custom('%d-%m-%Y %H:%M', true) }} is voor het laatst een 🗄️ #backup gemaakt van Home Assistant."
61 | ],
62 | "speedtest": [
63 | "De pingtijd 🌀 naar het Internet is {{ states('sensor.orbi_router_average_ping') }} milliseconden. #Ziggo #SpeedTest",
64 | "Gemiddelde Internet-snelheden 💨: download {{ states('sensor.orbi_router_downlink_bandwidth') | float(0) | round(0) }} Mbit/s, upload {{ states('sensor.orbi_router_uplink_bandwidth') | float(0) | round(0) }} Mbit/s. #Ziggo #SpeedTest",
65 | "Mijn downloadsnelheid ⬇️ bij #Ziggo is ongeveer {{ states('sensor.orbi_router_downlink_bandwidth') | float(0) | round(0) }} Mbit/s. #SpeedTest"
66 | ],
67 | "internet": [
68 | "Mijn toegang 🚪 van buitenaf wordt mede mogelijk gemaakt door Home Assistant Cloud van Nabu Casa. Zo sponsor ik meteen het @homeassistant@fosstodon.org project. #HomeAssistant #RemoteAccess #ExterneToegang (https://nabucasa.com/)",
69 | "🛡️ Tot nu toe heb ik voorkomen dat {{ states('sensor.adguard_dns_queries_blocked') }} advertenties en trackers het thuisnetwerk konden bereiken door gebruik van AdGuard Home! #Tracking #Privacy (https://adguard.com/nl/adguard-home/overview.html)",
70 | "🛡️ Met behulp van {{ states('sensor.adguard_rules_count') }} regels heeft AdGuard Home {{ states('sensor.adguard_dns_queries_blocked_ratio') }} % van de DNS-verzoeken gefilterd op advertenties. #AdBlocker #Privacy #Tracking (https://adguard.com/nl/adguard-home/overview.html)",
71 | "🛡️ AdGuard Home heeft vandaag {{ states('sensor.adguard_dns_queries') }} DNS-verzoeken afgehandeld! #Privacy #Tracking (https://adguard.com/nl/adguard-home/overview.html)"
72 | ],
73 | "weather": [
74 | "Vandaag wordt het {{ states('sensor.knmi_thuis_korte_dagverwachting') | lower }}. #KNMI #WeerLive #weer",
75 | "Het is buiten nu {{ states('sensor.knmi_thuis_omschrijving') | lower }}. #KNMI #WeerLive #weer",
76 | "Wie zijn best doet, kan door het raam ongeveer {{ states('sensor.buienradar_visibility') | float(0) | round(0) }} km wegkijken 🔭. #Buienradar #weer",
77 | "Buiten is het 🌡️ {{ state_attr('weather.knmi_thuis', 'temperature') | round(0) }} °C, maar dat voelt aan als {{ states('sensor.knmi_thuis_gevoelstemperatuur') | round(0) }} °C. #KNMI #WeerLive #weer",
78 | "De actuele UV-index ☀️ is {{ states('sensor.huidige_uv_index') }}. #OpenUV #weer",
79 | "🌦️ Buiten is het {{ states('sensor.buienradar_temperature') | float(0) | round(0) }} graden, met een luchtvochtigheid van {{ states('sensor.buienradar_humidity') | float(0) | round(0) }} procent en een luchtdruk van {{ states('sensor.buienradar_pressure') | float(0) | round(0) }} millibar. De wind komt met kracht {{ states('sensor.buienradar_wind_force') }} uit het {{ states('sensor.buienradar_wind_direction') }}. #Buienradar #weer",
80 | "⛅ Buiten is de temperatuur {{ states('sensor.buienradar_temperature') | float(0) | round(0) }} °C, met een relatieve luchtvochtigheid van {{ states('sensor.buienradar_humidity') | float(0) | round(0) }} % en een luchtdruk van {{ states('sensor.buienradar_pressure') | float(0) | round(0) }} hPa. De wind komt met een kracht van {{ states('sensor.buienradar_wind_force') }} Beaufort uit het {{ states('sensor.buienradar_wind_direction') }} en heeft een snelheid van {{ states('sensor.buienradar_wind_speed') | float(0) | round(0) }} km/u. De zon heeft een kracht van {{ states('sensor.buienradar_irradiance') }} W/m2. #Buienradar #weer",
81 | ],
82 | "promo": [
83 | "Jij kunt van je huis 🏡 ook een #SmartHome maken. Alles wat je nodig hebt is #HomeAssistant, wat tijd en wat configuratiebestanden. Neem daarvoor een kijkje in mijn GitHub repo. (https://github.com/metbril/home-assistant-config)",
84 | "Je kunt bekijken hoe dit alles is gedaan door te bladeren 📖 door mijn GitHub repository. (https://github.com/metbril/home-assistant-config)",
85 | "Meld je aan voor mijn repository 📚 met nu al {{ states('sensor.metbril_home_assistant_config_sterren') }} andere gebruikers. Bekijk de {{ states('sensor.metbril_home_assistant_config_issues') }} open taken. (https://github.com/metbril/home-assistant-config)",
86 | "Mijn Github code heeft {{ states('sensor.metbril_home_assistant_config_sterren') }} sterren 🌟 en loopt op. Nu met {{ states('sensor.metbril_home_assistant_config_issues') }} open taken. (https://github.com/metbril/home-assistant-config)",
87 | "Zorg dat je onze 🐘 Mastodon-accounts @ro@mastodon.nl en @DomusSapiens@botsin.space volgt!"
88 | ]
89 | }[pick] | random }}
90 | - service: script.toot_engine
91 | data:
92 | message: "{{ message }}"
93 |
94 | # "door": [
95 | # "Het aantal keren dat gisteren op de bel werd gedrukt is {{ states('sensor.doorbell_presses') }}",
96 | # "{{ states('sensor.doorbell_presses') }} mensen kwamen aan de deur vandaag en drukten op de bel.",
97 | # "{{ states('sensor.doorbell_presses') }} deurbelgebruik kwamen voor in de afgelopen 24 uur."
98 | # ],
99 |
--------------------------------------------------------------------------------
/includes/climate.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | # https://www.home-assistant.io/integrations/generic_thermostat/
3 | - platform: generic_thermostat
4 | name: Office
5 | unique_id: 687e0679-f53e-4251-b616-8b3050a9c81c
6 | heater: switch.office_heater
7 | target_sensor: sensor.office_climate_temperature
8 | min_temp: 12.0
9 | max_temp: 24.0
10 | target_temp: 19.0
11 | ac_mode: false
12 | min_cycle_duration:
13 | minutes: 3
14 | cold_tolerance: 0.2
15 | hot_tolerance: 0.2
16 | initial_hvac_mode: "off"
17 | precision: 0.5
18 | home_temp: 19.0
19 |
--------------------------------------------------------------------------------
/includes/customize.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | sensor.date:
3 | friendly_name: Datum
4 | icon: mdi:calendar-today
5 | sensor.time:
6 | friendly_name: Tijd
7 |
8 | sun.sun:
9 | friendly_name: Zon
--------------------------------------------------------------------------------
/includes/customize_glob.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | sensor.*_uv_index:
3 | icon: mdi:weather-sunny
4 | unit_of_measurement: UVI
5 |
--------------------------------------------------------------------------------
/includes/group.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | # This groups contains the person entities of all habitants of the home.
3 | # The group will then serve as a device_tracker entity and show
4 | # 'home' or 'not_home' status.
5 | # If at least someone in the group is home, the group will show 'home'.
6 | family:
7 | name: Familie
8 | icon: mdi:account-group
9 | entities:
10 | - person.robert
11 | - person.bjorn
12 | - person.monique
13 |
14 | parents:
15 | name: Ouders
16 | icon: mdi:account-group
17 | entities:
18 | - person.robert
19 | - person.monique
20 |
--------------------------------------------------------------------------------
/includes/logger.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | # https://www.home-assistant.io/integrations/logger/
3 | default: warn
4 | logs:
5 | homeassistant.core: warn
6 |
7 | # homeassistant.components: info
8 |
9 | # Custom components
10 | #
11 | # custom_components: debug
12 | # custom_components.knmi: debug
13 |
14 | # Custom components maintained by me
15 | #
16 | # custom_components.brandstofprijzen: info
17 |
--------------------------------------------------------------------------------
/includes/notify.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | # Person group for: Robert
3 | #
4 | # Expected service is the mobile app.
5 | # Use this group instead of the device directly, so device changes do not
6 | # require updating all uses of the notifier.
7 | - name: Robert
8 | platform: group
9 | services:
10 | - service: mobile_app_iphone_van_robert
11 |
12 | # Person group for: Monique
13 | #
14 | # Expected service is the mobile app.
15 | # Use this group instead of the device directly, so device changes do not
16 | # require updating all uses of the notifier.
17 | - name: Monique
18 | platform: group
19 | services:
20 | - service: robert
21 |
22 | # Person group for: Bjorn
23 | #
24 | # Expected service is the mobile app.
25 | # Use this group instead of the device directly, so device changes do not
26 | # require updating all uses of the notifier.
27 | - name: Bjorn
28 | platform: group
29 | services:
30 | - service: mobile_app_iphone_van_bjorn
31 |
32 | # To send notification to all family members / residents
33 | - name: Family
34 | platform: group
35 | services:
36 | - service: robert
37 | # - service: monique
38 | - service: bjorn
39 |
40 | # To send notification to both parents only
41 | - name: Parents
42 | platform: group
43 | services:
44 | - service: robert
45 | # - service: monique
46 |
47 | # To send admin notifications. Can be a person or
48 | # any other notifier service.
49 | - name: Admin
50 | platform: group
51 | services:
52 | - service: pushover
53 |
54 | ##############################################################################
55 | ## Mastodon
56 | ## https://www.home-assistant.io/integrations/mastodon
57 | ##
58 | ## Send notifications to the Mastodon account of the house
59 | ## https://botsin.space/@DomusSapiens
60 | ##############################################################################
61 | - name: Mastodon
62 | platform: mastodon
63 | # base_url: https://botsin.space/
64 | base_url: https://mastodon.social/
65 | access_token: !secret mastodon_access_token
66 | client_id: !secret mastodon_client_id
67 | client_secret: !secret mastodon_client_secret
68 |
69 | ##############################################################################
70 | ## This notifier is used by the log energy consumption automation.
71 | ##
72 | ## https://www.home-assistant.io/integrations/file
73 | ##############################################################################
74 | - name: save_energy_consumption
75 | platform: file
76 | filename: energy_consumption.csv
77 | timestamp: false
78 |
--------------------------------------------------------------------------------
/includes/rest_command.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | # Post gas meter reading to Mindergas.nl
3 | #
4 | # The RESTful command accepts 2 required data elements:
5 | #
6 | # date : The date formatted as YYYY-MM-DD
7 | # reading : Usually the current state of your gas consumption sensor
8 | #
9 | # Expects reading from end of day (23:59:59)
10 | # Use yesterday's date when posting reading right after midnight.
11 | # API documentation at https://www.mindergas.nl/member/api
12 | #
13 | mindergas:
14 | url: https://www.mindergas.nl/api/meter_readings
15 | method: post
16 | headers:
17 | Content-Type: application/json
18 | AUTH-TOKEN: !secret mindergas_token
19 | payload: '{"date" : "{{ date }}", "reading" : "{{ reading }}"}'
20 |
--------------------------------------------------------------------------------
/includes/sensor/living_lights_on_today.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | - platform: history_stats
3 | name: Living Lights On Today
4 | entity_id: light.living
5 | state: "on"
6 | type: time
7 | start: "{{ now().replace(hour=0, minute=0, second=0) }}"
8 | end: "{{ now() }}"
9 |
--------------------------------------------------------------------------------
/includes/sensor/living_tv_on_last_24h.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | - platform: history_stats
3 | name: Living TV On Last 24h
4 | entity_id: media_player.living_tv
5 | state: 'on'
6 | type: time
7 | end: '{{ now() }}'
8 | duration:
9 | hours: 24
10 |
--------------------------------------------------------------------------------
/includes/sensor/living_tv_on_today.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | - platform: history_stats
3 | name: Living TV On Today
4 | entity_id: media_player.living_tv
5 | state: "on"
6 | type: time
7 | start: "{{ now().replace(hour=0, minute=0, second=0) }}"
8 | end: "{{ now() }}"
9 |
--------------------------------------------------------------------------------
/includes/sensor/living_tv_on_today_ratio.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | - platform: history_stats
3 | name: Living TV On Today Ratio
4 | entity_id: media_player.living_tv
5 | state: "on"
6 | type: ratio
7 | start: "{{ now().replace(hour=0, minute=0, second=0) }}"
8 | end: "{{ now() }}"
9 |
--------------------------------------------------------------------------------
/includes/sensor/office_heater_on_today.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | - platform: history_stats
3 | name: Office Heater On Today
4 | entity_id: switch.office_heater
5 | state: "on"
6 | type: time
7 | start: "{{ now().replace(hour=0, minute=0, second=0) }}"
8 | end: "{{ now() }}"
9 |
--------------------------------------------------------------------------------
/includes/sensor/statistics.yaml:
--------------------------------------------------------------------------------
1 | - platform: statistics
2 | name: "Max Temperature Last 24h"
3 | unique_id: c79484d1-6b64-466b-8d93-cc17297fe897
4 | entity_id: sensor.openweathermap_temperature
5 | state_characteristic: value_max
6 | max_age:
7 | hours: 24
8 |
9 | - platform: statistics
10 | name: "Max Temperature Last 48h"
11 | unique_id: 3264af18-4407-4beb-ad40-06116eab545c
12 | entity_id: sensor.openweathermap_temperature
13 | state_characteristic: value_max
14 | max_age:
15 | hours: 48
16 |
17 | - platform: statistics
18 | name: "Max Temperature Last 72h"
19 | unique_id: d6eb8dc6-7227-4587-a7eb-703d05f7c9a3
20 | entity_id: sensor.openweathermap_temperature
21 | state_characteristic: value_max
22 | max_age:
23 | hours: 72
24 |
25 | - platform: statistics
26 | name: "Total Rain Last 24h"
27 | unique_id: a1bdd807-be03-4d33-88d2-b8f0e3565f87
28 | entity_id: sensor.openweathermap_rain
29 | state_characteristic: sum
30 | max_age:
31 | hours: 24
32 |
33 | - platform: statistics
34 | name: "Total Rain Last 48h"
35 | unique_id: f0fa2a52-13b7-405b-9765-d94c615a60e8
36 | entity_id: sensor.openweathermap_rain
37 | state_characteristic: sum
38 | max_age:
39 | hours: 48
40 |
41 | - platform: statistics
42 | name: "Total Rain Last 72h"
43 | unique_id: 0a7ef5a8-1a89-40dd-ab50-7ae02a808212
44 | entity_id: sensor.openweathermap_rain
45 | state_characteristic: sum
46 | max_age:
47 | hours: 72
48 |
49 | - platform: statistics
50 | name: "Rain Last 24h"
51 | unique_id: af2985f2-b4d6-4997-85d1-d8489a9ac3ce
52 | entity_id: sensor.total_rain
53 | state_characteristic: change
54 | max_age:
55 | hours: 24
56 |
--------------------------------------------------------------------------------
/includes/sensor/time_date.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | ##############################################################################
3 | ## Time/Date
4 | ## https://www.home-assistant.io/integrations/time_date
5 | ##############################################################################
6 | - platform: time_date
7 | display_options:
8 | - 'date'
9 | - 'time'
10 |
--------------------------------------------------------------------------------
/includes/sensor/working_from_home.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | - platform: history_stats
3 | name: Working From Home Robert Today
4 | entity_id: binary_sensor.working_from_home_robert
5 | state: "on"
6 | type: time
7 | start: "{{ now().replace(hour=0, minute=0, second=0) }}"
8 | end: "{{ now() }}"
9 |
10 | - platform: history_stats
11 | name: Working From Home Monique Today
12 | entity_id: binary_sensor.working_from_home_monique
13 | state: "on"
14 | type: time
15 | start: "{{ now().replace(hour=0, minute=0, second=0) }}"
16 | end: "{{ now() }}"
17 |
--------------------------------------------------------------------------------
/includes/template/appliances/tumble_dryer_running.yaml:
--------------------------------------------------------------------------------
1 | - binary_sensor:
2 | - name: "Tumble Dryer Running"
3 | unique_id: e266f060-376f-4067-8b9d-c8a21e49f890
4 | icon: "mdi:tumble-dryer{{ '-off' if (this.state == 'off') }}"
5 | delay_on:
6 | seconds: 30
7 | delay_off:
8 | seconds: 55
9 | state: "{{ states('sensor.tumble_dryer_power') | float(0) > 2.5 }}"
10 |
--------------------------------------------------------------------------------
/includes/template/appliances/washing_machine_running.yaml:
--------------------------------------------------------------------------------
1 | # Uses a 'delay_off'.
2 | # Cannot be configured as a helper through the UI.
3 | #
4 | - binary_sensor:
5 | # Appliance is running when power usage detected
6 | - name: "Washing Machine Running"
7 | unique_id: 7a04404c-be07-4651-82d1-74a804d5cf25
8 | device_class: running
9 | icon: >
10 | mdi:washing-machine{{ '-off' if (this.state == 'off') }}
11 | delay_off:
12 | seconds: 30
13 | state: "{{ states('sensor.washing_machine_power') | float(0) > 4 }}"
14 |
--------------------------------------------------------------------------------
/includes/template/appliances/washing_machine_running_duration.yaml:
--------------------------------------------------------------------------------
1 | - sensor:
2 | - name: Washing Machine Running Duration
3 | unique_id: f059cf66-215c-4dd7-a421-ff45e262b72d
4 | device_class: duration
5 | unit_of_measurement: s
6 | state: >-
7 | {% set start = states('sensor.washing_machine_running_start_time') | as_timestamp %}
8 | {% set finish = states('sensor.washing_machine_running_finish_time') | as_timestamp %}
9 | {% set current = now() | as_timestamp %}
10 | {% if (start > finish) %}
11 | {% set secs = current - start %}
12 | {% else %}
13 | {% set secs = (finish - start) %}
14 | {% endif %}
15 | {{ secs }}
16 |
--------------------------------------------------------------------------------
/includes/template/appliances/washing_machine_running_energy.yaml:
--------------------------------------------------------------------------------
1 | - sensor:
2 | - name: Washing Machine Running Energy
3 | unique_id: 55a0f954-a7a8-4040-9eb1-32967c0054f6
4 | device_class: energy
5 | unit_of_measurement: kWh
6 | state: >-
7 | {% set start = states('sensor.washing_machine_running_start_energy') | float(0) %}
8 | {% set finish = states('sensor.washing_machine_running_finish_energy') | float(0) %}
9 | {% set current = states('sensor.washing_machine_energy') | float(0) %}
10 | {{ (([current, finish] | max) - start) | round(2) }}
11 |
--------------------------------------------------------------------------------
/includes/template/appliances/washing_machine_running_off.yaml:
--------------------------------------------------------------------------------
1 | # Save time and energy meter when washing machine running finishes.
2 | - trigger:
3 | - platform: state
4 | entity_id: binary_sensor.washing_machine_running
5 | from:
6 | - "on"
7 | to:
8 | - "off"
9 | sensor:
10 | - name: "Washing Machine Running Finish Time"
11 | unique_id: "b55d795b-e8f0-403f-b777-7bacecef66ea"
12 | device_class: timestamp
13 | state: "{{ now() }}"
14 |
15 | - name: "Washing Machine Running Finish Energy"
16 | unique_id: "41ecee32-cf16-4ba7-95ab-574b84855e94"
17 | unit_of_measurement: kWh
18 | device_class: energy
19 | state: "{{ states('sensor.washing_machine_energy') }}"
20 |
--------------------------------------------------------------------------------
/includes/template/appliances/washing_machine_running_on.yaml:
--------------------------------------------------------------------------------
1 | # Save time and energy meter when washing machine running starts.
2 | - trigger:
3 | - platform: state
4 | entity_id: binary_sensor.washing_machine_running
5 | from:
6 | - "off"
7 | to:
8 | - "on"
9 | sensor:
10 | - name: "Washing Machine Running Start Time"
11 | unique_id: "632cecf0-6e54-41c3-87d9-7b9bcbca4242"
12 | device_class: timestamp
13 | state: "{{ now() }}"
14 |
15 | - name: "Washing Machine Running Start Energy"
16 | unique_id: "15b7d78f-c7de-4311-8477-d67ef82b1c22"
17 | unit_of_measurement: kWh
18 | device_class: energy
19 | state: "{{ states('sensor.washing_machine_energy') }}"
20 |
--------------------------------------------------------------------------------
/includes/template/expected_precipitation.yaml:
--------------------------------------------------------------------------------
1 | - trigger:
2 | - platform: state
3 | entity_id:
4 | - weather.openweathermap
5 | action:
6 | - service: weather.get_forecasts
7 | data:
8 | type: hourly
9 | target:
10 | entity_id: weather.openweathermap
11 | response_variable: hourly
12 | sensor:
13 | - name: Expected Precipitation
14 | icon: mdi:weather-pouring
15 | unique_id: 409ddc89-7df3-42ee-8cb5-d396bad42a47
16 | unit_of_measurement: mm
17 | state: >-
18 | {% set ns = namespace() %}
19 | {% set ns.total = 0 %}
20 | {% for r in range(0, 8) %}
21 | {% set probab = (hourly['weather.openweathermap'].forecast[r].precipitation_probability / 100) | float(0) %}
22 | {% set precip = hourly['weather.openweathermap'].forecast[r].precipitation | float(0) %}
23 | {% set precip = precip * probab %}
24 | {% set ns.total = ns.total + precip %}
25 | {% endfor %}
26 | {{ ns.total | round(0) }}
27 |
--------------------------------------------------------------------------------
/includes/template/living_tv_volume_level.yaml:
--------------------------------------------------------------------------------
1 | - sensor:
2 | - name: Living TV Volume Level
3 | unique_id: 655f97da-54dc-40d2-8de1-db1b9cc66bf3
4 | unit_of_measurement: "%"
5 | availability: >-
6 | {{ state_attr('media_player.living_tv','volume_level') is not none }}
7 | state: >-
8 | {{ (state_attr('media_player.living_tv','volume_level')
9 | | float(0) * 100) | int }}
10 | icon: >-
11 | {% set state = states('sensor.living_tv_volume_level') | float(0) %}
12 | {% if state == 0.0 %} mdi:volume-off
13 | {% elif state <= 0.3 %} mdi:volume-low
14 | {% elif state <= 0.6 %} mdi:volume-medium
15 | {% else %} mdi:volume-high
16 | {% endif %}
17 |
--------------------------------------------------------------------------------
/includes/template/low_battery.yaml:
--------------------------------------------------------------------------------
1 | - sensor:
2 | - name: Low Batteries
3 | unique_id: 649ecb19-3c59-48ac-a22a-bad30c5ec548
4 | unit_of_measurement: "count"
5 | availability: true
6 | state: >-
7 | {{ this.attributes.sensors | count }}
8 | attributes:
9 | sensors: >-
10 | {% set limit = 20 | int %}
11 | {% set result = namespace(sensors=[]) %}
12 | {% for sensor in states.sensor | rejectattr('attributes.device_class', 'undefined') | selectattr('attributes.device_class', '==', 'battery') %}
13 | {% if (states(sensor.entity_id) == 'unavailable' or (states(sensor.entity_id) | float) <= limit) %}
14 | {% set result.sensors = result.sensors + [sensor.name
15 | | regex_replace(find=' Battery Level', replace='')
16 | | regex_replace(find=' Batterij', replace='')
17 | ~ ' (' ~ states(sensor.entity_id) ~ '%)'] %}
18 | {% endif %}
19 | {% endfor %}
20 | {{ result.sensors }}
21 | icon: mdi:zigbee
22 |
--------------------------------------------------------------------------------
/includes/template/occupancy/binary_sensor_occupancy.yaml:
--------------------------------------------------------------------------------
1 | - binary_sensor:
2 | - name: "Occupancy"
3 | unique_id: 80fb3594-f0d4-4ae4-8251-f31e1d9b301f
4 | icon: >-
5 | {{ state_attr('sensor.occupancy', 'icon') }}
6 | state: >-
7 | {{ states.input_boolean | select('search', 'occupancy_')
8 | | selectattr('state', 'eq', 'on') | map(attribute='entity_id')
9 | | list | count != 0 }}
10 |
--------------------------------------------------------------------------------
/includes/template/occupancy/sensor_occupancy.yaml:
--------------------------------------------------------------------------------
1 | - sensor:
2 | - name: "Occupancy"
3 | unique_id: c84e912d-287c-4e51-8c41-30eebe8fece6
4 | icon: >-
5 | {% set occupancy = this.state %}
6 | {% if occupancy is in [None, 'unknown', 'unavailable'] %}
7 | mdi:home-off-outline
8 | {% else %}
9 | {{ state_attr('input_boolean.occupancy_' + occupancy, 'icon') }}
10 | {% endif %}
11 | state: >-
12 | {% set value = (states.input_boolean
13 | | select('search', 'occupancy_')
14 | | selectattr('state', 'eq', 'on')
15 | | map(attribute='entity_id') | list | first) %}
16 | {{ value.split('.')[1].split("_")[1] if value is defined else 'unknown' }}
17 |
--------------------------------------------------------------------------------
/includes/template/uv_protection_window.yaml:
--------------------------------------------------------------------------------
1 | # UV Protection Window
2 | - binary_sensor:
3 | - name: UV Protection Window
4 | unique_id: "1fed4c80-a646-4133-961c-776da75f1624"
5 | device_class: safety
6 | availability: >-
7 | {{ states('binary_sensor.bescherming_venster') not in ['unknown', 'unavailable', None] }}
8 | state: >-
9 | {% set now = now() | as_timestamp | float(0) %}
10 | {% set lower = state_attr('binary_sensor.bescherming_venster','start_time') | as_timestamp | float(0) %}
11 | {% set upper = state_attr('binary_sensor.bescherming_venster','end_time') | as_timestamp | float(0) %}
12 | {{ (lower <= now <= upper) }}
13 |
--------------------------------------------------------------------------------
/includes/template/zigbee_devices_offline.yaml:
--------------------------------------------------------------------------------
1 | - sensor:
2 | - name: Zigbee Devices Offline
3 | unique_id: a618479f-192e-497b-b9d5-ed4f72592cb4
4 | unit_of_measurement: "count"
5 | availability: true
6 | state: >-
7 | {{ this.attributes.sensors | count }}
8 | attributes:
9 | sensors: >-
10 | {% set age = (24 | int) * 60 * 60 %}
11 | {% set result = namespace(sensors=[]) %}
12 | {% for state in states.sensor | rejectattr('attributes.device_class', 'undefined') | selectattr('attributes.device_class', '==', 'timestamp') %}
13 | {% if 'last_seen' in state.entity_id and (states(state.entity_id) == 'unavailable' or ((as_timestamp(now()) - as_timestamp(states(state.entity_id))) > age)) %}
14 | {% set result.sensors = result.sensors + [state.name | regex_replace(find=' Last seen', replace='') ~ ' (' ~ relative_time(strptime(states(state.entity_id), '%Y-%m-%dT%H:%M:%S%z', 'unavailable')) ~ ')'] %}
15 | {% endif %}
16 | {% endfor %}
17 | {{ result.sensors }}
18 | icon: mdi:zigbee
19 |
--------------------------------------------------------------------------------
/scripts.yaml:
--------------------------------------------------------------------------------
1 | toot_engine:
2 | alias: Toot Engine
3 | fields:
4 | who:
5 | name: Who
6 | description: The notifier name that will send the toot. See Services for options.
7 | required: true
8 | default: mastodon
9 | example: mastodon
10 | selector:
11 | text:
12 | multiline: false
13 | type: text
14 | message:
15 | name: Message
16 | description: The message to toot.
17 | required: true
18 | example: Hello world!
19 | selector:
20 | text:
21 | multiline: true
22 | type: text
23 | sequence:
24 | - if:
25 | - condition: not
26 | conditions:
27 | - condition: state
28 | state: 'on'
29 | entity_id: input_boolean.toot_engine
30 | alias: Niet
31 | then:
32 | - stop: ''
33 | - service: notify.{{ who | default('mastodon') }}
34 | data:
35 | message: '{{ message }}'
36 | mode: queued
37 | icon: mdi:elephant
38 | max: 10
39 | time_to_leave_for_robert:
40 | alias: Time to Leave for Robert
41 | icon: mdi:exit-run
42 | mode: single
43 | sequence:
44 | - service: notify.robert
45 | data:
46 | message: Tijd om te vertrekken naar je werk.
47 | printer_off:
48 | alias: 'Kantoor: Printer ingeschakeld actionable melding'
49 | sequence:
50 | - service: notify.robert
51 | data:
52 | message: Printer staat nog aan
53 | title: Printer
54 | data:
55 | actions:
56 | - action: PRINTER_OFF
57 | title: Uitschakelen
58 | - action: PRINTER_REMIND
59 | title: Herinneren
60 | - action: PRINTER_IGNORE
61 | title: Negeren
62 | mode: single
63 | morning_routine:
64 | alias: Ochtendroutine
65 | fields:
66 | player:
67 | name: Sonos Mediaspeler
68 | description: The media player that plays the morning routine.
69 | required: true
70 | selector:
71 | entity:
72 | domain: media_player
73 | integration: sonos
74 | multiple: false
75 | variables:
76 | time_of_day: Goedemorgen.
77 | vandaag: 'Het is vandaag {{ states(''sensor.weekday'') }} {{ states(''sensor.long_date'')
78 | }} en de tijd is {{ states(''sensor.time'') }}.
79 |
80 | '
81 | weer: 'Het is nu {{ states(''sensor.knmi_thuis_omschrijving'') | lower }} en {{
82 | state_attr(''weather.knmi_thuis'',''temperature'') | float(0) | round(0) }}
83 | graden. Het wordt vandaag maximaal {{ state_attr(''weather.knmi_thuis'',''forecast'')[0].temperature
84 | | float(0) | round(0) }} graden. Later vandaag: {{ states(''sensor.knmi_thuis_korte_dagverwachting'')
85 | }}.
86 |
87 | '
88 | weer_waarschuwing: "{% if is_state('binary_sensor.knmi_thuis_waarschuwing','on')
89 | %}\n Let op.\n {{ state_attr('binary_sensor.knmi_thuis_waarschuwing', 'Waarschuwing')
90 | }}\n{% endif %}\n"
91 | sequence:
92 | - service: script.sonos_say
93 | data:
94 | entity_id: '{{ player }}'
95 | message: '{{ time_of_day }} {{ vandaag }} {{ weer }} {{ weer_waarschuwing }}'
96 | volume_percent: 30
97 | - service: script.lees_het_nieuws_voor
98 | data:
99 | player: '{{ player }}'
100 | volume_percent: 30
101 | double_toggle:
102 | alias: Lighting > Double Toggle
103 | fields:
104 | entity:
105 | name: Light target
106 | description: The light to toggle twice
107 | required: true
108 | selector:
109 | entity:
110 | domain: light
111 | sequence:
112 | - service: light.toggle
113 | target:
114 | entity_id: '{{ entity }}'
115 | - service: light.toggle
116 | target:
117 | entity_id: '{{ entity }}'
118 | mode: single
119 | icon: mdi:lightbulb-on-70
120 | bark_the_dog:
121 | alias: Security > Bark The Dog
122 | description: 'Loudly play the sound of a barking dog. Delay for the duration of
123 | the clip afterwards. Lower the volume just in case. Limited to Sonos players.
124 |
125 | '
126 | fields:
127 | entity_id:
128 | name: Media Player
129 | description: The media player that plays the sound
130 | example: media_player.living_speaker
131 | required: true
132 | selector:
133 | entity:
134 | domain: media_player
135 | integration: sonos
136 | volume_pct:
137 | name: Volume Level
138 | description: The volume level of the barking dog. As loud as possible.
139 | selector:
140 | number:
141 | min: 1
142 | max: 100
143 | step: 1
144 | unit_of_measurement: '%'
145 | mode: slider
146 | default: 100
147 | example: '100'
148 | sequence:
149 | - variables:
150 | volume_level: '{{ (volume_pct | int(100) / 100) | float }}'
151 | - service: sonos.snapshot
152 | data:
153 | entity_id: '{{ entity_id }}'
154 | - service: media_player.unjoin
155 | data:
156 | entity_id: '{{ entity_id }}'
157 | - service: media_player.media_pause
158 | target:
159 | entity_id: '{{ entity_id }}'
160 | - service: media_player.volume_set
161 | data:
162 | volume_level: '{{ volume_level | float }}'
163 | entity_id: '{{ entity_id }}'
164 | - service: media_player.play_media
165 | data:
166 | media_content_type: music
167 | media_content_id: /local/sounds/dog-barking-noise.mp3
168 | entity_id: '{{ entity_id }}'
169 | - delay:
170 | hours: 0
171 | minutes: 0
172 | seconds: 3
173 | milliseconds: 0
174 | alias: Delay so sound can start playing
175 | - wait_template: '{{ is_state(entity_id, ''paused'') }}'
176 | continue_on_timeout: true
177 | alias: Wait until sound has finished playing
178 | - service: sonos.restore
179 | data:
180 | entity_id: '{{ entity_id }}'
181 | mode: single
182 | icon: mdi:dog-side
183 | movie_pause:
184 | alias: Media > Pause movie
185 | mode: single
186 | icon: mdi:television-pause
187 | sequence:
188 | - choose:
189 | - conditions:
190 | - condition: state
191 | entity_id: media_player.apple_tv_woomkamer
192 | state: playing
193 | sequence:
194 | - service: remote.send_command
195 | data:
196 | command: select
197 | target:
198 | entity_id: remote.apple_tv_woomkamer
199 | - conditions:
200 | - alias: Test if Living TV is playing a specific source
201 | condition: and
202 | conditions:
203 | - condition: state
204 | entity_id: media_player.living_tv
205 | state: 'on'
206 | - alias: Test for a list of sources
207 | condition: or
208 | conditions:
209 | - condition: state
210 | entity_id: media_player.living_tv
211 | attribute: source
212 | state: Netflix
213 | sequence:
214 | - service: media_player.media_pause
215 | target:
216 | entity_id: media_player.living_tv
217 | - service: media_player.volume_mute
218 | target:
219 | entity_id: media_player.living_tv
220 | data:
221 | is_volume_muted: true
222 | movie_time_start:
223 | alias: Media > Start Movie Time
224 | icon: mdi:movie-open
225 | mode: single
226 | sequence:
227 | - if:
228 | - condition: state
229 | entity_id: light.living
230 | state: 'on'
231 | then:
232 | - service: scene.turn_on
233 | target:
234 | entity_id:
235 | - scene.living_lighting_theater
236 | data:
237 | transition: 3
238 | movie_time_stop:
239 | alias: Media > Stop Movie Time
240 | icon: mdi:movie-open-off
241 | mode: single
242 | sequence:
243 | - if:
244 | - condition: state
245 | entity_id: light.living
246 | state: 'on'
247 | then:
248 | - service: scene.turn_on
249 | target:
250 | entity_id:
251 | - scene.living_lighting_min
252 | data: {}
253 | start_netflix:
254 | alias: Media > Start Netflix on living TV
255 | description: Start de TV als deze nog uit staat, en schakelt vervolgens Netflix
256 | in.
257 | icon: mdi:netflix
258 | mode: single
259 | sequence:
260 | - choose:
261 | - conditions:
262 | - condition: state
263 | entity_id: media_player.living_tv
264 | state: 'off'
265 | sequence:
266 | - service: notify.mobile_app_iphone_robert
267 | data:
268 | message: De TV wordt ingeschakeld voor Netflix. Een ogenblikje...
269 | - service: media_player.turn_on
270 | target:
271 | entity_id: media_player.living_tv
272 | data: {}
273 | default: []
274 | - wait_template: '{{ is_state(''media_player.living_tv'', ''on'') }}'
275 | timeout: 00:01:00
276 | - service: media_player.select_source
277 | data:
278 | source: Netflix
279 | target:
280 | entity_id: media_player.living_tv
281 | - service: notify.living_tv
282 | data:
283 | message: Netflix is gestart. Veel kijkplezier!
284 | switch_netflix_robert:
285 | alias: Media > Ga naar Netflix van Robert on living TV
286 | description: Start Netflix en open het profiel van Robert. Aangenomen dat de TV
287 | al aan staat.
288 | icon: mdi:netflix
289 | mode: single
290 | sequence:
291 | - condition: state
292 | entity_id: media_player.living_tv
293 | state: 'on'
294 | - service: media_player.select_source
295 | target:
296 | entity_id: media_player.living_tv
297 | data:
298 | source: Netflix
299 | - delay:
300 | seconds: 1
301 | - service: webostv.button
302 | data:
303 | entity_id: media_player.living_tv
304 | button: LEFT
305 | - delay:
306 | seconds: 1
307 | - service: webostv.button
308 | data:
309 | entity_id: media_player.living_tv
310 | button: LEFT
311 | - delay:
312 | seconds: 1
313 | - service: webostv.button
314 | data:
315 | entity_id: media_player.living_tv
316 | button: LEFT
317 | - delay:
318 | seconds: 1
319 | - service: webostv.button
320 | data:
321 | entity_id: media_player.living_tv
322 | button: LEFT
323 | - delay:
324 | seconds: 2
325 | - service: webostv.button
326 | data:
327 | entity_id: media_player.living_tv
328 | button: ENTER
329 | double_toggle_office_desk_lamp:
330 | alias: Lighting > Double Toggle Office Desk Lamp
331 | sequence:
332 | - service: script.double_toggle
333 | data:
334 | entity: light.office_desk_lamp
335 | mode: single
336 | icon: mdi:lightbulb-on-70
337 | toggle_heater:
338 | alias: Toggle Heater
339 | sequence:
340 | - choose:
341 | - conditions:
342 | - condition: state
343 | entity_id: climate.office
344 | state: 'off'
345 | sequence:
346 | - service: climate.set_hvac_mode
347 | data:
348 | hvac_mode: heat
349 | target:
350 | entity_id: climate.office
351 | default:
352 | - service: climate.set_hvac_mode
353 | data:
354 | hvac_mode: 'off'
355 | target:
356 | entity_id: climate.office
357 | mode: single
358 | icon: mdi:radiator
359 | sonos_say:
360 | alias: Sonos Text-To-Speech
361 | description: Text to speech for Sonos devices.
362 | mode: queued
363 | max: 10
364 | fields:
365 | entity_id:
366 | name: Entity
367 | description: The media player that speeks the text
368 | example: media_player.living_speaker
369 | required: true
370 | selector:
371 | entity:
372 | domain:
373 | - media_player
374 | integration: sonos
375 | multiple: false
376 | message:
377 | name: Message
378 | description: The message to speak
379 | example: Hallo wereld!
380 | required: true
381 | selector:
382 | text:
383 | multiline: true
384 | type: text
385 | volume_percent:
386 | name: Volume
387 | description: Volume of the spoken text, Range 0-100
388 | example: '30'
389 | default: 30
390 | selector:
391 | number:
392 | min: 0
393 | max: 100
394 | step: 1
395 | unit_of_measurement: '%'
396 | mode: slider
397 | variables:
398 | volume_level: "{% if (volume_percent is none) or (volume_percent is undefined)
399 | or (volume_percent == \"\") %}\n 0.3\n{% else %}\n {{ (volume_percent / 100)
400 | | float(0) }}\n{% endif %}"
401 | is_playing: '{{ is_state(entity_id, "playing") }}'
402 | media: '{{ state_attr(entity_id,"media_content_id") }}'
403 | is_cloud: '{{ (media.split(":")[0] == "x-sonos-vli") }}'
404 | cannot_restore: '{{ is_playing and is_cloud }}'
405 | sequence:
406 | - if:
407 | - condition: state
408 | entity_id: input_boolean.audible_notifications
409 | state: 'on'
410 | then:
411 | - service: sonos.snapshot
412 | data:
413 | entity_id: '{{ entity_id }}'
414 | - service: media_player.unjoin
415 | data:
416 | entity_id: '{{ entity_id }}'
417 | - service: media_player.media_pause
418 | data:
419 | entity_id: '{{ entity_id }}'
420 | - service: media_player.volume_set
421 | data:
422 | entity_id: '{{ entity_id }}'
423 | volume_level: '{{ volume_level }}'
424 | - service: tts.cloud_say
425 | data:
426 | entity_id: '{{ entity_id }}'
427 | message: '{{ message }}'
428 | - alias: Delay for generating speech online
429 | delay: 3
430 | - alias: Wait until playing speech has finished
431 | wait_template: '{{ is_state(entity_id, ''paused'') }}
432 |
433 | '
434 | - service: sonos.restore
435 | data:
436 | entity_id: '{{ entity_id }}'
437 | icon: mdi:speaker-message
438 | notify_living:
439 | alias: Notify Living
440 | fields:
441 | message:
442 | name: Message
443 | description: Het uit te spreken bericht.
444 | example: Hallo. Ik ben de virtuele assistent.
445 | default: Hallo. Ik ben de virtuele assistent.
446 | required: true
447 | selector:
448 | text:
449 | multiline: true
450 | type: text
451 | icon:
452 | name: Icon
453 | description: De afbeelding die wordt getoond bij het bericht op de TV.
454 | example: /config/www/img/home-assistant.png
455 | default: /config/www/img/home-assistant.png
456 | selector:
457 | text:
458 | multiline: false
459 | type: text
460 | sequence:
461 | - variables:
462 | message: '{{ message | default(''Hallo. Ik ben de virtuele assistent.'', true)
463 | }}'
464 | icon: '{{ icon | default(''/config/www/img/home-assistant.png'', true) }}'
465 | - service: notify.living_tv
466 | data:
467 | message: '{{ message }}'
468 | data:
469 | icon: '{{ icon }}'
470 | - condition: state
471 | entity_id: input_boolean.do_not_disturb
472 | state: 'off'
473 | - service: chime_tts.say
474 | target:
475 | entity_id:
476 | - media_player.office_speaker
477 | - media_player.living_speaker
478 | data:
479 | chime_path: bells
480 | delay: 450
481 | tts_playback_speed: 100
482 | volume_level: 0.3
483 | tts_platform: cloud
484 | message: '{{ message }}'
485 | cache: true
486 | announce: true
487 | language: nl-NL
488 | options:
489 | voice: MaartenNeural
490 | mode: single
491 | icon: mdi:account-voice
492 | notify_living_dashboard:
493 | alias: Notify Living Dashboard
494 | sequence:
495 | - service: script.notify_living
496 | data:
497 | message: '{{ states(''input_text.notification_message'') }}'
498 | mode: single
499 | icon: mdi:account-voice
500 | lees_het_nieuws_voor:
501 | alias: Lees het nieuws voor
502 | fields:
503 | player:
504 | name: Media player
505 | description: The media player that reads the news. Currently limited to Sonos
506 | speakers only.
507 | required: true
508 | selector:
509 | entity:
510 | domain: media_player
511 | integration: sonos
512 | example: media_player.sonos_living
513 | volume_percent:
514 | name: Player Volume
515 | description: The player volume
516 | selector:
517 | number:
518 | min: 1
519 | max: 100
520 | step: 1
521 | unit_of_measurement: '%'
522 | mode: slider
523 | default: 30
524 | example: '30'
525 | sequence:
526 | - variables:
527 | volume_level: '{{ ((volume_percent | default(30) | int(0)) / 100) | float(0)
528 | }}'
529 | - service: script.sonos_say
530 | data:
531 | entity_id: '{{ player }}'
532 | message: 'Het nieuws van {{ ((states.sensor.anp_nieuws_audio.attributes.entries[0].title |
533 | regex_replace(find=''0(\d)'', replace=''\\1'', ignorecase=True)).split()[-2] |
534 | int(0)) % 12 }} uur.
535 |
536 | '
537 | volume_percent: '{{ volume_percent }}'
538 | - service: sonos.snapshot
539 | data:
540 | entity_id: '{{ player }}'
541 | - service: media_player.unjoin
542 | data:
543 | entity_id: '{{ player }}'
544 | - service: media_player.media_pause
545 | data:
546 | entity_id: '{{ player }}'
547 | - service: media_player.volume_set
548 | data:
549 | entity_id: '{{ player }}'
550 | volume_level: '{{ volume_level }}'
551 | - service: media_player.play_media
552 | data:
553 | media_content_id: '{{ states.sensor.anp_nieuws_audio.attributes.entries[0].media_content[0].url
554 | }}'
555 | media_content_type: music
556 | target:
557 | entity_id: '{{ player }}'
558 | - delay:
559 | hours: 0
560 | minutes: 0
561 | seconds: 5
562 | milliseconds: 0
563 | alias: Delay for 5 seconds, wait for media to download and start playing
564 | - alias: Wait until media has finished, or max 2 minutes (> audio file)
565 | wait_template: '{{ is_state( player,''paused'') }}'
566 | timeout: '120'
567 | continue_on_timeout: true
568 | - service: sonos.restore
569 | data:
570 | entity_id: '{{ player }}'
571 | mode: single
572 | icon: mdi:account-voice
573 | pauzeer_mediaspelers_woonkamer:
574 | alias: Pauzeer mediaspelers woonkamer
575 | sequence:
576 | - service: media_player.media_pause
577 | data: {}
578 | target:
579 | area_id: 474a3ca8a301432eb3b99533b9833d3e
580 | mode: single
581 | icon: mdi:pause
582 | system_reset_error_warning_counters:
583 | alias: 'System: Reset error warning counters'
584 | sequence:
585 | - service: counter.reset
586 | data: {}
587 | target:
588 | entity_id:
589 | - counter.system_errors
590 | - counter.system_warnings
591 | mode: single
592 | icon: mdi:restore
593 | garage_motion_timer_start:
594 | alias: Pantry Light Timer Start
595 | sequence:
596 | - service: timer.start
597 | data:
598 | duration: '{{ states(''input_number.pantry_light_timeout'') | int(0) }}'
599 | target:
600 | entity_id: timer.pantry_light
601 | mode: single
602 | mindergas:
603 | alias: 'Energy: Post meter reading to mindergas.nl'
604 | description: A simple wrapper script around the RESTful command, to be able to post
605 | a gas meter reading both manually through the Services menu in the developer tools
606 | and call it from the automations editor.
607 | mode: single
608 | fields:
609 | date:
610 | name: Reading date
611 | description: The date to post the last reading of.
612 | required: true
613 | selector:
614 | date:
615 | reading:
616 | name: Meter reading
617 | description: The last meter reading at the end of the day of the specified date.
618 | required: true
619 | default: 0
620 | example: '1234.567'
621 | selector:
622 | number:
623 | min: 0
624 | max: 999999.999
625 | step: 0.001
626 | unit_of_measurement: m3
627 | mode: box
628 | sequence:
629 | - service: rest_command.mindergas
630 | data:
631 | date: '{{ date }}'
632 | reading: '{{ reading }}'
633 | notification_engine:
634 | alias: Notification Engine
635 | fields:
636 | message:
637 | name: Message
638 | description: The notification message. Required.
639 | required: true
640 | example: Hello world!
641 | selector:
642 | text:
643 | multiline: true
644 | type: text
645 | media_players:
646 | selector:
647 | entity:
648 | domain: media_player
649 | multiple: true
650 | name: Media Players
651 | description: De mediaspelers om het bericht op af te spelen. Bericht wordt niet
652 | afgespeeld indien leeg.
653 | example: '["media_player.living_speaker", "media_player.office_speaker"]'
654 | required: false
655 | emergency:
656 | selector:
657 | boolean: {}
658 | name: Emergency
659 | required: true
660 | description: Spreekt melding uit tijdens stiltetijd. Stuurt een mobiele en permanente
661 | melding.
662 | mobile:
663 | selector:
664 | boolean: {}
665 | name: Mobile
666 | required: true
667 | persistent:
668 | selector:
669 | boolean: {}
670 | name: Blijvend
671 | description: Toont een blijvende melding.
672 | required: true
673 | sequence:
674 | - variables:
675 | emoji_alert: "{{ '\U0001F6A8 ' if emergency }}"
676 | - alias: Maak blijvende melding
677 | if:
678 | - condition: or
679 | conditions:
680 | - condition: template
681 | value_template: '{{ persistent }}'
682 | alias: Blijvend ingeschakeld
683 | - condition: template
684 | value_template: '{{ emergency }}'
685 | alias: Noodgeval
686 | - condition: state
687 | entity_id: input_boolean.do_not_disturb
688 | state: 'on'
689 | then:
690 | - service: notify.persistent_notification
691 | metadata: {}
692 | data:
693 | message: '{{ emoji_alert }}{{ message }}'
694 | - alias: Verzend mobiel bericht
695 | if:
696 | - condition: and
697 | conditions:
698 | - condition: state
699 | entity_id: input_boolean.occupancy_guests
700 | state: 'off'
701 | - alias: Mobiel of Noodgeval
702 | condition: or
703 | conditions:
704 | - alias: Mobiel
705 | condition: template
706 | value_template: '{{ mobile }}'
707 | - alias: Noodgeval
708 | condition: template
709 | value_template: '{{ emergency }}'
710 | - condition: state
711 | entity_id: input_boolean.do_not_disturb
712 | state: 'on'
713 | then:
714 | - service: notify.family
715 | metadata: {}
716 | data:
717 | message: '{{ emoji_alert }}{{ message }}'
718 | - alias: Spreek bericht uit
719 | if:
720 | - condition: and
721 | conditions:
722 | - condition: template
723 | value_template: '{{ media_players != null }}'
724 | alias: Mediaspeler(s) gekozen
725 | - condition: state
726 | entity_id: input_boolean.occupancy_guests
727 | state: 'off'
728 | - condition: or
729 | conditions:
730 | - condition: state
731 | entity_id: input_boolean.do_not_disturb
732 | state: 'off'
733 | - condition: template
734 | value_template: '{{ emergency }}'
735 | alias: Noodgeval
736 | then:
737 | - variables:
738 | chime: '{{ "/config/www/sounds/emergency.mp3" if emergency else "bells" }}'
739 | - service: chime_tts.say
740 | target:
741 | entity_id: '{{ media_players }}'
742 | data:
743 | message: '{{ message }}'
744 | chime_path: '{{ chime }}'
745 | end_chime_path: ''
746 | offset: 450
747 | final_delay: 0
748 | volume_level: 0.3
749 | tts_platform: cloud
750 | language: nl-NL
751 | options:
752 | voice: MaartenNeural
753 | cache: true
754 | announce: true
755 | tts_speed: 100
756 | tts_pitch: 0
757 | join_players: false
758 | unjoin_players: false
759 | enabled: true
760 | mode: single
761 | run_speedtest:
762 | alias: Run Speedtest
763 | sequence:
764 | - service: homeassistant.update_entity
765 | metadata: {}
766 | data: {}
767 | target:
768 | entity_id: sensor.orbi_router_downlink_bandwidth
769 | mode: single
770 | icon: mdi:speedometer
771 |
--------------------------------------------------------------------------------
/secrets.example.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | allowlist_dir_config: .
3 | allowlist_dir_ssl: .
4 | mastodon_access_token: RandomCharacters_123
5 | mastodon_client_id: RandomCharacters_123
6 | mastodon_client_secret: RandomCharacters_123
7 | mindergas_token: RandomCharacters
8 |
--------------------------------------------------------------------------------
/themes/.gitkeep:
--------------------------------------------------------------------------------
1 | the themes folder is referenced in configuration.yaml
--------------------------------------------------------------------------------
/zigbee2mqtt/configuration.yaml:
--------------------------------------------------------------------------------
1 | homeassistant: true
2 | mqtt:
3 | server: '!secrets mqtt_server'
4 | user: '!secrets mqtt_user'
5 | password: '!secrets mqtt_password'
6 | serial:
7 | port: /dev/ttyACM0
8 | adapter: deconz
9 | frontend:
10 | port: 8099
11 | devices:
12 | '0x00158d0007e25295':
13 | friendly_name: Living Climate
14 | '0x00158d000802ad01':
15 | friendly_name: Cube
16 | '0x14b457fffe535557':
17 | friendly_name: Living Speaker Controller
18 | '0x00158d0007e24a05':
19 | friendly_name: Office Climate
20 | temperature_precision: 3
21 | humidity_precision: 3
22 | pressure_precision: 3
23 | '0x70ac08fffea0aea9':
24 | friendly_name: Garage Ingang
25 | occupancy_timeout: 180
26 | illuminance_below_threshold_check: false
27 | '0x84ba20fffead3d8e':
28 | friendly_name: Snelknop Woonkamer
29 | '0x001788010804ffa1':
30 | friendly_name: Office Printer
31 | '0xbc026efffe8ad6d8':
32 | friendly_name: Luchtkwaliteit Woonkamer
33 | temperature_precision: 1
34 | humidity_precision: 1
35 | '0x70ac08fffe8c2ec1':
36 | friendly_name: Charging Station
37 | measurement_poll_interval: 30
38 | power_calibration: 0
39 | state_action: false
40 | power_precision: 3
41 | current_calibration: 0
42 | voltage_calibration: 0
43 | energy_calibration: 0
44 | energy_precision: 3
45 | voltage_precision: 2
46 | '0x943469fffe75d670':
47 | friendly_name: Garage Entreedeur
48 | illuminance_below_threshold_check: true
49 | occupancy_timeout: 180
50 | '0x54ef441000560867':
51 | friendly_name: Office Presence
52 | '0x0017880104eedc4d':
53 | friendly_name: Leeshoek dimmer
54 | '0x142d41fffe5833b8':
55 | friendly_name: Front Door
56 | advanced:
57 | log_level: info
58 | log_syslog:
59 | app_name: Zigbee2MQTT
60 | eol: /n
61 | host: localhost
62 | localhost: localhost
63 | path: /dev/log
64 | pid: process.pid
65 | port: 514
66 | protocol: udp4
67 | type: '5424'
68 | last_seen: ISO_8601
69 | groups:
70 | '1':
71 | friendly_name: living_lights_z2m
72 | devices:
73 | - 0x00178801001057bd/11
74 | - 0x001788010489e455/11
75 | availability:
76 | active:
77 | timeout: 20
78 | passive:
79 | timeout: 1500
80 | device_options:
81 | homeassistant:
82 | last_seen:
83 | enabled_by_default: true
84 |
--------------------------------------------------------------------------------