-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Don't use endpoint-prefixed state/brightness for Busch-Jaeger devices #5097
Conversation
The Busch-Jaeger devices may have multiple endpoints, depending on the rocker type which is installed. The following endpoints may be present: - 10, 11, 12, 13: These are the endpoints for the rockers which report events. They do not report any state/brightness (genOnOff/genLevelCtrl only in output-cluster). - 18: Only present if the device is controlling a relay or a dimmer. This is the only endpoint which reports a state/brightness (genOnOff/ genLevelCtrl only in input-cluster). The `meta.multiEndpoint` setting is required for prefixing the events reported by endpoints 10 to 13 with the endpoint name (row number in this case). However this device only has a single state (reported by endpoint 18) as it only controls up to one relay/dimmer. This is why a prefixed state attribute such as `state_relay` does not make sense here and needlessly breaks both Home Assistant discovery (state of discovered lights never update) and the web frontend, which both only care about the `state` property. Since these devices only have (up to) one state we can safely remove the endpoint prefix for both `state` and `brightness`.
This is indeed a breaking change, however I don't plan to release any new major Z2M version soon. So wondering if we shouldn't just keep this as is. |
The question is if you would be okay with a breaking change for 1.29.x? If you'd rather not break things at all we could also try to fix this in a non-breaking way. I guess this can be done by using a device-specific converter which processes both if (msg.data.hasOwnProperty('onOff')) {
return {
state: msg.data['onOff'] === 1 ? 'ON' : 'OFF',
state_relay: msg.data['onOff'] === 1 ? 'ON' : 'OFF'
};
} This would keep setups working where people set |
This seems to be the root cause which needs to be fixed instead. |
@Koenkk The problem is described in Koenkk/zigbee2mqtt#7077. Short summary of the behavior/problem without my patch: Let's assume the switch's MQTT info initially looks like this: {"brightness_relay":254, "linkquality":153,"state":"OFF","state_relay":"OFF"} Home Assistant discovery adds this as a switch which sets the
Could the reason for this behavior be a wrong |
|
Nice, this does the trick! So simple... 👍 But I still think So I'd suggest the following: Don't change this now and wait until I get my hands on a dimmer so I can test Additional information about these Busch-Jaeger devicesUnfortunately both the dimmer and the relay have the same ZigBee model string ( This means we'd always have to expose a brightness control (also for relays), even if the device might not support it. However this is the same thing as the Hue Bridge does with these devices. In the Hue ecosystem the Busch-Jaeger relays also are exposed as dimmable lights and the brightness control simply does nothing to them. |
Add `brightness_force_single_endpoint` and `on_off_force_single_endpoint` from PR Koenkk#5097
Yes, thats fine |
This pull request is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days |
The Busch-Jaeger devices may have multiple endpoints, depending on the rocker type which is installed. The following endpoints may be present:
10, 11, 12, 13: These are the endpoints for the rockers which report events. They do not report any state/brightness (genOnOff/genLevelCtrl only in output-cluster).
18: Only present if the device is controlling a relay or a dimmer. This is the only endpoint which reports a state/brightness (genOnOff/ genLevelCtrl only in input-cluster).
The
meta.multiEndpoint
setting is required for prefixing the events reported by endpoints 10 to 13 with the endpoint name (row number in this case). However this device only has a single state (reported by endpoint 18) as it only controls up to one relay/dimmer.This is why a prefixed state attribute such as
state_relay
does not make sense here and needlessly breaks both Home Assistant discovery (state of discovered lights never update) and the web frontend, which both only care about thestate
property.Since these devices only have (up to) one state we can remove the endpoint prefix for both
state
andbrightness
.state_relay
is not being updated any more and cannot be set any more. This is potentially a breaking change, depending on which attribute people were using in the past. I guess this can only be included in a new major Z2M release.state_relay
attribute with this PR, but it will rot forever in thestate.json
file of older installations. Is there anything we can do about that?