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

Fixes for Busch-Jaeger devices #5299

Merged
merged 5 commits into from
Jan 23, 2023
Merged

Fixes for Busch-Jaeger devices #5299

merged 5 commits into from
Jan 23, 2023

Conversation

klada
Copy link
Contributor

@klada klada commented Jan 8, 2023

This PR adds a number of improvements and fixes for Busch-Jaeger ZLL devices:

  • Add support for Busch-Jaeger dimmer module (6715 U) by exposing device as a dimmable light
  • Expose the correct endpoint for the light device (see Don't use endpoint-prefixed state/brightness for Busch-Jaeger devices #5097 for a discussion about this)
  • Do not expose state for Busch-Jaeger switch-only devices (without relay endpoint)
  • Do not remove the scenes cluster from battery-operated Busch-Jaeger switch (RB01) as this is not required for these devices

This PR has a few implications:

  • Home Assistant auto-discovery will be changed as the device type changes from switch to light (in order to support dimming)
  • If people want to bind previously paired RB01 devices to ZigBee scenes, they need to remove and re-pair them to Z2M. However there is no actual need to re-pair these devices if this feature is not important for people and they will continue to work fine.
  • Existing BJ devices will be reconfigured, which means that the default bindings will be created again. It should be noted in the release notes that users should check their bindings, if they have messed with them.

Fixes Koenkk/zigbee2mqtt#7077

The BJ ZLL switches/relays/dimmers are currently exposed as switches
with a non-prefixed endpoint. This causes two issues:

- Dimming is not working for the dimmer modules
- Both `state` and `state_relay` is published as an attribute, where
  only `state_relay` makes sense here. However the Z2M UI and Home
  Assistant auto-discovery were both using the "wrong" attribute.

This commit addresses both issues, but will cause some changes for
existing users:

- Home Assistant auto-discovery will change (device changes from switch
  to light)
- All BJ ZLL devices will have a brightness attribute (and brightness
  slider in the Z2M web UI), even if they do not support dimming. This
  is due to the fact that all devices are reported as the same model
  and Z2M cannot distinguish them.
- The top rocker (endpoint 10) will not be bound to the coordinator
  any more if the module was installed on a relay or dimmer. This is
  just a clean-up, which won't have a practical effect.
We don't need to expose all Busch-Jaeger devices as lights, but only the
ones which are actually connected to a relay or dimmer.
The scenes cluster workaround does not seem to be required for the
battery-powered Busch-Jaeger wall switches.

This will only affect freshly paired devices, existing devices will be
kept es they are.
@klada klada marked this pull request as draft January 8, 2023 20:56
@Koenkk
Copy link
Owner

Koenkk commented Jan 9, 2023

Let me know once this is ready for merge.

@klada
Copy link
Contributor Author

klada commented Jan 9, 2023

I'll do more testing next week and I also want to push out some improvements to the documentation. I'll ping you as soon as I am ready ;)

@klada klada changed the title Draft: Fixes for Busch-Jaeger devices Fixes for Busch-Jaeger devices Jan 18, 2023
@klada klada marked this pull request as ready for review January 18, 2023 19:42
@klada
Copy link
Contributor Author

klada commented Jan 18, 2023

@Koenkk This is ready now. In the meantime I have done some testing with my Busch-Jaeger devices. I have the following combinations installed:

  • 4-row device on power-supply
  • 4-row device on dimmer
  • 4-row device on relay
  • 2-row device on relay
  • 1-row device on relay
  • 2-row battery-powered control element
  • 4-row battery-powered control element

Everything has been working for me. I have also tested removing and re-pairing some of the devices.

I have also updated the docs a little bit: Koenkk/zigbee2mqtt.io#1831

I have intentionally split up my changes across multiple commits, so it is easier to review/understand what I was trying to accomplish :)

@Koenkk
Copy link
Owner

Koenkk commented Jan 18, 2023

Home Assistant auto-discovery will be changed as the device type changes from switch to light (in order to support dimming)

I think we can easily avoid this by keeping the e.switch() in (next to the added light expose)

Note to self; after this merge Koenkk/zigbee2mqtt.io#1831

The switch definition for these devices is actually wrong here, but
let's keep it for compatibility reasons as it has been there first.
@klada
Copy link
Contributor Author

klada commented Jan 22, 2023

I think we can easily avoid this by keeping the e.switch() in (next to the added light expose)

@Koenkk Of course, you are completely right. By just keeping e.switch() we won't mess with existing setups. I have also added this in my docs PR so it is clear to people why there is a switch and a light entity.

Tetsted and works in my Home Assistant instance, so this is ready for merging from my side.

The question is if you want to get rid of the (wrong) switch definition at any time or if you'd rather keep it forever.

@Koenkk Koenkk merged commit fe8669c into Koenkk:master Jan 23, 2023
@Koenkk
Copy link
Owner

Koenkk commented Jan 23, 2023

Thanks!

The question is if you want to get rid of the (wrong) switch definition at any time or if you'd rather keep it forever.

I've added a deprecated note, so this can be removed in e.g. Zigbee2MQTT 2.0.

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

Successfully merging this pull request may close these issues.

State not updating (Busch Jäger 6711+6735)
2 participants