dresden-elektronik / deconz-rest-plugin

deCONZ REST-API plugin to control ZigBee devices
BSD 3-Clause "New" or "Revised" License
1.89k stars 496 forks source link

Gateway not discovered by Alexa #759

Closed ooii closed 5 years ago

ooii commented 6 years ago

I read on another issue that deconz works fine with Alexa since several months. But in my case, I cannot discover it with Alexa. I enable the Hue skill then open the gateway and finally start the discovery. And I never find it. Is there something I’m doing wrong? Thanks.

manup commented 6 years ago

It doesn't work with the Hue skill, only with the build in Echo Hue support, normally you need to allow to connect apps in the Phoscon App > Menu > Gateway > Settings and then via voice command ask Alexa "discover devices".

ooii commented 6 years ago

That’s exactly what I did. When I start detection, it says that I should enable the associated connected home skill (translated from French) if not already enabled and it starts discovering for up to 20 seconds then fails.

ooii commented 6 years ago

Btw, I'm using an Echo Dot while you're mentioning an Echo, is there any difference?

manup commented 6 years ago

Should also work we had testet it a while ago, but it was important not to use (or even install?) the Hue skill and just use the plain Alexa discover devices method.

ooii commented 6 years ago

Just ran a test after disabling the Hue skill and still not able to discover my bridge. Is there anything I can test to figure out what happening? Is there any issue with homebridge (-hue) running at the same time (I don't think so but you never know).

ooii commented 6 years ago

Updated to 2.05.35 but same result.

manup commented 6 years ago

Just did a test with an Echo Dot and it worked.

Is your deCONZ installation running on port 80?

ooii commented 6 years ago

Is your deCONZ installation running on port 80?

Nope. I have an nginx server running on this port. So that's probably the reason of my issues. I'll come back here as soon as I reconfigured my reverse proxy. Thanks.

ooii commented 6 years ago

Unfortunately, that did not fix the issue. deConz is running now on port 80 but Alexa is still unable to discover it. Note that once, I was below the step of searching for 20 seconds and I was asked to switch on my switches and lamps, then an error occured in Alexa, and I was back to unsuccessful 20 seconds discovery.

manup commented 6 years ago

Other than port 80 the UDP port 1900 is used for SSDP multicast (or UPnP) which will be used by the Echo to detect the machine running deCONZ. It can do this only when they both are in the same network with no network switches in between. Also deCONZ must be allowed to bind to shared port 1900, which other services running on the same port might prevent.

mopby commented 6 years ago

Hello, I have the same problem. Alexa can't find any devices. Deconz is running on port 80. How can I figure out if UDP port 1900 is used?

ooii commented 6 years ago

I ran another test following @manup advice of having no switch between the machine running deconz and the Echo. Alexa discovered my home device but was not able to find all the lights!! After that, I tried another test but Alexa did not find any new device. Maybe I should delete the found devices and run a new discovery.

How can I figure out if UDP port 1900 is used?

I used ˋuPnP Analyzer` and found deconz service advertising. The machine running it was connected to the same WiFi access point as Alexa, so this latter should find it too.

mopby commented 6 years ago

Thanks for the tip, uPnP Analyzer shows

NOTIFY * HTTP/1.1 HOST: 239.255.255.250:1900 CACHE-CONTROL: max-age=100 LOCATION: http://127.0.0.1:80/description.xml SERVER: FreeRTOS/7.4.2, UPnP/1.0, IpBridge/1.8.0 NTS: ssdp:alive NT: upnp:rootdevice USN: uuid:d6a5efe7-3653-4212-b551-75bf4cd7bead::upnp:rootdevice GWID.phoscon.de: 00212EFFFF022B32 hue-bridgeid: 00212EFFFF022B32

everything seems fine. Im not running any network switch, the raspberry (running deconz) is connected to my wifi router / modem (fritzbox) directly via ethernet.

Unfortunately my echo dot still doesn't find any devices.

ebaauw commented 6 years ago

Did you turn off IGMP snooping on your router?

ebaauw commented 6 years ago

Oh, Fritz!Box doesn’t provide that setting. Better connect everything to a switch and use only one port on the Fritz. See https://github.com/nfarina/homebridge/issues/1801#issuecomment-417220526

mopby commented 6 years ago

Thanks for your quick response, I'll order a switch and follow your instructions. I'll report back :)

ebaauw commented 6 years ago

Please be aware: no guarantees this will solve the Alexa issue.

We've just seen that routers (and switches) with IGMP snooping enabled try to be too smart when it comes to handling multicast traffic (Bonjour, UPnP/SSDP). As a result, multicast traffic sometimes isn't delivered to the port where the client is connected, effectively making devices invisible for discovery by clients (even though on the server side, everything seems to be in order).

And the Fritz!Box seems to do IGMP snooping, with no option to disable it. To overcome this, you need to bypass the Fritz!Box, by connecting the Echo Dot and the Raspberry running deCONZ to the same switch (which would also be connected to the Fritz for Internet traffic). Of course, you don't want a switch with IGMP snooping. As far as I've seen, older routers and consumer-grade, unmanaged switches don't do IGMP snooping. Most recent routers and managed switches allow disabling it, except for the Fritz!Box.

ooii commented 6 years ago

@mopby where are you running uPnP analyzer? On the raspberry which is running deconz? It's weird to see the service available at LOCATION: http://127.0.0.1:80/description.xml which is the localhost address.

Thank you @ebaauw for the clarification about IGMP snooping.

mopby commented 6 years ago

ok, so i would need a new wifi-router as well since the echo dot is connected to the fritzboxs wifi at the moment. Thank you ebaauw for pointing this out.

Just for testing: I unplugged all devices but the raspberry. Still not able to discover my devices.

I ran the uPnP analyzer off my mac. I wondered about the address being localhost as well. I found some old posts about this being fixed.

I ran ha-bridge a while ago (from another machine) without any discovery problems (also connected via ethernet to my fritzbox).

ooii commented 6 years ago

It seems you have an issue with that. The provided url cannot allow Alexa to get the xml file correctly.

mopby commented 6 years ago

do you have an idea how to fix this?

ebaauw commented 6 years ago

It's weird to see the service available at LOCATION: http://127.0.0.1:80/description.xml which is the localhost address. I found some old posts about this being fixed.

What version of deCONZ are you on? v2.05.38 shows the Raspberry's IP address.

mopby commented 6 years ago

Im on the newest version (2.05.38). Already did reinstall and check if everythings alright. Since updating I also noticed that under "settings" -> "gateway" the firmware number is 00000000. When I upgrade the firmware everythings all right. But after a reboot the number is 00000000 again and I can click the upgrade button again. edit: I see the firmware issue has been discussed in another post edit 2: without clicking the upgrade button after reboot I can't control my lights / sensors

I tried reinstalling deconz, same behaviour.

ebaauw commented 6 years ago

Are you running natively on Raspbian or in a Docker container? If natively, what version of Raspbian?

I ran ha-bridge a while ago (from another machine) without any discovery problems (also connected via ethernet to my fritzbox)

I don't know how strict the Echo Dot or ha-bridge check that they found deCONZ (or a Hue bridge). homebridge-hue is happy with hue-bridgeid and GWID.phoscon.de and completely ignores LOCATION.

mopby commented 6 years ago

Im running on raspbian stretch ( Linux raspberrypi 4.14.34-v7+ #1110 SMP Mon Apr 16 15:18:51 BST 2018 armv7l ) - no docker container.

My raspberry has only 2 purposes: Deconz and yahm (which creates an lxc to emulate a homematic ccu2 with custom kernel.

I have no idea what to do next. I recently installed deconz to a friend and there's no discovery problem of alexa (older version, didn't update since two months)

Edit: I had a problem with my homebridge as well: I couldn't link to deconz " [Hue] raspberry: RaspBee/ConBee not yet initialised - wait 1 minute " - I downgraded to 2.05.37 an everythings all right again. Alexa discovery still won't work. After another upgrade to 2.05.38 homebridge started working again. Still don't know what caused the problem.

mopby commented 6 years ago

Hello, i experimented with my deconz installation. I moved deconz to a virtual ubuntu installation (running on my proxmox) and now alexa finds all devices. Also the uPnP advertises as it should.

NOTIFY * HTTP/1.1 HOST: 239.255.255.250:1900 CACHE-CONTROL: max-age=100 LOCATION: http://192.168.178.30:80/description.xml SERVER: FreeRTOS/7.4.2, UPnP/1.0, IpBridge/1.8.0 NTS: ssdp:alive NT: upnp:rootdevice USN: uuid:d6a5efe7-3653-4212-b551-75bf4cd7bead::upnp:rootdevice GWID.phoscon.de: 00212EFFFF022B32 hue-bridgeid: 00212EFFFF022B32

Stillt don't know whats wrong with my raspberry, but I'm very happy now with everything working as expected. Not a bug, just a fault of my system I guess. Thanks for your help and sorry for not being able to provide help for others since I didn't find the source of my problem

Spitzbua commented 5 years ago

I have the same problem with my configuration. Alexa on RPI can't detect the Phoscon gateway.

Followed those steps, but no success:

UPNP is running and file can be received through http://192.168.0.4:80/description.xml:

`pi@raspalexa:~ $ gssdp-discover -i eth0 --timeout=3 Using network interface eth0 Scanning for all resources Showing "available" messages resource available

USN: uuid:fdacb23f-a3f2-4e12-8d5b-11111111111111::upnp:rootdevice Location: http://192.168.0.4:80/description.xml resource available

USN: uuid:fdacb23f-a3f2-4e12-8d5b-11111111111111 Location: http://192.168.0.4:80/description.xml resource available `

Detection worked with HUE app and All4Hue but not with Alexa. I have also tried to set both on the same switch, but no success. Any other ideas what to do? The gateway will be detected by several other apps....

saurabh984 commented 5 years ago

Same here. Using v2.05.40

Had to reset all my Echo devices and it can't discover deCONZ anymore.

I can see deCONZ using UPnP discovery tools. iConnectHue does discover deCONZ.

tiwo85 commented 5 years ago

Same here. U sind 2.05.42

saurabh984 commented 5 years ago

I can confirm @manup fix https://github.com/dresden-elektronik/deconz-rest-plugin/commit/2c0c974165a9b4f08d4b7e31d931c6fae7bfc74a has fixed Alexa discovery issue.

Thank you :)

