Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

How to get device attributes and entities of a ZHA device based on the device_ieee id? #496

Unanswered
redlefloh asked this question in Q&A
Discussion options

Hi,
how can I get all attributes, entities etc. of a zha device once I caught a zha_event. To illustrate, I use the following event_trigger in pyscript:

@event_trigger("zha_event")
def zigbee_zha_event(**kwargs):
 log.warning(f"Zigbee zha_event: {kwargs}")
 notify.email_me_via_email(title="Zigbee zha_event", message=f"kwargs: {kwargs}")

The kwargs I get back are for example:

kwargs: {'trigger_type': 'event', 'event_type': 'zha_event', 'context': <homeassistant.core.Context object at 0x7f8dc35df0>, 'device_ieee': '00:15:8d:00:09:1b:23:6a', 'unique_id': '00:15:8d:00:09:1b:23:6a:1:0x0006', 'device_id': '9823539c2d722f81b022da838f275fa0', 'endpoint_id': 1, 'cluster_id': 6, 'command': 'attribute_updated', 'args': {'attribute_id': 0, 'attribute_name': 'on_off', 'value': <Bool.false: 0>}, 'params': {}}

But I would like to also get e.g. the name of the device that triggered the event, all the attributes, and also the entities of e.g. the sensors that belong to that device.

Any suggestions? Thanks!!

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /