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

Busch-Jaeger 6735/6736/6737: Make polling interval configurable #7733

Closed
Ra72xx opened this issue Jul 4, 2024 · 10 comments
Closed

Busch-Jaeger 6735/6736/6737: Make polling interval configurable #7733

Ra72xx opened this issue Jul 4, 2024 · 10 comments

Comments

@Ra72xx
Copy link

Ra72xx commented Jul 4, 2024

I post a feature request because of @Nerivec 's advice in a Z2M bug thread (Koenkk/zigbee2mqtt#22249 (comment)):
These Busch-Jaeger panels (see https://www.zigbee2mqtt.io/devices/6735_6736_6737.html, in the non-battery-powered variant) are to be mounted on different sockets, either a relay, a dimmable switch or a pure mains adaptor as a mere power source.
When mounted on a relay or a dimmer element, the upper row of the panel directly operates the underlying relay/dimmer. This means that the Zigbee network is neither needed nor used in this scenario. The disadvantage is that Z2M is not informed if the switch has been operated manually and has to poll the network for the current state.
This seems to happen every five seconds and in my use case with 9 of such devices leads to so much network traffic that e.g. the "ember" driver is unable to operate reliably (#22249).

I don't know if there is an more elegant solution to this problem, but what would at least help would be:

  • Ability to disable this polling completely: If the panel is only mounted on a mains adaptor, there is no need to poll for any manual operation. Currently this setup is polled, too. As there is no state to be reported, this leads to erraneous pings.
  • Ability to manually extend the polling interval per device: This would only lead to the cosmetic glitch that Z2M and any frontend based on it would reflect the light state a bit later when a manual operation has taken place.
@Koenkk
Copy link
Owner

Koenkk commented Jul 4, 2024

If the panel is only mounted on a mains adaptor,

When connecting it to the mains adapter, do you see anything being logged in the z2m debug log?

See this on how to enable debug logging.

@Ra72xx
Copy link
Author

Ra72xx commented Jul 6, 2024

Maybe the logs I posted in the other thread are enough? A log with the new "ember" driver is here https://github.com/Koenkk/zigbee2mqtt/issues/22249#issuecomment-2203469708 and with "ezsp" hiere https://github.com/Koenkk/zigbee2mqtt/issues/22249#issuecomment-2206748334.

Look for the device named "K: Trafo-Bedienelement-Kombi links" and address "0xd85def11a10049b0". This is a 6736 (two rows) panel mounted on a 6710U mains adapter (contrary to the 6711U relay and the 6715U dimmer, which have to be polled).

@Koenkk
Copy link
Owner

Koenkk commented Jul 9, 2024

Implemented it, it's now configurable and the default is 60 seconds.

Changes will be available in the dev branch in a few hours from now.

@Ra72xx
Copy link
Author

Ra72xx commented Jul 11, 2024

Possible side effect? Slight delay when operating the uppermost row (wired directly to the relay/dimmer) by Zigbee, see https://github.com/Koenkk/zigbee2mqtt/issues/22249#issuecomment-2221918095

@Nerivec
Copy link
Contributor

Nerivec commented Jul 11, 2024

You will have to enable debug level. Seems something is happening in the background that's making Z2M update last seen a bunch of times after the keypress.

@klada
Copy link
Contributor

klada commented Jul 11, 2024

Ability to disable this polling completely: If the panel is only mounted on a mains adaptor, there is no need to poll for any manual operation. Currently this setup is polled, too. As there is no state to be reported, this leads to erraneous pings.

@Ra72xx Are you sure about this? Panels which are mounted on a mains adapter do not have a switch endpoint. Therefore no polling should be performed by z2m.

Anyway I think the configurable poll interval is an excellent idea. I have also added a few more of these BJ devices and I have also noticed slowdowns ever since. The 5 seconds were way too aggressive I think.

@Ra72xx
Copy link
Author

Ra72xx commented Jul 12, 2024

@Ra72xx Are you sure about this? Panels which are mounted on a mains adapter do not have a switch endpoint. Therefore no polling should be performed by z2m.

Well, as I now run the patched version, I cannot post any more logs ;-). However, I think in the logs I posted previously, the panels mounted on the mains adaptor made regular appearences.
I really don't know if there is a difference in Z2M for those Busch Jaeger devices in various setups. they seem to be all handled pretty similar. E.g. with the new patch you can also set the polling interval for the battery powered variant, which does not really make sense (but is hopefully harmless).

@Ra72xx
Copy link
Author

Ra72xx commented Jul 13, 2024

Turning a light on and off again with Zigbee leads to the following log entries, and also an error in the end, works however. There is only a slight (1-3 secs) delay relatively often between Zigbee command and execution.

Info 2024-07-13 05:56:53z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/WZ: Dimmer-Bedienelement-Kombi Tür rechts', payload '{"brightness":254,"brightness_relay":254,"device":{"applicationVersion":1,"dateCode":"20161209","friendlyName":"WZ: Dimmer-Bedienelement-Kombi Tür rechts","hardwareVersion":0,"ieeeAddr":"0xd85def11a10015b8","manufacturerID":4398,"manufacturerName":"Busch-Jaeger","model":"6735/6736/6737","networkAddress":140,"powerSource":"Mains (single phase)","softwareBuildID":"1.2.0","stackVersion":1,"type":"Router","zclVersion":1},"last_seen":"2024-07-13T03:56:53.159Z","linkquality":180,"state":"ON","state_relay":"OFF"}' Info 2024-07-13 05:56:53z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/WZ: Dimmer-Bedienelement-Kombi Tür rechts/relay', payload '{"brightness":254,"state":"OFF"}' Info 2024-07-13 05:56:54z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/WZ: Dimmer-Bedienelement-Kombi Tür rechts', payload '{"brightness":254,"brightness_relay":254,"device":{"applicationVersion":1,"dateCode":"20161209","friendlyName":"WZ: Dimmer-Bedienelement-Kombi Tür rechts","hardwareVersion":0,"ieeeAddr":"0xd85def11a10015b8","manufacturerID":4398,"manufacturerName":"Busch-Jaeger","model":"6735/6736/6737","networkAddress":140,"powerSource":"Mains (single phase)","softwareBuildID":"1.2.0","stackVersion":1,"type":"Router","zclVersion":1},"last_seen":"2024-07-13T03:56:54.185Z","linkquality":180,"state":"ON","state_relay":"OFF"}' Info 2024-07-13 05:56:54z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/WZ: Dimmer-Bedienelement-Kombi Tür rechts/relay', payload '{"brightness":254,"state":"OFF"}' Info 2024-07-13 05:56:54z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/WZ: Dimmer-Bedienelement-Kombi Tür rechts', payload '{"brightness":254,"brightness_relay":254,"device":{"applicationVersion":1,"dateCode":"20161209","friendlyName":"WZ: Dimmer-Bedienelement-Kombi Tür rechts","hardwareVersion":0,"ieeeAddr":"0xd85def11a10015b8","manufacturerID":4398,"manufacturerName":"Busch-Jaeger","model":"6735/6736/6737","networkAddress":140,"powerSource":"Mains (single phase)","softwareBuildID":"1.2.0","stackVersion":1,"type":"Router","zclVersion":1},"last_seen":"2024-07-13T03:56:54.826Z","linkquality":180,"state":"ON","state_relay":"OFF"}' Info 2024-07-13 05:56:54z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/WZ: Dimmer-Bedienelement-Kombi Tür rechts/relay', payload '{"brightness":254,"state":"OFF"}' Info 2024-07-13 05:56:56z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/WZ: Dimmer-Bedienelement-Kombi Tür rechts', payload '{"brightness":254,"brightness_relay":254,"device":{"applicationVersion":1,"dateCode":"20161209","friendlyName":"WZ: Dimmer-Bedienelement-Kombi Tür rechts","hardwareVersion":0,"ieeeAddr":"0xd85def11a10015b8","manufacturerID":4398,"manufacturerName":"Busch-Jaeger","model":"6735/6736/6737","networkAddress":140,"powerSource":"Mains (single phase)","softwareBuildID":"1.2.0","stackVersion":1,"type":"Router","zclVersion":1},"last_seen":"2024-07-13T03:56:56.270Z","linkquality":180,"state":"ON","state_relay":"OFF"}' Info 2024-07-13 05:56:56z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/WZ: Dimmer-Bedienelement-Kombi Tür rechts/relay', payload '{"brightness":254,"state":"OFF"}' Info 2024-07-13 05:56:58z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/WZ: Dimmer-Bedienelement-Kombi Tür rechts', payload '{"brightness":254,"brightness_relay":254,"device":{"applicationVersion":1,"dateCode":"20161209","friendlyName":"WZ: Dimmer-Bedienelement-Kombi Tür rechts","hardwareVersion":0,"ieeeAddr":"0xd85def11a10015b8","manufacturerID":4398,"manufacturerName":"Busch-Jaeger","model":"6735/6736/6737","networkAddress":140,"powerSource":"Mains (single phase)","softwareBuildID":"1.2.0","stackVersion":1,"type":"Router","zclVersion":1},"last_seen":"2024-07-13T03:56:58.304Z","linkquality":180,"state":"ON","state_relay":"OFF"}' Info 2024-07-13 05:56:58z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/WZ: Dimmer-Bedienelement-Kombi Tür rechts/relay', payload '{"brightness":254,"state":"OFF"}' Info 2024-07-13 05:56:58z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/WZ: Dimmer-Bedienelement-Kombi Tür rechts', payload '{"brightness":254,"brightness_relay":254,"device":{"applicationVersion":1,"dateCode":"20161209","friendlyName":"WZ: Dimmer-Bedienelement-Kombi Tür rechts","hardwareVersion":0,"ieeeAddr":"0xd85def11a10015b8","manufacturerID":4398,"manufacturerName":"Busch-Jaeger","model":"6735/6736/6737","networkAddress":140,"powerSource":"Mains (single phase)","softwareBuildID":"1.2.0","stackVersion":1,"type":"Router","zclVersion":1},"last_seen":"2024-07-13T03:56:58.304Z","linkquality":180,"state":"ON","state_relay":"OFF"}' Info 2024-07-13 05:56:58z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/WZ: Dimmer-Bedienelement-Kombi Tür rechts/relay', payload '{"brightness":254,"state":"OFF"}' Info 2024-07-13 05:56:59z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/WZ: Dimmer-Bedienelement-Kombi Tür rechts', payload '{"brightness":254,"brightness_relay":254,"device":{"applicationVersion":1,"dateCode":"20161209","friendlyName":"WZ: Dimmer-Bedienelement-Kombi Tür rechts","hardwareVersion":0,"ieeeAddr":"0xd85def11a10015b8","manufacturerID":4398,"manufacturerName":"Busch-Jaeger","model":"6735/6736/6737","networkAddress":140,"powerSource":"Mains (single phase)","softwareBuildID":"1.2.0","stackVersion":1,"type":"Router","zclVersion":1},"last_seen":"2024-07-13T03:56:59.754Z","linkquality":176,"state":"ON","state_relay":"OFF"}' Info 2024-07-13 05:56:59z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/WZ: Dimmer-Bedienelement-Kombi Tür rechts/relay', payload '{"brightness":254,"state":"OFF"}' Error 2024-07-13 05:57:04z2m: Publish 'set' 'state' to 'WZ: Dimmer-Bedienelement-Kombi Tür rechts' failed: 'Error: ZCL command 0xd85def11a10015b8/18 genLevelCtrl.moveToLevelWithOnOff({"level":254,"transtime":0}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed ({"target":140,"apsFrame":{"profileId":260,"clusterId":8,"sourceEndpoint":1,"destinationEndpoint":18,"options":4416,"groupId":0,"sequence":212},"zclSequence":126,"commandIdentifier":11} timed out after 10000ms)'

@klada
Copy link
Contributor

klada commented Jul 13, 2024

I think this does not have anything to do with this issue. However I can think of a few things here:

  • How did you chose your ZigBee channel? Are you sure it is far enough away from your WiFi channels? Did you do a energy scan with zigpy-znp for planning channels?
  • With these BJ devices you should use direct binding whenever possible. Reaction will be instant and smooth in this case. You need to create groups for binding, check the Z2M docs for this.
  • When controlling the devices through MQTT make sure to always use "state_relay" instead of "state".

@Ra72xx
Copy link
Author

Ra72xx commented Jul 14, 2024

  • With these BJ devices you should use direct binding whenever possible. Reaction will be instant and smooth in this case. You need to create groups for binding, check the Z2M docs for this.

However, this cannot be the reason of the delay IMHO, because my delay occurs when operating the relay over Zigbee, not by manually using the panel. Using the panel reacts fast enough for me even without direct binding.

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

4 participants