Right now, a Zigbee cluster attribute can be set programmatically from a Python script like so:
service_data1 = {
"ieee": "some_ieee",
"endpoint_id": 11,
"cluster_id": 6,
"cluster_type": "in",
"attribute": 16387,
"value": 255,
}
hass.services.call("zha", "set_zigbee_cluster_attribute", service_data1, False)
However, I couldn’t find a way to read an attribute programatically. Maybe it’s possible through issue_zigbee_cluster_command
, but I don’t know the command for that, and I couldn’t find any documentation on this.
This would be useful to verify certain actions, for example, that the above service call succeeded, or in general scripts where reading a cluster attribute is useful.
Concrete example: After configuring the Hue lights’ power-on behavior with set_zigbee_cluster_attribute
, we want to verify that our operation was successful by reading that value after the change. Note that some ZHA commands fail silently (the set
operation “works” but reading the value proves it didn’t actually succeed)