Is there a way to get the value of a specific attribute in a Zigbee cluster?

I have a Zigbee smartplug that is able to measure the active power value. I can see this value correctly in the device’s actual state, but it’s not refreshing fast enough for my need (every 30 seconds or so). When I use the Zigbee panel, however, I’m able to select the proper cluster and attribute and then continuously click the “Get Zigbee Attribute” button as quickly as I need to get the value.

Is there a way for me to poll for the value faster either via the HTTP API or using a service just like I was doing with the button? The sensor’s cluster was ElectricalMeasurement (Endpoint id: 1, Id: 0x0b04, Type: in) and the attribute was active_power (id: 0x050b)

It should update whenever the value changes. Is it no doing that?

When I look at the States section of the developer tools yes, it does. But the value only updates every 30 seconds. If I use the “Get Zigbee Attribute” button, I can get it every 1 second by clicking the button fast enough. I’d like to be able to get that value at a rate of 1 second, possibly using some Python code.

Why? If it always shows the latest value, why do you have to hammer the update?

Because it doesn’t always show the latest value. It only updates the value every 30 seconds, but the value changes way more often than that when I manually use the Zigbee button to get the attribute’s value. I’m surprised there isn’t a zha.get_zigbee_cluster_attribute like there is a zha.set_zigbee_cluster_attribute

You said it changes when the value changes.

Lol I think maybe I’m not explaining myself properly, I’m sorry :sweat_smile:

In the state panel the value updates every 30 seconds but this update rate is too slow for what I need. Given that it’s possible to get a newer updated value by using the Get Zigbee Attribute button, is it possible to perform that button’s action from within the context of an automation?

My objective is to be able to retrieve the smartplug’s value every 1 second