hardillb / node-red-alexa-home-skill-web

Apache License 2.0
45 stars 28 forks source link

Connection and disconnection when used on another nodered #102

Closed Malaga82 closed 4 years ago

Malaga82 commented 4 years ago

Hello, i'm using the skill and it's working great on a single instance, but i have a problem: i created a switch to start a PC, using wake on lan, so i configured a new nodered on another location( in the same pc LAN ). It seems there is a polling triggering the account/devices every few seconds, so i have the device going offline/online on each location at alternate times: since there is no way to configure the same alexa skill with multiple accounts, is there a way to manage this bouncing reconnections? Thanks

hardillb commented 4 years ago

You can only have one Node-RED instance connected to the service, because we need to enforce that only one instance responds to any commands for a given device. Having multiple makes it too easy to try and control the same device multiple times.

The connection is bouncing because the MQTT client id is set to the username. MQTT client ids have to be unique and if a client is already connected it will be disconnected when a new one connects with the same client id.

So the only way to stop it bouncing is to only have one instance running.