Koenkk / zigbee-herdsman-converters

Collection of device converters to be used with zigbee-herdsman
MIT License
861 stars 2.85k forks source link

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

Closed Ra72xx closed 5 days ago

Ra72xx commented 1 week ago

I post a feature request because of @Nerivec 's advice in a Z2M bug thread (https://github.com/Koenkk/zigbee2mqtt/issues/22249#issuecomment-2207153830): 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:

Koenkk commented 1 week ago

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 commented 1 week ago

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 commented 5 days ago

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 commented 3 days ago

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 commented 3 days ago

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 commented 3 days ago

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 commented 2 days ago

@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 commented 1 day ago

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 commented 1 day ago

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

Ra72xx commented 17 hours ago
  • 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.