Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't set Zigbee Attributes #101

Closed
harrismck opened this issue Jun 4, 2024 · 8 comments
Closed

Can't set Zigbee Attributes #101

harrismck opened this issue Jun 4, 2024 · 8 comments

Comments

@harrismck
Copy link

harrismck commented Jun 4, 2024

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
Copy link
Owner

pvvx commented Jun 4, 2024

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"

@harrismck
Copy link
Author

harrismck commented Jun 5, 2024

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
Copy link
Owner

pvvx commented Jun 5, 2024

image

image

@harrismck
Copy link
Author

image
image
Hmmm

@pvvx
Copy link
Owner

pvvx commented Jun 5, 2024

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.

@harrismck
Copy link
Author

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
Copy link
Owner

pvvx commented Jun 7, 2024

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...

@harrismck
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants