t0bst4r / home-assistant-matter-hub

Publish your Home-Assistant Instance using Matter.
Apache License 2.0
157 stars 10 forks source link

[Bug] cannot turn on fan #43

Open pana800 opened 3 weeks ago

pana800 commented 3 weeks ago

image I added fan domain and 2 xiaomi fan showed up as on off plug in Apple home but the on off function didn't even work.

t0bst4r commented 3 weeks ago

It is intended that it is appearing as on-off unit because most controllers don’t support fans via matter.

can you please share the logs when switching it on or off and nothing happens?

pana800 commented 3 weeks ago

After updating to Alpha 15, I could control (on/off) one of the 2 fans, standing_fan_2 (dmaker p10) but it takes over 20s for the second one (bedroom_fan using xiaomi mio integaration with zhimi.fan.za5 ) to be off. Turning it on is normal like the other fan. Please note these fans are working with full function in HA.

[ 2024-11-02T04:09:24.745Z ] [ INFO  ] [ matter.js / MatterDevice                           ]: Announce done fabric: 1219889448 fabricIndex: 2
[ 2024-11-02T04:09:24.745Z ] [ INFO  ] [ matter.js / MatterDevice                           ]: Announce done fabric: 1219889448 fabricIndex: 2
[ 2024-11-02T04:09:24.746Z ] [ INFO  ] [ matter.js / Operationa~edentials                   ]: addNoc success, adminVendorId 4996, caseAdminSubject 2215199465
[ 2024-11-02T04:09:24.827Z ] [ INFO  ] [ matter.js / AccessControlServer                    ]: ACL updated, updating ACL manager { privilege: 5, authMode: 2, subjects: [ 18446744063988203521, 4191292807 ], targets: null, fabricIndex: 1 } { fabricIndex: 2, privilege: 5, authMode: 2, subjects: [ 2215199465 ], targets: null }
[ 2024-11-02T04:09:25.086Z ] [ INFO  ] [ matter.js / CaseServer                             ]: Received pairing request from udp://fe80::14bd:5503:ad9a:40bb%eno1:56757
[ 2024-11-02T04:09:25.108Z ] [ INFO  ] [ matter.js / CaseServer                             ]: session 20458 created with udp://fe80::14bd:5503:ad9a:40bb%eno1:56757 for Fabric 0000000048E66ABC(index 2) and PeerNode 00000000840942E9 with CATs undefined
[ 2024-11-02T04:09:25.115Z ] [ INFO  ] [ matter.js / Behavior                               ]: Invoke 66ce0f126d374e34ab6ca63c7c4f5c47.generalCommissioning.commissioningComplete online#5394a39@840942e9 (no payload)
[ 2024-11-02T04:09:25.116Z ] [ INFO  ] [ matter.js / MatterDevice                           ]: All announcements expired
[ 2024-11-02T04:09:25.117Z ] [ INFO  ] [ matter.js / GeneralCom~erHandler                   ]: Commissioning completed on fabric #1219889448 as node #1223060156.
[ 2024-11-02T04:09:25.119Z ] [ INFO  ] [ matter.js / SessionManager                         ]: End insecure session insecure/12397314694543025540
[ 2024-11-02T04:09:25.581Z ] [ INFO  ] [ matter.js / Behavior                               ]: Invoke 66ce0f126d374e34ab6ca63c7c4f5c47.operationalCredentials.updateFabricLabel online#f0020fd@8e14ac1d label: My Home fabricIndex: 1
[ 2024-11-02T04:10:34.751Z ] [ INFO  ] [ matter.js / Behavior                               ]: Invoke 66ce0f126d374e34ab6ca63c7c4f5c47.aggregator.fan_bedroom_fan.onOff.off online#f002106@8e14ac1d (no payload)
[ 2024-11-02T04:10:42.994Z ] [ INFO  ] [ matter.js / Behavior                               ]: Invoke 66ce0f126d374e34ab6ca63c7c4f5c47.aggregator.fan_bedroom_fan.onOff.on online#f002109@8e14ac1d (no payload)
[ 2024-11-02T04:10:46.621Z ] [ INFO  ] [ matter.js / Behavior                               ]: Invoke 66ce0f126d374e34ab6ca63c7c4f5c47.aggregator.fan_standing_fan_2.onOff.off online#f00210c@8e14ac1d (no payload)
[ 2024-11-02T04:10:49.533Z ] [ INFO  ] [ matter.js / Behavior                               ]: Invoke 66ce0f126d374e34ab6ca63c7c4f5c47.aggregator.fan_standing_fan_2.onOff.on online#f00210f@8e14ac1d (no payload)
[ 2024-11-02T04:10:52.156Z ] [ INFO  ] [ matter.js / Behavior                               ]: Invoke 66ce0f126d374e34ab6ca63c7c4f5c47.aggregator.fan_standing_fan_2.onOff.off online#f002112@8e14ac1d (no payload)
[ 2024-11-02T04:11:01.794Z ] [ INFO  ] [ matter.js / Behavior                               ]: Invoke 66ce0f126d374e34ab6ca63c7c4f5c47.aggregator.fan_bedroom_fan.onOff.off online#f002116@8e14ac1d (no payload)
[ 2024-11-02T04:11:08.020Z ] [ INFO  ] [ matter.js / Behavior                               ]: Invoke 66ce0f126d374e34ab6ca63c7c4f5c47.aggregator.fan_bedroom_fan.onOff.on online#f002119@8e14ac1d (no payload)
[ 2024-11-02T04:11:12.212Z ] [ INFO  ] [ matter.js / Behavior                               ]: Invoke 66ce0f126d374e34ab6ca63c7c4f5c47.aggregator.fan_standing_fan_2.onOff.on online#f00211c@8e14ac1d (no payload)
[ 2024-11-02T04:11:14.134Z ] [ INFO  ] [ matter.js / Behavior                               ]: Invoke 66ce0f126d374e34ab6ca63c7c4f5c47.aggregator.fan_standing_fan_2.onOff.off online#f00211f@8e14ac1d (no payload)
[ 2024-11-02T04:11:17.836Z ] [ INFO  ] [ matter.js / Behavior                               ]: Invoke 66ce0f126d374e34ab6ca63c7c4f5c47.aggregator.fan_bedroom_fan.onOff.off online#f002122@8e14ac1d (no payload)
[ 2024-11-02T04:11:28.419Z ] [ INFO  ] [ matter.js / Behavior                               ]: Invoke 66ce0f126d374e34ab6ca63c7c4f5c47.aggregator.fan_bedroom_fan.onOff.on online#f002125@8e14ac1d (no payload)
[ 2024-11-02T04:12:36.419Z ] [ INFO  ] [ matter.js / Behavior                               ]: Invoke 66ce0f126d374e34ab6ca63c7c4f5c47.aggregator.fan_bedroom_fan.onOff.on online#f00212a@8e14ac1d (no payload)
[ 2024-11-02T04:12:40.811Z ] [ INFO  ] [ matter.js / Behavior                               ]: Invoke 66ce0f126d374e34ab6ca63c7c4f5c47.aggregator.fan_bedroom_fan.onOff.off online#f00212d@8e14ac1d (no payload)
[ 2024-11-02T04:12:53.571Z ] [ INFO  ] [ matter.js / Behavior                               ]: Invoke 66ce0f126d374e34ab6ca63c7c4f5c47.aggregator.fan_bedroom_fan.onOff.on online#f002130@8e14ac1d (no payload)
[ 2024-11-02T04:13:04.501Z ] [ INFO  ] [ matter.js / Behavior                               ]: Invoke 66ce0f126d374e34ab6ca63c7c4f5c47.aggregator.fan_bedroom_fan.onOff.off online#f002134@8e14ac1d (no payload)
[ 2024-11-02T04:13:16.103Z ] [ INFO  ] [ matter.js / Behavior                               ]: Invoke 66ce0f126d374e34ab6ca63c7c4f5c47.aggregator.fan_bedroom_fan.onOff.on online#f002137@8e14ac1d (no payload)
[ 2024-11-02T04:13:34.338Z ] [ INFO  ] [ matter.js / Behavior                               ]: Invoke 66ce0f126d374e34ab6ca63c7c4f5c47.aggregator.fan_bedroom_fan.onOff.off online#f00213a@8e14ac1d (no payload)
[ 2024-11-02T04:13:47.195Z ] [ INFO  ] [ matter.js / Behavior                               ]: Invoke 66ce0f126d374e34ab6ca63c7c4f5c47.aggregator.fan_bedroom_fan.onOff.on online#f00213d@8e14ac1d (no payload)
[ 2024-11-02T04:13:52.498Z ] [ INFO  ] [ matter.js / Behavior                               ]: Invoke 66ce0f126d374e34ab6ca63c7c4f5c47.aggregator.fan_bedroom_fan.onOff.off online#f002140@8e14ac1d (no payload)
[ 2024-11-02T04:15:53.376Z ] [ ERROR ] [ matter.js / SubscriptionHandler                    ]: Error sending subscription update message (error count=1): RetransmissionLimitReachedError
  at MessageExchange.retransmitMessage (file:///usr/local/lib/node_modules/home-assistant-matter-hub/node_modules/@project-chip/matter.js/dist/esm/protocol/MessageExchange.js:376:37)
  at TimerNode.callback (file:///usr/local/lib/node_modules/home-assistant-matter-hub/node_modules/@project-chip/matter.js/dist/esm/protocol/MessageExchange.js:397:20)
  at Timeout._onTimeout (file:///usr/local/lib/node_modules/home-assistant-matter-hub/node_modules/@project-chip/matter-node.js/dist/esm/time/TimeNode.js:49:12)
  at listOnTimeout (node:internal/timers:569:17)
  at process.processTimers (node:internal/timers:512:7)
[ 2024-11-02T04:17:27.272Z ] [ ERROR ] [ matter.js / SubscriptionHandler                    ]: Error sending subscription update message (error count=2): RetransmissionLimitReachedError
  at MessageExchange.retransmitMessage (file:///usr/local/lib/node_modules/home-assistant-matter-hub/node_modules/@project-chip/matter.js/dist/esm/protocol/MessageExchange.js:376:37)
  at TimerNode.callback (file:///usr/local/lib/node_modules/home-assistant-matter-hub/node_modules/@project-chip/matter.js/dist/esm/protocol/MessageExchange.js:397:20)
  at Timeout._onTimeout (file:///usr/local/lib/node_modules/home-assistant-matter-hub/node_modules/@project-chip/matter-node.js/dist/esm/time/TimeNode.js:49:12)
  at listOnTimeout (node:internal/timers:569:17)
  at process.processTimers (node:internal/timers:512:7)
[ 2024-11-02T04:19:02.594Z ] [ ERROR ] [ matter.js / SubscriptionHandler                    ]: Error sending subscription update message (error count=3): RetransmissionLimitReachedError
  at MessageExchange.retransmitMessage (file:///usr/local/lib/node_modules/home-assistant-matter-hub/node_modules/@project-chip/matter.js/dist/esm/protocol/MessageExchange.js:376:37)
  at TimerNode.callback (file:///usr/local/lib/node_modules/home-assistant-matter-hub/node_modules/@project-chip/matter.js/dist/esm/protocol/MessageExchange.js:397:20)
  at Timeout._onTimeout (file:///usr/local/lib/node_modules/home-assistant-matter-hub/node_modules/@project-chip/matter-node.js/dist/esm/time/TimeNode.js:49:12)
  at listOnTimeout (node:internal/timers:569:17)
  at process.processTimers (node:internal/timers:512:7)
[ 2024-11-02T04:19:02.595Z ] [ ERROR ] [ matter.js / SubscriptionHandler                    ]: Sending update failed 3 times in a row, canceling subscription 2306807940 and let controller subscribe again.
[ 2024-11-02T04:19:02.600Z ] [ INFO  ] [ matter.js / SecureSession                          ]: Register Session secure/20457 to send a close when exchange is ended.
[ 2024-11-02T04:19:20.090Z ] [ INFO  ] [ matter.js / SessionManager                         ]: End CASE session secure/20457
[ 2024-11-02T04:20:48.589Z ] [ INFO  ] [ matter.js / CaseServer                             ]: Received pairing request from udp://fe80::14bd:5503:ad9a:40bb%eno1:56757
[ 2024-11-02T04:20:48.679Z ] [ INFO  ] [ matter.js / CaseServer                             ]: session 20459 resumed with udp://fe80::14bd:5503:ad9a:40bb%eno1:56757 for Fabric 0000000083AB0A2E(index 1) and PeerNode 000000008E14AC1D with CATs 3163553793
[ 2024-11-02T04:20:48.680Z ] [ INFO  ] [ matter.js / SessionManager                         ]: End insecure session insecure/14333365832147925478
[ 2024-11-02T04:20:49.026Z ] [ INFO  ] [ matter.js / InteractionServer                      ]: Successfully created subscription 2306807941 for Session 20459. Updates: 0 - 600 => 181 seconds (sendInterval = 91 seconds)
[ 2024-11-02T04:20:57.053Z ] [ INFO  ] [ matter.js / Behavior                               ]: Invoke 66ce0f126d374e34ab6ca63c7c4f5c47.aggregator.fan_bedroom_fan.onOff.on online#9bee938@8e14ac1d (no payload)
[ 2024-11-02T04:21:01.106Z ] [ INFO  ] [ matter.js / Behavior                               ]: Invoke 66ce0f126d374e34ab6ca63c7c4f5c47.aggregator.fan_bedroom_fan.onOff.off online#9bee93c@8e14ac1d (no payload)
[ 2024-11-02T04:22:04.051Z ] [ INFO  ] [ matter.js / CaseServer                             ]: Received pairing request from udp://fe80::14bd:5503:ad9a:40bb%eno1:56757
[ 2024-11-02T04:22:04.283Z ] [ INFO  ] [ matter.js / CaseServer                             ]: session 20460 resumed with udp://fe80::14bd:5503:ad9a:40bb%eno1:56757 for Fabric 0000000083AB0A2E(index 1) and PeerNode 000000008E14AC1D with CATs 3163553793
[ 2024-11-02T04:22:04.285Z ] [ INFO  ] [ matter.js / SessionManager                         ]: End insecure session insecure/16745821167584408281
[ 2024-11-02T04:22:04.448Z ] [ INFO  ] [ matter.js / InteractionServer                      ]: Successfully created subscription 2306807942 for Session 20460. Updates: 0 - 600 => 187 seconds (sendInterval = 94 seconds)
[ 2024-11-02T04:22:06.968Z ] [ INFO  ] [ matter.js / Behavior                               ]: Invoke 66ce0f126d374e34ab6ca63c7c4f5c47.aggregator.fan_bedroom_fan.onOff.on online#c1f751c@8e14ac1d (no payload)
[ 2024-11-02T04:22:07.659Z ] [ INFO  ] [ matter.js / SubscriptionHandler                    ]: Subscription 2306807941 cancelled by peer.
[ 2024-11-02T04:22:10.245Z ] [ INFO  ] [ matter.js / Behavior                               ]: Invoke 66ce0f126d374e34ab6ca63c7c4f5c47.aggregator.fan_bedroom_fan.onOff.off online#c1f7520@8e14ac1d (no payload)
[ 2024-11-02T04:22:18.580Z ] [ INFO  ] [ matter.js / Behavior                               ]: Invoke 66ce0f126d374e34ab6ca63c7c4f5c47.aggregator.fan_standing_fan_2.onOff.on online#c1f7523@8e14ac1d (no payload)
[ 2024-11-02T04:22:24.109Z ] [ INFO  ] [ matter.js / Behavior                               ]: Invoke 66ce0f126d374e34ab6ca63c7c4f5c47.aggregator.fan_standing_fan_2.onOff.off online#c1f7526@8e14ac1d (no payload)
[ 2024-11-02T04:22:37.815Z ] [ INFO  ] [ matter.js / Behavior                               ]: Invoke 66ce0f126d374e34ab6ca63c7c4f5c47.aggregator.fan_bedroom_fan.onOff.on online#c1f752a@8e14ac1d (no payload)
[ 2024-11-02T04:22:40.937Z ] [ INFO  ] [ matter.js / Behavior                               ]: Invoke 66ce0f126d374e34ab6ca63c7c4f5c47.aggregator.fan_bedroom_fan.onOff.off online#c1f752d@8e14ac1d (no payload)
t0bst4r commented 3 weeks ago

Looking at the logs it seems to that it worked for both for some minutes and then suddenly stops working, right? And then the session between matter and your voice assistant fails and needs to be re-establish. That‘s leading to long running responses. After that it seems to be back working. Did I read it right, or do you experience it differently? Do the reconnect errors appear more often? Or just randomly through the day? Do you have any special network setup?

pana800 commented 3 weeks ago

I don't have any apple voice assistant active in this case. The issue just happens for one fan. One fan can be control normally right at the beginning.

t0bst4r commented 3 weeks ago

I am sorry, but I still don't get it.

Which controller (apple home, alexa, google home) are you using, which is not able to control the bedroom fan?

Your logs say, that BOTH fans were controllable in the beginning. Then it stopped working. After some time it was back working for BOTH.

The only error in the log could indicate some connectivity issues. Do you have any special network setup like VLAN? Do you have instabilities with your local network?

pana800 commented 3 weeks ago

Sorry for any confusion. The issue reported above is on the home app controlled via my iphone. I just created a bridge and just added these 2 fans to add. Yes, I have 2 different VLANs, one for private and one for IOT devices. these vlans are also configured on my HA server (2 interfaces on the HA server) I repeat the issue again. Only one fan could be controller smoothly (on and off any time I press the button on my iphone). The other fan can be turned on right after pressing the switch button on the app. But when I press to turn off, it takes over 20s for this fan to be off.

t0bst4r commented 2 weeks ago

I still cannot reproduce this issue. I dont have real fans, but can create some virtual fans in Home Assistant. I have created several new bridges with up to 20 different fans, paired them with Alexa and could control them without any problems...