Spitzbua commented 5 years ago

@saurabh984 , I have now updated to 2.05.45, altough the firmware update did not work over GCFFlasher or over the WebApp. What firmware are you using?

I am still facing the discovery issue with Alexa:

Version 2.05.45 / 2.11.2018 Firmware 26240500

fretmeat commented 5 years ago

@Spitzbua, Same here - Alexa/Echo can't find the fixtures etc. in 2.05.46. Used to work flawlessly until I had to re-setup everything.

edit: RaspBee on Raspberry Pi 3 , Phoscon-gateway.iso, fritzbox, Echo dot,

My first guess is that the recent Alexa app/interface overhaul changed the way the (fake) HUE bridge is contacted by the echo - as 3rd party apps still seem work.

Anyhow - I think the Echo stopped "seeing" the fixtures once I update from 2.05.34 to 2.05.44 a couple of days ago - so second guess is that sometime in between something changed the behaviour.

Just tried HUE essentials on Android and it works. It askes for the password of the gateway, which alexa doesn't (I think the push-button solution used to work before) //(well-did I just tell some app my password, I guess so.)

saurabh984 commented 5 years ago

@Spitzbua 0x262e0500

I moved to a ubuntu VM on esxi. It didn't work for me on Raspberry Pi. I don't think this is to do with changes to API. I think it might be a routing issue or timing. UPnP Analyser showed a response from Raspberry Pi after 20 seconds. Alexa tries the UPnP discovery for a lot less than that.

