Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multi-word device names do not work reliably #1

Open
sdetweil opened this issue Mar 11, 2020 · 4 comments
Open

multi-word device names do not work reliably #1

sdetweil opened this issue Mar 11, 2020 · 4 comments

Comments

@sdetweil
Copy link

i created a device called 'office monitor', and I have an existing thermostat device called 'office

when I request (thru MM) "alexa turn off office monitor", i get 'office doesn't support that'

if I delete the thermostat device 'office', then "alexa turn off office monitor" works..

help..

@sdetweil
Copy link
Author

sdetweil commented Mar 11, 2020

this creates only two devices, fake and fake device 4,

alexa turn off face device 1 (or 2 or 3 ) shows the message for fake device 4.

'use strict';

const FauxMo = require('node-fauxmo');

var dev4status = 0;

var dev4statushandler = function() {
	return dev4status;
}

var dev4handler = function(action) {
	dev4status = action;
}

let fauxMo = new FauxMo(
{
	devices: [{
		name: 'Fake Device 1',
		port: 11000,
		handler: function(action) {
			console.log('Fake Device 1:', action);
		}
	},
	{
		name: 'Fake Device 2',
		port: 11001,
		handler: function(action) {
			console.log('Fake Device 2:', action);
		}
	},
	{
		name: 'Fake Device 3',
		port: 11002,
		handler: function(action) {
			console.log('Fake Device 3:', action);
		}
	},
        {
                name: 'Fake',
                port: 11004,
                handler: function(action) {
                        console.log('Fake device:', action);
                }
        },
	{
		name: 'Fake Device 4',
		port: 11003,
		handler: function(action) {
			console.log('Fake Device 4:', action);
			dev4handler(action);
		},
		statusHandler: function(callback) {
			callback(dev4statushandler());
		}
	}
	]
});

from console (with alexa command annotation)

pi@raspberrypi4:~ $ node index.js
Adding multicast membership for 127.0.0.1
Adding multicast membership for 192.168.2.44
server is listening on 11000
server is listening on 11001
server is listening on 11002
server is listening on 11004
server is listening on 11003
Fake Device 4: 0                     // turn off fake device 4
Fake device: 0                        // turn off fake
Fake Device 4: 0                    // turn off fave device 3
Fake Device 4: 0                    // turn off fake device 2

alexa device list after discovery

Fake Wemo Plug	Forget
Office ecobee remote sensor	Forget
Fake Device 4 Wemo Plug	Forget
refresh Wemo Plug	Forget

device 1/2/3 not discovered

@JosefJantzen
Copy link

Hi, I think the problem here is that you have used the ports of device 1/2/3 with my module (Thats the reason for this issue). So either you delete the devices of my module to test this or you change the ports e.g. 12000... .

@sdetweil
Copy link
Author

sdetweil commented Mar 11, 2020

ok, I 'think' what you said is that previously registered devices are tied to a port..
so I deleted all the devices from Alexa, and then did the script above again

Fake now works.
but alexa turn off 'fake device' fires on 'fake device 2'

then I went and deleted all the devices again and just ran the MM project

got these 4 devices (plus one already defined outside wemo )

restart pm2 Wemo Plug	Forget
stop pm2 Wemo Plug	Forget
office monitor Wemo Plug	Forget
refresh Wemo Plug	Forget

Office ecobee remote sensor	Forget

alexa turn off office returns 'office doesn't support that'

i deleted all devices used 11000 for MM devices, and 12000 for FAKE devices..

cant run both at the same time, as port 1900 is in use by the first started

now office monitor device will turn on, but not off... (office doesn't support that)

'alexa turn off fake device' turns off fake device 2 (not 1/3/4) so name matching is not exact

@JosefJantzen
Copy link

I don't know more at the time. I hope the developer of node-fauxmo can help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants