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

Zigbee & Z-Wave Things missing properties #3126

Closed
benfrancis opened this issue Mar 8, 2024 · 4 comments · Fixed by WebThingsIO/zigbee-adapter#333 or WebThingsIO/zigbee-adapter#335
Labels
Milestone

Comments

@benfrancis
Copy link
Member

Testing with WebThings Gateway 1.2.0-alpha.1, I can confirm that Zigbee and Z-Wave smart plugs of models that are previously known to work with 1.1 are missing properties in their Thing Descriptions.

STR:

  • Upgrade 1.1 gateway to 1.2.0-alpha.1
  • Add a SmartThings Zigbee smart plug
  • Add an Aeotec Z-Wave smart plug

Expected:

  • Both smart plugs appear in the Things screen and their on properties can be monitored and controlled

Actual:

  • Devices are added and logs show that the Zigbee and Z-Wave adapters are receiving changes in property values, but the properties do not appear in the web interface.
  • The Thing Descriptions of the newly added devices have no properties, actions or events
@benfrancis
Copy link
Member Author

Trying to debug this, I cloned and built the master branch of the zigbee-adapter repo into the add-ons folder and managed to pair and use a Zigbee smart plug without any issues. When I swap the add-on out for the 0.21.1 packaged and released version it stops working.

If I manually build the released 0.21.1 tag it keeps working.

I've not figured out what's going on yet. I have noticed the version of the gateway-addon package listed as a devDependency in the Zigbee add-on is older (1.0.0) than the one shipped with the gateway (1.2.0-alpha.1), but it should ideally be backwards compatible.

@benfrancis
Copy link
Member Author

Notably, if I npm prune --production on the 0.21.1 checkout after building (one of the steps carried out by the packaging script) to remove the devDependencies, it seems to stop working.

This suggests to me that during development the adapter is using its own gateway-addon 1.0.0 module, but once packaged it's traversing up the tree and using the gateway's central gateway-addon 1.2.0-alpha.1 module, and not working properly with that version.

This is further supported by the fact that the Z-wave add-on also lists gateway-addon 1.0.0 as a devDependency (and is broken), but the virtual-things-adapter doesn't (and is working fine). I guess that's why we tell people never to add it as a dependency for an add-on!

Next steps:

  • Upgrade the devDependency (or remove it if possible)
  • Test the add-on with both gateway 1.2 and gateway 1.1 (to make sure it's backwards compatible)

@benfrancis
Copy link
Member Author

Update: I've tried upgrading the gateway-addon dependency of the zigbee-adapter to the same version used in gateway 1.2.0-alpha.1, but so far that alone doesn't seem to fix the problem WebThingsIO/zigbee-adapter#333

More debugging required.

@benfrancis
Copy link
Member Author

I think I've figured out what's going on, at least for the Zigbee add-on, and I should have realised earlier.

The Zigbee adapter is deleting all properties from Thing Descriptions that don't have a truthy visible member.

I forgot we removed support for the visible member on master but re-introduced it on the 1.1 branch (for this reason). See #3038 for a full explanation.

Ideally we should fix this in individual add-ons rather than keeping this deprecated feature around for another release, but unfortunately it doesn't like the deprecation warning we added actually gets printed to the console so add-on developers may not have noticed it.

This may require some research to find out how many add-ons use the visible feature.

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