Duplicated messages
When I click a button (lumi.remote.b1acn), sometimes zigbee2mqtt produce more then one event
zigbee2mqtt:info 2018-12-3 15:01:34 MQTT publish, topic: 'zigbee2mqtt/Button1', payload: '{"battery":99,"voltage":3025,"linkquality":0,"click":"single"}'
zigbee2mqtt:info 2018-12-3 15:01:34 MQTT publish, topic: 'zigbee2mqtt/Button1', payload: '{"battery":99,"voltage":3025,"linkquality":0,"click":"single"}'
zigbee2mqtt:info 2018-12-3 15:01:34 MQTT publish, topic: 'zigbee2mqtt/Button1', payload: '{"battery":99,"voltage":3025,"linkquality":0,"click":"single"}'
zigbee2mqtt:info 2018-12-3 15:01:35 MQTT publish, topic: 'zigbee2mqtt/Button1', payload: '{"battery":99,"voltage":3025,"linkquality":0,"click":"single"}'
more often it happens when link quality is about 0.
The button produces a lot of Report Attributes commands in purpose to deliver them, but all of that commands have the same Sequence Number. Is there a way to filter commands with the same Sequence Number?
I have the same problem with my Aqara temp/humi/pressure and human body sensors.
Most of the times each message is send twice.
zigbee2mqtt:info 2018-12-3 21:35:22 MQTT publish, topic: 'common/gateway/zigbee2mqtt/0x00158d0002b71fdf', payload: '{"illuminance":54,"linkquality":49,"occupancy":false}'
zigbee2mqtt:info 2018-12-3 21:35:22 MQTT publish, topic: 'common/gateway/zigbee2mqtt/0x00158d0002b71fdf', payload: '{"illuminance":54,"linkquality":49,"occupancy":true}'
zigbee2mqtt:info 2018-12-3 21:35:51 MQTT publish, topic: 'common/gateway/zigbee2mqtt/0x00158d0002b71fdf', payload: '{"illuminance":54,"linkquality":44,"occupancy":true}'
zigbee2mqtt:info 2018-12-3 21:35:51 MQTT publish, topic: 'common/gateway/zigbee2mqtt/0x00158d0002b71fdf', payload: '{"illuminance":54,"linkquality":42,"occupancy":true}'
zigbee2mqtt:info 2018-12-3 21:35:56 MQTT publish, topic: 'common/gateway/zigbee2mqtt/0x00158d0002b71fdf', payload: '{"illuminance":54,"linkquality":49,"occupancy":true}'
zigbee2mqtt:info 2018-12-3 21:35:56 MQTT publish, topic: 'common/gateway/zigbee2mqtt/0x00158d0002b71fdf', payload: '{"illuminance":54,"linkquality":49,"occupancy":true}'
zigbee2mqtt:info 2018-12-3 21:36:07 MQTT publish, topic: 'common/gateway/zigbee2mqtt/0x00158d0002b71fdf', payload: '{"illuminance":54,"linkquality":55,"occupancy":true}'
zigbee2mqtt:info 2018-12-3 21:36:07 MQTT publish, topic: 'common/gateway/zigbee2mqtt/0x00158d0002b71fdf', payload: '{"illuminance":54,"linkquality":55,"occupancy":true}'
zigbee2mqtt:info 2018-12-3 21:37:04 MQTT publish, topic: 'common/gateway/zigbee2mqtt/0x00158d0002b71fdf', payload: '{"illuminance":54,"linkquality":52,"occupancy":true}'
zigbee2mqtt:info 2018-12-3 21:37:04 MQTT publish, topic: 'common/gateway/zigbee2mqtt/0x00158d0002b71fdf', payload: '{"illuminance":54,"linkquality":49,"occupancy":true}'
zigbee2mqtt:info 2018-12-3 21:37:10 MQTT publish, topic: 'common/gateway/zigbee2mqtt/0x00158d0002b71fdf', payload: '{"illuminance":54,"linkquality":60,"occupancy":true}'
zigbee2mqtt:info 2018-12-3 21:37:10 MQTT publish, topic: 'common/gateway/zigbee2mqtt/0x00158d0002b71fdf', payload: '{"illuminance":54,"linkquality":60,"occupancy":true}'
zigbee2mqtt:info 2018-12-3 21:37:36 MQTT publish, topic: 'common/gateway/zigbee2mqtt/0x00158d0002b71fdf', payload: '{"illuminance":53,"linkquality":60,"occupancy":true}'
zigbee2mqtt:info 2018-12-3 21:37:36 MQTT publish, topic: 'common/gateway/zigbee2mqtt/0x00158d0002b71fdf', payload: '{"illuminance":53,"linkquality":60,"occupancy":true}'
zigbee2mqtt:info 2018-12-3 21:37:54 MQTT publish, topic: 'common/gateway/zigbee2mqtt/0x00158d0002b71fdf', payload: '{"illuminance":53,"linkquality":57,"occupancy":true}'
zigbee2mqtt:info 2018-12-3 21:37:54 MQTT publish, topic: 'common/gateway/zigbee2mqtt/0x00158d0002b71fdf', payload: '{"illuminance":53,"linkquality":57,"occupancy":true}'
Threre are a lot of cases when such behaviour doesn't produce any big problems, for instance, illuminance, occupancy, temperature and etc data and events have to be analysed by time anyway, but in some cases (for instance clicking not fixed button) such behaviour turns the automation system into a random number generator.
@lych could you share your debug log? (set log_level debug https://github.com/Koenkk/zigbee2mqtt/wiki/Configuration)
https://pastebin.com/Zckx5zKb Starting from 20:20:43 all messages were caused by one click.
We need to figure out if the messages are send by the device them-self.
Could you sniff the packets from the button? (http://www.inzoolee.com/capture-zigbee-packets/)
@Koenkk I'm used to using zboss sniffer with wireshark, but if you want I can do it by folowing your link.
pcap file
Starting from packet 1642, I had clicked the button once and it sent 20 Report Attributes commands and all of them with Sequence number 45 in ZCL frame. There are a lot of such clicks in the dump. The button increments Sequence number each new click.
@lych does this also happen with other lumi.remote.b1acn?
I don't know, I have only one, but it seems that my lumi.weather behaves the same way, as @MarsWarrior wrote above. It happens when the link is bad (link quality 0). I'll try to sniff the packets.
Although I haven't managed to catch the same behavior with lumi.weather, it is much more difficult to catch it because I cannot influence on the process of sending data directly, but it also sends a lot of packets with the same Sequence Number. Nonetheless, there is a difference. There are 3 different Sequence Numbers in each packet. In IEEE 802.15.4 part, in the Zigbee network layer data and in the Zigbee Cluster Library Frame. According to the dump, in most cases, all three Sequence Numbers change simultaneously, but sometimes first two Sequence numbers change, but Sequence Number in ZCL frame remains unchanged (for instance packets 1642 and 1644 in the damp) . It seems that at this moment duplicated data appear. It looks like something (dongle firmware? zigbee2mqtt?) drops the packets with the same Sequence Number in IEEE 802.15.4 part and in the Zigbee Network Layer Data, but doesn't do it for packets with the same Sequence Numbers in ZCL frame.
@lych zigbee2mqtt doesn't do that, it's either the firmware or zigbee-shepherd who does this.
@Koenkk I'm not sure that my conclusions are correct because I'm still not familiar enough with the Zigbee protocol. If such packets have to be filtered, who shoud do it? I think it can't be dongle firmaware because it's too high level for it. Shoud I move this problem to zigbee-shepherd project?
You can, but it will probably not be solved because it's not maintained anymore.
What I found strange is that this issue happens only to you, me and many other have these devices and they work without problems. I still think there is something wrong with your device.
It can be the button of course, and I'll check it when I get another one. But I think, I only one who has this problem just because it's quite difficult to notice. To have it, one needs to run by the button something noticable, like lighting, and one click have to invert its state and link quality have to be about 0. Only in this way this construction starts to work like a random stroboscope :)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I got the same issue with a recently flashed CC2531 USB stick with all the instructions. Everything seems to work well apart from that
Here is what happen when clicking on and off on a Philips Hue Remote paired with zigbee2mqtt (device id has been altered in the log for a bogus id).
A Xiaomi sensor is working allright (no duplicate) and all the pairing went smoothly.
zigbee2mqtt:info 2019-2-12 00:44:01 Zigbee publish to device '0x0017777777777777', genOnOff - off - {} - {"manufSpec":0,"disDefaultRsp":0} - null
zigbee2mqtt:info 2019-2-12 00:44:01 MQTT publish: topic 'zigbee2mqtt/0x0017777777777777', payload '{"state":"OFF","brightness":254}'
zigbee2mqtt:info 2019-2-12 00:44:01 MQTT publish: topic 'zigbee2mqtt/0x0017777777777777', payload '{"state":"OFF","brightness":254}'
zigbee2mqtt:info 2019-2-12 00:44:01 MQTT publish: topic 'zigbee2mqtt/0x0017777777777777', payload '{"state":"OFF","brightness":254}'
zigbee2mqtt:info 2019-2-12 00:44:25 MQTT publish: topic 'zigbee2mqtt/0x0017880102c134a9', payload '{"battery":100,"linkquality":73,"action":"on"}'
zigbee2mqtt:info 2019-2-12 00:44:26 Zigbee publish to device '0x0017777777777777', genOnOff - on - {} - {"manufSpec":0,"disDefaultRsp":0} - null
zigbee2mqtt:info 2019-2-12 00:44:26 MQTT publish: topic 'zigbee2mqtt/0x0017777777777777', payload '{"state":"ON","brightness":254}'
zigbee2mqtt:info 2019-2-12 00:44:26 Zigbee publish to device '0x0017777777777777', genOnOff - on - {} - {"manufSpec":0,"disDefaultRsp":0} - null
zigbee2mqtt:info 2019-2-12 00:44:26 MQTT publish: topic 'zigbee2mqtt/0x0017777777777777', payload '{"state":"ON","brightness":254}'
zigbee2mqtt:info 2019-2-12 00:44:26 MQTT publish: topic 'zigbee2mqtt/0x0017777777777777', payload '{"state":"ON","brightness":254}'
zigbee2mqtt:info 2019-2-12 00:44:26 MQTT publish: topic 'zigbee2mqtt/0x0017777777777777', payload '{"state":"ON","brightness":254}'
@viboux can you post your debug log (http://zigbee2mqtt.io/configuration/configuration.html)
My cube started doing this. I'm pretty sure when I first set it up this wasn't happening. The volume on my TV started going crazy which is how I finally tracked this down.
I watched the MQTT data which shows one message using mosquitto_sub -v -t '#' . But for some reason two state changes are registered in HASS.
@viboux can you post your debug log (http://zigbee2mqtt.io/configuration/configuration.html)
You mean by changing the log level to debug instead of info? Or doing more?
Here is my version number (firmware and zigbee2mqtt). 2019-2-12 00:56:58 - info: Starting zigbee2mqtt version 1.1.1 (commit #unknown) 2019-2-12 00:56:58 - info: Starting zigbee-shepherd 2019-2-12 00:57:00 - info: zigbee-shepherd started 2019-2-12 00:57:00 - info: Coordinator firmware version: '20190109' 2019-2-12 00:57:00 - info: Currently 3 devices are joined:
@bbrendon your automation is probably wrong, you should use the MQTT trigger automation
@viboux yes, change log level to debug
@Koenkk Okay, thanks, I would never have guessed. Just curious though, is this by design or is it a bug in HASS? I was under the impression the design idea was to us MQTT as a way to get the data integrated into HASS so it could be used like everything else. Thus once the data gets into HASS the MQTT portion is not used.