Luligu / matterbridge

Matterbridge plugin manager for Matter
https://github.com/Luligu/matterbridge/blob/main/README.md
Apache License 2.0
125 stars 13 forks source link

Shutter opening/closing state in Apple Home #69

Closed nitaybz closed 2 weeks ago

nitaybz commented 3 weeks ago

Hi,

I'm not sure wether it's a Matter issue, or maybe Apple/matterbridge/zigbee2mqtt, but I'm experiencing an issue where the Shutters are always showing "opening..." or "closing...". it seems like the status is reported correctly in z2m and also in Home Assistant integrated with matterbridge, I even tried to export the 2 shutters I have from homeassistant (via matterbridge) back to HomeKit and than I get the status reported correctly with the opening/closing state stuck.

do you think it's something you could look into? do you need anything from me?

Luligu commented 3 weeks ago

Hi, Apple is my first controller, and I have rollers on it from all plugins matterbridge-zigbee2mqtt, matterbridge-somfy-tahoma and matterbridge-shelly. So generally speaking there are no problems.

The WindowCovering cluster in matter requires an initial configuration that is done by all plugins when the first controller connects to the bridge.

You should see in the log [16:28:01.672] [Matterbridge zigbee2mqtt plugin] Configuring xxx matter devices.

After this has been done, in the Devices section of the frontend find your device in the first table and select it, then in the second table find the WindowCovering cluster and send me please the screenshot of the operationalStatus, targetPositionLiftPercent100ths and currentPositionLiftPercent100ths attributes.

Also what zigbee device you use for roller?

Can you also explain me how you are using matterbridge in your setup, cause I didn't get it exactly and sounds interesting.

Are you planning to port any of your plugins to matterbridge?

nitaybz commented 3 weeks ago

Hey, thanks for the fast reply, I'm including some screenshots from my iPhone that will answer all your questions including what device I'm using, the state in z2m and how it looks in Apple Home. Let me know if anything else is needed.

image image image image image

Regarding my plugins, I'm planning to move some of them, I just hope to find some time for it.

Thanks in advance :)

Luligu commented 3 weeks ago

Hi, ok the problem is that targetPositionLiftPercent100ths and currentPositionLiftPercent100ths don't match as you saw.

Did you see the message [16:28:01.672] [Matterbridge zigbee2mqtt plugin] Configuring xxx matter devices.

The problem persist even when you full close or full open the cover? Or is just when the controller starts? Cause I will look in different parts of the code.

I don't know that zigbee device: can you send me the bridge-devices.json file in the Matterbridge\matterbridge-zigbee2mqtt dir please.

Since you didn't write about it, I keep for granted that the device is fully controllable by Apple Home. Correct ?

In any case can you send me some screenshot from the console log when you command the device? Like a full close and a full open and a stop in the middle. Just to check that all is like should be.

nitaybz commented 2 weeks ago

The problem persist even when it's half way and when fully close or fully open. I've noticed it happens when you control the device from the switch physically and not from the app.

nitaybz commented 2 weeks ago

bridge-devices.json: bridge-devices.json

it is controllable by Apple Home, and I only see the issue there, but it is also connected to Home Assistant and Google Home.

nitaybz commented 2 weeks ago

Here is the logs for closing, opening and stopping in the middle while controlling it manually from the switch itself:

