sammachin / node-red-matter-bridge

Matter Bridge for Node-RED
10 stars 2 forks source link

alexa commissioning #2

Closed jpadie closed 2 months ago

jpadie commented 1 year ago

appreciate that this is a work in progress but thought I'd report back anyway.

tested both the example flow and a single device flow and neither will commission with echo dots / alexa

alexa did see both matter devices and a matter hub available for commissioning but failed doing both. even with logging set to info there was no useful log feedback in console to help diagnose. In syslog there was the following

Oct 16 13:29:45 mqttBroker2 Node-RED[411]: Bridge Restarted
Oct 16 13:29:45 mqttBroker2 Node-RED[411]: Bridge Restarted
Oct 16 13:29:45 mqttBroker2 Node-RED[411]: 16 Oct 13:29:45 - [info] Stopped flows
Oct 16 13:29:45 mqttBroker2 Node-RED[411]: 16 Oct 13:29:45 - [info] Updated flows
Oct 16 13:29:45 mqttBroker2 Node-RED[411]: 16 Oct 13:29:45 - [info] Starting flows
Oct 16 13:29:45 mqttBroker2 Node-RED[411]: Loading Bridge node feb98c4e25dc7863
Oct 16 13:29:45 mqttBroker2 Node-RED[411]: Loading Bridge node f573658a4f264bb7
Oct 16 13:29:45 mqttBroker2 Node-RED[411]: Bridge Created, awaiting child nodes
Oct 16 13:29:45 mqttBroker2 Node-RED[411]: Bridge Created, awaiting child nodes
Oct 16 13:29:45 mqttBroker2 Node-RED[411]: Loading Device node f68064bbbb3c39b0
Oct 16 13:29:45 mqttBroker2 Node-RED[411]: Registering f68064bbbb3c39b0 with feb98c4e25dc7863
Oct 16 13:29:45 mqttBroker2 Node-RED[411]: f68064bbbb3c39b0
Oct 16 13:29:45 mqttBroker2 Node-RED[411]: Loading Device node 662154d736357b10
Oct 16 13:29:45 mqttBroker2 Node-RED[411]: Registering 662154d736357b10 with f573658a4f264bb7
Oct 16 13:29:45 mqttBroker2 Node-RED[411]: Loading Device node 6cb2cc1d97198aec
Oct 16 13:29:45 mqttBroker2 Node-RED[411]: Registering 6cb2cc1d97198aec with f573658a4f264bb7
Oct 16 13:29:45 mqttBroker2 Node-RED[411]: Loading Device node f194324ae156a0e1
Oct 16 13:29:45 mqttBroker2 Node-RED[411]: Registering f194324ae156a0e1 with f573658a4f264bb7
Oct 16 13:29:45 mqttBroker2 Node-RED[411]: 662154d736357b10
Oct 16 13:29:45 mqttBroker2 Node-RED[411]: 6cb2cc1d97198aec
Oct 16 13:29:45 mqttBroker2 Node-RED[411]: f194324ae156a0e1

I could see some network traffic after that; comms on port 5540 which looks like matter info but no helpful logging from matter.js or node-red.

Apollon77 commented 1 year ago

For Alexa the "server" used needs to use port 5540 because (why ever) ALexa is onla accepting this one port and not more. So please make sure to configure the node to port 5540. Said this: Alexa only supports one device (or bridge) per host/IP

jpadie commented 1 year ago

For Alexa the "server" used needs to use port 5540 because (why ever) ALexa is onla accepting this one port and not more. So please make sure to configure the node to port 5540.

port 5540 is hard coded in bridge.js.

Said this: Alexa only supports one device (or bridge) per host/IP

is there any canonical statement from Amazon on this? I am aware that composed devices have not been supported so far. but that was also the case with bridge. Alexa now detects matter hubs and tries to commission them. Which suggests that they should also be able to commission multiple endpoints on that bridge.

In any event, my testing has been done with a single endpoint on the bridge (apart from the example flow that comes with this repo).

Apollon77 commented 1 year ago

bridge is working on Alexa since roughly 3 weeks. No there is not any statement ... just experience :-)

For Alexa: Make sure that UDP packages can flow without any firewall, router or such between the Echos and the host where node-red is on!

Else (at least from matter.js side) I need a debug loglevel log

jpadie commented 1 year ago

ok will look into turning on the logs in matter.js. I've been looking at that code stack recently as it happens.

currently the firewall is open for port 5540. i will try a few experiments without any firewall.

thanks!

jpadie commented 1 year ago

thanks for the help here Ingo.
Disabling the fw allowed (eventually) the hub to be commissioned. Re-enabling it does not disturb the fabric. All a bit odd!

Next task is to write a virtual thermostat...

Apollon77 commented 1 year ago

Disabling the fw allowed (eventually) the hub to be commissioned. Re-enabling it does not disturb the fabric. All a bit odd!

Yes this whole IPV6 and UDP/MDNS stugff can get tricky.

Next task is to write a virtual thermostat...

Matter.js is also working on device object s for all devicetypes of Matter ... in fact all clusters are there so you could build the thermostat basically yourself already

jpadie commented 1 year ago

thanks Ingo. As I mentioned I've been looking at chip-tool and matter.js recently with the specific intention of working out how to create virtual devices (there was an outage of three weeks recently during which no heating / aircon etc at my house in France as it relied on a cloud mqtt server). Although I have moved to a local bridged mqtt server I think that matter might be a better long term answer and also might eliminate some of the alexa latency.

Is the discord the right place to ask for help with matter.js?

Apollon77 commented 1 year ago

yes Discord is best way for discussion like communication :-)