Created
August 30, 2020 09:18
-
-
Save AlexxIT/8bc8c6b0802dfcfd13aee733134a8343 to your computer and use it in GitHub Desktop.
Home Assistant remove Device automation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# custom component: https://github.com/AlexxIT/PythonScriptsPro | |
python_script: | |
automation: | |
trigger: | |
platform: event | |
event_type: device_registry_updated | |
action: | |
service: python_script.exec | |
data_template: | |
device_id: "{{ trigger.event.data.device_id }}" | |
source: | | |
registry = hass.data['device_registry'] | |
device = registry.async_get(data['device_id']) | |
if device and device.name_by_user == 'delete': | |
registry.async_remove_device(data['device_id']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
delete
Для удаления устройства его нужно переименовать в
delete