info - [11:19:48.784] [Matterbridge]: WebSocketServer client connected to Matterbridge
info - [11:20:19.822] [Matterbridge]: Active session changed on fabric 4 id 126025447294428114 vendor 4631 (Alexa) Alexa-4 for Matterbridge { name: 'secure/5371', nodeId: 221273427015071072, peerNodeId: 126025447319362097, fabric: { fabricIndex: 4, fabricId: 126025447294428114, nodeId: 221273427015071072, rootNodeId: 18446744060825763882, rootVendorId: 4631, label: 'Alexa-4' }, isPeerActive: false, secure: true, lastInteractionTimestamp: 1719793121785, lastActiveTimestamp: 1719792938981, numberOfActiveSubscriptions: 0 }
info - [11:20:19.826] [Matterbridge]: Active session changed on fabric 4 id 126025447294428114 vendor 4631 (Alexa) Alexa-4 for Matterbridge { name: 'secure/5410', nodeId: 221273427015071072, peerNodeId: 126025447319362097, fabric: { fabricIndex: 4, fabricId: 126025447294428114, nodeId: 221273427015071072, rootNodeId: 18446744060825763882, rootVendorId: 4631, label: 'Alexa-4' }, isPeerActive: true, secure: true, lastInteractionTimestamp: 1719822019885, lastActiveTimestamp: 1719822019885, numberOfActiveSubscriptions: 0 }
info - [11:20:21.936] [Matterbridge]: WebSocketServer client connected to Matterbridge
debug - [11:20:30.882] [Dining Light]: MQTT message for device Dining Light payload: { color_mode: 'xy', led_if_on: 'ON', led_in_dark: 'OFF', linkquality: 220, state: 'OFF', update: { installed_version: 4015615, latest_version: 4015615, state: 'idle' } }
info - [11:20:32.042] [Matterbridge]: Active session changed on fabric 4 id 126025447294428114 vendor 4631 (Alexa) Alexa-4 for Matterbridge { name: 'secure/5371', nodeId: 221273427015071072, peerNodeId: 126025447319362097, fabric: { fabricIndex: 4, fabricId: 126025447294428114, nodeId: 221273427015071072, rootNodeId: 18446744060825763882, rootVendorId: 4631, label: 'Alexa-4' }, isPeerActive: false, secure: true, lastInteractionTimestamp: 1719793121785, lastActiveTimestamp: 1719792938981, numberOfActiveSubscriptions: 0 }
info - [11:20:32.045] [Matterbridge]: Active session changed on fabric 4 id 126025447294428114 vendor 4631 (Alexa) Alexa-4 for Matterbridge { name: 'secure/5410', nodeId: 221273427015071072, peerNodeId: 126025447319362097, fabric: { fabricIndex: 4, fabricId: 126025447294428114, nodeId: 221273427015071072, rootNodeId: 18446744060825763882, rootVendorId: 4631, label: 'Alexa-4' }, isPeerActive: true, secure: true, lastInteractionTimestamp: 1719822032105, lastActiveTimestamp: 1719822032105, numberOfActiveSubscriptions: 1 }
info - [11:20:32.046] [Matterbridge]: Controller 4631 (Alexa) Alexa-4 connected to Matterbridge on session secure/5410
info - [11:20:34.044] [Matterbridge]: Plugin matterbridge-zigbee2mqtt already configured
debug - [11:20:44.263] [Living Room Shutter]: MQTT message for device Living Room Shutter payload: { calibration_mode: 'specific_nllv', color_mode: 'xy', led_if_on: 'OFF', led_in_dark: 'OFF', linkquality: 196, position: 100, state: 'OPEN', tilt: 100, update: { installed_version: 4015615, latest_version: 4015615, state: 'idle' } }
debug - [11:20:44.264] [Living Room Shutter]: Update endpoint 5 attribute WindowCovering-currentPositionLiftPercent100ths from 10000 to 0
debug - [11:20:48.990] [Entrance Wall Light]: MQTT message for device Entrance Wall Light payload: { color_mode: 'xy', led_if_on: 'ON', led_in_dark: 'OFF', linkquality: 96, state: 'OFF', update: { installed_version: 4015615, latest_version: 4015615, state: 'idle' } }
debug - [11:20:55.226] [Living Room Shutter]: MQTT message for device Living Room Shutter payload: { calibration_mode: 'specific_nllv', color_mode: 'xy', led_if_on: 'OFF', led_in_dark: 'OFF', linkquality: 168, position: 44, state: 'OPEN', tilt: 100, update: { installed_version: 4015615, latest_version: 4015615, state: 'idle' } }
debug - [11:20:55.227] [Living Room Shutter]: Update endpoint 5 attribute WindowCovering-currentPositionLiftPercent100ths from 0 to 5600
debug - [11:21:09.274] [Living Room Shutter]: MQTT message for device Living Room Shutter payload: { calibration_mode: 'specific_nllv', color_mode: 'xy', led_if_on: 'OFF', led_in_dark: 'OFF', linkquality: 180, position: 100, state: 'OPEN', tilt: 100, update: { installed_version: 4015615, latest_version: 4015615, state: 'idle' } }
debug - [11:21:09.278] [Living Room Shutter]: Update endpoint 5 attribute WindowCovering-currentPositionLiftPercent100ths from 5600 to 0
debug - [11:21:09.879] [Kitchen Cabinet Light]: MQTT message for device Kitchen Cabinet Light payload: { color_mode: 'xy', led_if_on: 'ON', led_in_dark: 'OFF', linkquality: 192, state: 'OFF', update: { installed_version: 4015615, latest_version: 4015615, state: 'idle' } }
debug - [11:21:43.843] [Kitchen Shutter]: MQTT message for device Kitchen Shutter payload: { calibration_mode: 'specific_nllv', color_mode: 'xy', led_if_on: 'OFF', led_in_dark: 'OFF', linkquality: 236, position: 2, state: 'OPEN', tilt: 100, update: { installed_version: 4015615, latest_version: 4015615, state: 'idle' } }
debug - [11:21:49.658] [Play Room Wall Light]: MQTT message for device Play Room Wall Light payload: { color_mode: 'xy', led_if_on: 'ON', led_in_dark: 'OFF', linkquality: 80, state: 'OFF', update: { installed_version: 4015615, latest_version: 4015615, state: 'idle' } }
debug - [11:21:57.406] [Office Light]: MQTT message for device Office Light payload: { color_mode: 'xy', led_if_on: 'ON', led_in_dark: 'OFF', linkquality: 140, state: 'ON', update: { installed_version: 4015615, latest_version: 4015615, state: 'idle' } }
debug - [11:22:15.027] [Pantry Light]: MQTT message for device Pantry Light payload: { color_mode: 'xy', led_if_on: 'ON', led_in_dark: 'OFF', linkquality: 228, state: 'OFF', update: { installed_version: 4015615, latest_version: 4015615, state: 'idle' } }
debug - [11:22:18.310] [Living Room Shutter]: MQTT message for device Living Room Shutter payload: { calibration_mode: 'specific_nllv', color_mode: 'xy', led_if_on: 'OFF', led_in_dark: 'OFF', linkquality: 192, position: 100, state: 'OPEN', tilt: 100, update: { installed_version: 4015615, latest_version: 4015615, state: 'idle' } }
debug - [11:22:30.270] [Entrance Light]: MQTT message for device Entrance Light payload: { color_mode: 'xy', led_if_on: 'ON', led_in_dark: 'OFF', linkquality: 132, state: 'OFF', update: { installed_version: 4015615, latest_version: 4015615, state: 'idle' } }
debug - [11:22:36.331] [Living Room Shutter]: MQTT message for device Living Room Shutter payload: { calibration_mode: 'specific_nllv', color_mode: 'xy', led_if_on: 'OFF', led_in_dark: 'OFF', linkquality: 192, position: 0, state: 'CLOSE', tilt: 100, update: { installed_version: 4015615, latest_version: 4015615, state: 'idle' } }
debug - [11:22:36.340] [Living Room Shutter]: Update endpoint 5 attribute WindowCovering-currentPositionLiftPercent100ths from 0 to 10000
Luligu commented 2 weeks ago

matterbridge-zigbee2mqtt-2.1.5.zip

Hi, I found the bug. Can you try 2.1.5 please?

Nothing to do with the issue, but your shutter device is different from the others of that kind. It doesn't have the 'moving' key, but should work correctly even without.

Let me know.

nitaybz commented 2 weeks ago

it seems like the issue is fixed now. when the device stop at a position it reports opening or closing for 1 second and than changes to the correct status. it is no longer stuck in s opening/closing state.

thanks a lot

Luligu commented 2 weeks ago

Great!

It's me to thanks you.