KodeCR commented 5 years ago

Looks like I broke Alexa discovery in 2.05.44 (see #902), Alexa apparently wants the manufacturer in description.xml to be Philips. Try updating /usr/share/deCONZ/webapp/description_in.xml with the latest one from github (https://github.com/dresden-elektronik/deconz-rest-plugin/blob/master/description_in.xml), or manually change "dresden elektronik" to "Royal Philips Electronics".

On my Raspberry Pi it definitely works, I used the latest version of the app, "Devices", "+", "Add device", "Hue", "Hue bridge v1", "Authenticate App" in Phoson, "Discover devices". Note that it is important that the Hue skill is not enabled, otherwise you can't choose the v1 bridge.

ooii commented 5 years ago

Thanks @KodeCR but it is not working here. Changed the description.xml file and restarted deconz. The xml exposed throuhg uPnP shows Royal Philips Electronics now instead of Dresden elektronic but still not able to discover it.

fretmeat commented 5 years ago

heúrēka! Thanks @KodeCR That did it for me - although it took its time as I was trying to clone the repo, then make and install it - instead of just copying/changing the new file to /usr/share/.. as you stated.

Looks like I broke Alexa discovery in 2.05.44 (see #902), Alexa apparently wants the manufacturer in description.xml to be Philips. Try updating /usr/share/deCONZ/webapp/description_in.xml with the latest one from github (https://github.com/dresden-elektronik/deconz-rest-plugin/blob/master/description_in.xml), or manually change "dresden elektronik" to "Royal Philips Electronics".

saurabh984 commented 5 years ago

That fixed some new lights I just added too! The description_in.xml doesn't get replaced by the deb package for some reason. It had the incorrect manufacturer name even after the latest package installed.

ooii commented 5 years ago

I was reading some instructions about integration of Alexa with Home Assistant and found that: Warning: If you have a lot of devices (more than 49 total across all exposed domains), you should be careful with this option. Exposing more devices than Alexa supports can result in it not seeing any of them. Since I have more than 49 devices in my deConz setup, I think that may be the cause of my Alexa not discovering my devices.

giancarlolamedica commented 5 years ago

Update: with an echo dot (v3) connected to the network it works! Alexa has discovered all lights and smart plugs connected to zigbee network!


No way to find bridge from alexa android or ios app. The phone is connected directly to wifi of raspberry configured as access point. Raspberry is running raspbian jessie, deconz 2.05.47 with firmware 262F0500, i have 23 nodes on zigbee network. SSDPTester (an android app) receive correctly the uPnp packet after few seconds.

18 nov 2018 14:15:39: Packet received from 192.168.1.7:1900 : NOTIFY * HTTP/1.1\r\n HOST: 239.255.255.250:1900\r\n CACHE-CONTROL: max-age=100\r\n LOCATION: http://192.168.1.7:80/description.xml\r\n SERVER: Linux/3.14.0 UPnP/1.0 IpBridge/1.26.0\r\n GWID.phoscon.de: censored\r\n hue-bridgeid: censored\r\n NTS: ssdp:alive\r\n NT: urn:schemas-upnp-org:device:basic:1\r\n USN: uuid:censored::urn:schemas-upnp-org:device:basic:1\r\n \r\n

this is the content of http://192.168.1.7:80/description.xml

<?xml version="1.0" encoding="UTF-8"?>

1 0 http://192.168.1.7:80/ urn:schemas-upnp-org:device:Basic:1 Phoscon-GW (192.168.1.7) Royal Philips Electronics http://www.dresden-elektronik.de Philips hue compatible Personal Wireless Lighting Philips hue bridge 2015 BSB002 http://www.dresden-elektronik.de ***censored*** uuid:***censored*** index.html image/png 48 48 24 hue_logo_0.png

Scan device from alexa app (hue bridge v1 with no skill enabled and 3rd party apps authentication enabled from gateway) fail after 20 seconds (tried several times). I don't have a physical echo device at the moment but i think it's ininfluent. I tried also to remove the router (attached to raspberry via ethernet) so that the deconz is the only source of ssdp packets. If sniff packets on wlan interface of raspberry while scanning device from alexa don't see ssdp search request but a dhcp discover and i see ssdp notification from deconz with destination 239.255.255.250

NOTIFY * HTTP/1.1 HOST: 239.255.255.250:1900 CACHE-CONTROL: max-age=100 LOCATION: http://192.168.2.8:80/description.xml SERVER: Linux/3.14.0 UPnP/1.0 IpBridge/1.26.0 GWID.phoscon.de: censored hue-bridgeid: censored NTS: ssdp:alive NT: urn:schemas-upnp-org:device:basic:1 USN: uuid:censored::urn:schemas-upnp-org:device:basic:1

and xml with this network configuration

<?xml version="1.0" encoding="UTF-8"?>

1 0 http://192.168.2.8:80/ urn:schemas-upnp-org:device:Basic:1 Phoscon-GW (192.168.2.8) Royal Philips Electronics http://www.dresden-elektronik.de Philips hue compatible Personal Wireless Lighting Philips hue bridge 2015 BSB002 http://www.dresden-elektronik.de ***censored*** uuid:***censored*** index.html image/png 48 48 24 hue_logo_0.png
Spitzbua commented 5 years ago

I can confirm that this issue is fixed with (echo dot v3):

Version 2.05.46 Firmware 26240500

rstoermer commented 5 years ago

I also can't discover any devices with Alexa, neither by telling Alexa to look for new devices, nor by looking for lamps in the Alexa app. Deconz is running on a RPI3 in a Docker container (https://hub.docker.com/r/marthoc/deconz/) on version 2.05.47. My firmware is 260B0500 (Can't update the firmware to the newest version. In Phoscon I click update, update is running, but after the update is finished, the version is still the old one)

Under http://192.168.1.4/description.xml I can find the needed XML, so everything shoud be running on Port 80 and Alexa should be able to find the Gateway:

<root xmlns="urn:schemas-upnp-org:device-1-0">
<specVersion>
<major>1</major>
<minor>0</minor>
</specVersion>
<URLBase>http://192.168.1.4:80/</URLBase>
<device>
<deviceType>urn:schemas-upnp-org:device:Basic:1</deviceType>
<friendlyName>ZigBee (192.168.1.4)</friendlyName>
<manufacturer>Royal Philips Electronics</manufacturer>
<manufacturerURL>http://www.dresden-elektronik.de</manufacturerURL>
<modelDescription>Philips hue compatible Personal Wireless Lighting</modelDescription>
<modelName>Philips hue bridge 2015</modelName>
<modelNumber>BSB002</modelNumber>
<modelURL>http://www.dresden-elektronik.de</modelURL>
<serialNumber>00212E02F3ED</serialNumber>
<UDN>uuid:bd66f015-e388-4d10-9ea5-b3585ccf0843</UDN>
<presentationURL>index.html</presentationURL>
<iconList>
<icon>
<mimetype>image/png</mimetype>
<height>48</height>
<width>48</width>
<depth>24</depth>
<url>hue_logo_0.png</url>
</icon>
</iconList>
</device>
</root>
stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

outofsight commented 4 years ago

Any update on this? I cannot pair Alexa andoid app with deconz running on RPI 4 HASSIO.

hparusel commented 4 years ago

Same here. I cannot connect to Alexa either (RPI 1b)...

unstressable commented 4 years ago

Hey togehter. For me alexa found my devices connected to phoscon, but there is no possibility to control the lights. Alexa always says that the devices are unresponsible. Any idea?

Schnuecks commented 4 years ago

Same here could not connect to Alexa

rstoermer commented 4 years ago

Still a problem here...

daubweb commented 4 years ago

Same issue after a complete reset Conbee 2 on raspberry pi 3, newest headless sd image. Not discovered by Alexa.

No devices, no hub.

univok commented 4 years ago

Conbee 2 on raspberry pi 3, Raspbian Buster with desktop 2020-02-13, stable DeConz from http://phoscon.de/apt/deconz. DeConz and Phoscon work like a charme, thumbs up, but Alexa does not find all devices. Some are correct, some missing, and some are found under an older name I changed in phoscon long time ago, and do not work.

Initially, some hue lights and OSRAM/innr smart plugs were able to be controlled by Alexa, but this stopped working all of a sudden, maybe after another "search for devices". Deleting and refinding them doesn't change that. Though Alexa find devices, no one is responsive, Alexa app saying "Waiting for Royal Philips Electronics..." IGMP is off at Fritz and Switch.

Feeling helpless and upset because I have no idea how to debug this. Spent hours of installing, testing. Result is non deterministic. Will be switching to iobroker likely.

hparusel commented 4 years ago

I really had the same issues. Currently, I use Sonos One, Amazon Flex and one Amazon Echo (3. Generation). Like I already have written before it started working as soon as I got and integrated the Amazon Echo (3. Generation). Last week my wife unplugged the the Echo by coincidence. When I tried to talk to Alexa nothing was responding until I found out that she unplugged the Echo. Even with all Amazon Flex and Sonos One plugged in. As soon as I plugged the Echo in everything was working again. It seems that you need at least one Echo of the current Generation. I know that does not solve you issue. But might get a hint to someone how is able to fix it.