pvvx/ZigbeeTLc

Can't set Zigbee Attributes

Closed this issue · 8 comments

According to the docs, I should be able to set min/max comfort temp/humidity values via Zigbee attributes, but those attributes don't seem to exist. In ZHA, looking at the UserInterface cluster, I only see these three attributes:
image
I tried setting the value manually with the zha.set_zigbee_cluster_attribute service call, but I get this error:
Unexpected error for call_service at pos 1: Cluster 204 not found on endpoint 1 while writing attribute 102 with value 1800
image

My device is a LYWSD03MMC-z by Xiaomi, and I have just flashed the latest firmware (reported as 0x01213001 in HA)

pvvx commented

ClusterID: 0x0204 (HEX) -> 516 (DEC)
Attr: 0x0102 (HEX) -> 258 (DEC)

service: zha.set_zigbee_cluster_attribute
data:
  cluster_type: out
  value: "1800"
  ieee: a4:c1:38:xx:xx:xx:xx:xx
  endpoint_id: 1
  cluster_id: 516
  attribute: 258

ZHA Toolkit:

service: zha_toolkit.attr_write
data:
  ieee: a4:c1:38:xx:xx:xx:xx:xx
  endpoint: 1
  cluster: 516
  attribute: 258
  attr_val: "1800"

Ah, of course the HA values aren't in hex, woops.
However, even after fixing that, I still get the error Cluster 516 not found on endpoint 1 while writing attribute 258 with value 1800
I tried your yaml for ZHA exactly (except the ieee).

I got ZHA toolkit, tried it as well, and the response had the error: DeliveryError('Failed to deliver message: <EmberStatus.DELIVERY_FAILED: 102>')

pvvx commented

image

image

image
image
Hmmm

pvvx commented

Have you changed "Measurement interval"?
Attr: 0x0107, UINT8 (id:0x20), Measurement interval, range: 3..255 seconds. Default 10 seconds.

This is the interval after which communication with the device will occur. If the interval is large (over 6 sec), then the command must be repeated or the button on the device must be briefly pressed. The LYWSD03MMC has "Gnd" and "Reset" contacts instead of a button.

I'm using Coordinator EZSP by Silicon Labs (EFR32MG21). With the correct firmware there are fewer problems with it.

I haven't changed Measurement Interval. Checking it with ZHA toolkit's read attribute, it's set to 10.
I'm using a HomeAssistant SkyConnect (AKA a CP2102N from Silicon Labs).

Bizarrely, I was able to set the min comfort temp just now through ZHA toolkit.... by removing the quotes around the value. Confirmed it has been set by reading the attribute.
Doesn't explain why the ZHA service call doesn't work, nor why these attributes don't show in the Manage Zigbee Device UI.

Here's an example of succesfully setting it to 17 degrees:
image

pvvx commented

Doesn't explain why the ZHA service call doesn't work, nor why these attributes don't show in the Manage Zigbee Device UI.

These attributes are not standard in the Zigbee 3.0 specification.
The Zigbee 3.0 specification contains virtually no attributes for configuring devices.
In this case, ZHA sets some values ​​that are in the specification at its discretion, without providing an interface to the user. Such settings can only be changed by patching the ZHA code.

#6

Because of this disgrace, we have to exclude some standard clusters in the device code, since ZHA installs them incorrectly (without checking device restrictions specified in the Zigbee 3.0 specification) - PoolControl

And there are several hundred such deviations in the current versions of ZHA and Z2M...

Ahhh that makes sense! Thanks. Not entirely sure why removing the quotes around the value was important, but hey, it works.