home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
69.8k stars 28.94k forks source link

ERROR:homeassistant.components.automation:Automation with alias 'trigger-device-offline' failed to setup triggers and has been disabled: Device '0123456789abcd' has no config entry from domain 'zha' #120965

Open Abdull opened 5 days ago

Abdull commented 5 days ago

The problem

I want to set up an automation that whenever my Zigbee water sensor (device_id: 0123456789abcd) "disappears" (e.g. bad reception, stolen, battery empty, destroyed etc.), I'm given a notification.

Zigbee ZHA devices provide a "device trigger" named "Device offline", which sounds fitting for what I want to accomplish.

image

But setting up an automation with the "Device offine" trigger results in the following error message, e.g. when running hass --script check_config:

(homeassistant) homeassistant@mymachine:~/.homeassistant$ hass --script check_config
Testing configuration at /home/homeassistant/.homeassistant
ERROR:homeassistant.components.automation:Automation with alias 'trigger-device-offline' failed to setup triggers and has been disabled: Device '0123456789abcd' has no config entry from domain 'zha'

Notably, the corresponding entry in ~/.homeassistant/automations.yaml looks like this:

# ...
- id: '44332211'
  alias: trigger-device-offline
  description: ''
  trigger:
  - device_id: 0123456789abcd
    domain: zha
    platform: device
    type: device_offline
    subtype: device_offline
  condition: []
  action:
  - service: light.turn_on
    metadata: {}
    data: {}
    target:
      entity_id: light.osram_cla60_tw_osram_abcd1234_level_light_color_on_off
  mode: single
# ...

Maybe relevant: notice that while there is device_id: 0123456789abcd, there does not exist an entity_id: xyz for the device offline.

What version of Home Assistant Core has the issue?

core-2024.6.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Core

Integration causing the issue

Device automation

Link to integration documentation on our website

https://www.home-assistant.io/integrations/device_automation/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 5 days ago

Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (device_automation) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `device_automation` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign device_automation` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


device_automation documentation device_automation source (message by IssueLinks)