Replies: 1 comment
-
This is the way I do it: import homeassistant.helpers.template as template
from homeassistant.helpers import device_registry
# optionally get device id by entity id
ENTITY_ID = 'light.office'
DEVICE_ID = template.device_id(hass, ENTITY_ID)
# disable
registry.async_update_device(device_id=DEVICE_ID, disabled_by=device_registry.DeviceEntryDisabler.USER)
# enable
registry.async_update_device(device_id=DEVICE_ID, disabled_by=None) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When inspecting a device via the Home Assistant UI, there is an option to enable or disable it:
Is there any way for PyScript to programmatically toggle the enabled/disabled status of a device? I wasn't able to identify a HA service for this.
Beta Was this translation helpful? Give feedback.
All reactions