kabbi / zigbee2mqtt-adapter

zigbee2mqtt adapter for WebThings gateway
Mozilla Public License 2.0
21 stars 13 forks source link

some actions created with Things are not triggering webthings.io rules #51

Closed nbackous closed 2 years ago

nbackous commented 2 years ago

Detailed thread here: https://discourse.mozilla.org/t/rules-not-responding-to-some-actions-with-zigbee2mqtt/97022/8

I’ve recently switched from the legacy Zigbee add-on to the zigbee2mqtt add-on. I can see it’s quite a bit more powerful, but I’m having issues with pretty multiple Zigbee device I’ve tried, specifically buttons/remotes. Sometimes some buttons will work fine, but some actions such as long/double press don't work as expected. The Actions will be visible in the logs, but the actions are not triggering rules.

An example:

With the new Ikea Styrbar remote I can see all the exposed actions, and those actions are emitted when I click the corresponding button on the remote.

Screen Shot 2022-05-08 at 6 38 56 PM

In this example, l’ve selected arrow left click. When I click the left arrow on the remote, I see the action being read by the Thing, but if I build a Rule that uses the action as a trigger, the Rule is never triggered.

Screen Shot 2022-05-08 at 6 38 36 PM

The issue is not limited to the Ikea Styrbar remote. I’m also seeing issues with a SmartThings button. The button supports single, double clicks and long-press. I’ve set up a rules that respond to all three actions, but only the single click and the long-press rules are triggered. The Thing sees the double-click event, but it doesn’t trigger the Rule.

Since the Thing sees the action happening, I’m perplexed as to why the Rules are being triggered.

Is there something obvious I’m missing?

I’ve checked in /extensions/zigbee2mqtt-adapter to see if a pending update for any of my devices is available, but the Update button is dimmed for all of them, so I guess there aren’t any pending update.

I see this in the logs after clicking the left-button:

2022-05-09 17:57:16.534 INFO   : zigbee2mqtt-adapter: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ * * *
2022-05-09 17:57:16.535 INFO   : zigbee2mqtt-adapter: in incoming message, topic: zigbee2mqtt/0x04cd15fffe9d43bd
2022-05-09 17:57:16.536 INFO   : zigbee2mqtt-adapter: zigbee2mqtt
2022-05-09 17:57:16.537 INFO   : zigbee2mqtt-adapter: - zigbee_id = 0x04cd15fffe9d43bd
2022-05-09 17:57:16.537 INFO   : zigbee2mqtt-adapter: action -> 
2022-05-09 17:57:16.538 INFO   : zigbee2mqtt-adapter: arrow left click
2022-05-09 17:57:16.539 INFO   : zigbee2mqtt-adapter: battery -> 
2022-05-09 17:57:16.539 INFO   : zigbee2mqtt-adapter: 100
2022-05-09 17:57:16.545 INFO   : zigbee2mqtt-adapter: linkquality -> 
2022-05-09 17:57:16.547 INFO   : zigbee2mqtt-adapter: 159
2022-05-09 17:57:16.547 INFO   : zigbee2mqtt-adapter: - that property could not be found: update
2022-05-09 17:57:16.548 INFO   : zigbee2mqtt-adapter: - ignoring update property

If I update the rule to use the on action instead of arrow left click the rule is triggered when I click on the up button on the remote.


2022-05-10 07:55:48.049 INFO   : zigbee2mqtt-adapter: zigbee2mqtt
2022-05-10 07:55:48.050 INFO   : zigbee2mqtt-adapter: - zigbee_id = 0x04cd15fffe9d43bd
2022-05-10 07:55:48.051 INFO   : zigbee2mqtt-adapter: extra_boolean updated
2022-05-10 07:55:48.052 INFO   : zigbee2mqtt-adapter: action -> 
2022-05-10 07:55:48.053 INFO   : zigbee2mqtt-adapter: on
2022-05-10 07:55:48.066 INFO   : zigbee2mqtt-adapter: battery -> 
2022-05-10 07:55:48.067 INFO   : zigbee2mqtt-adapter: 100
2022-05-10 07:55:48.068 INFO   : zigbee2mqtt-adapter: linkquality -> 
2022-05-10 07:55:48.070 INFO   : zigbee2mqtt-adapter: 159
2022-05-10 07:55:48.072 INFO   : zigbee2mqtt-adapter: - that property could not be found: update
2022-05-10 07:55:48.073 INFO   : zigbee2mqtt-adapter: - ignoring update property```
flatsiedatsie commented 2 years ago

Interesting.

My first thought: perhaps it's related to the functionality that takes some of these actions and turns it into extra buttons: https://github.com/kabbi/zigbee2mqtt-adapter/blob/b25f3266cd168dc5c6f2481034c24158a727a62f/zigbee2mqtt-adapter.js#L1891

A big question is: which version are you using? Youi're probably still using the version available in the Webthings addons list, which is relatively outdated. The latest version can be installed manually, or via the Candle app store, which is part of the Candle version of the Webthings Gateway.

Could you test if the issue still exists if you use the latest version? You can download the Raspberry Pi disk image here: https://www.candlesmarthome.com/

nbackous commented 2 years ago

I am on 0.6.5, which is what is available in the Webthings add-ons list.

Will that version be updated any time soon?

While I don't know anything about Candle, I'm nervous about switching to it because I assume I'd have to start from scratch to set up my entire set up, which is rather complicated.

flatsiedatsie commented 2 years ago

You don't have to switch. Just test it?

The latest version is 1.0.19 https://github.com/kabbi/zigbee2mqtt-adapter/releases

I wouldn't expect an update any time soon. If you know how, then you could also install it manually.

Fun fact: Candle comes with a backup and restore option.

flatsiedatsie commented 2 years ago

I did a test with the current version, and actions do trigger rules.