home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.3k stars 30.62k forks source link

Philips hue lights not discovered at all #3845

Closed kxtcd950 closed 7 years ago

kxtcd950 commented 8 years ago

Home Assistant release (hass --version): 0.30.2

Python release (python3 --version): 3.5.2

Component/platform: hue

Description of problem: Discovery isn't discovering any hue lights

Expected: Hue to be discovered, as it always has been

Problem-relevant configuration.yaml entries and steps to reproduce:

# Discover some devices automatically (necessary for Philips Hue)
discovery:
  1. Start hass
  2. Wait for discovery to start
  3. Wait for hue lights to be discovered

Traceback (if applicable): Not a crash.

Additional info: hass emits the following (relevant) lines in the log file as soon as discovery starts:

16-10-12 19:11:01 INFO (Thread-7) [requests.packages.urllib3.connectionpool] Starting new HTTP connection (1): 90.155.51.234
16-10-12 19:11:01 INFO (Thread-7) [requests.packages.urllib3.connectionpool] Starting new HTTP connection (1): 90.155.51.251
16-10-12 19:11:01 ERROR (Thread-7) [netdisco.ssdp] Found malformed XML at http://90.155.51.251:8080/upnp: <html><head><title>Apache Tomcat/7.0.64 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - /upnp.jsp</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>/upnp.jsp</u></p><p><b>description</b> <u>The requested resource is not available.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/7.0.64</h3></body></html>
16-10-12 19:11:01 INFO (Thread-7) [requests.packages.urllib3.connectionpool] Starting new HTTP connection (1): 90.155.51.228
16-10-12 19:11:01 INFO (Thread-7) [requests.packages.urllib3.connectionpool] Starting new HTTP connection (1): 90.155.51.228
16-10-12 19:11:01 INFO (Thread-7) [requests.packages.urllib3.connectionpool] Starting new HTTP connection (1): 90.155.51.228
16-10-12 19:11:01 INFO (Thread-7) [requests.packages.urllib3.connectionpool] Starting new HTTP connection (1): 90.155.51.228
16-10-12 19:11:02 INFO (Thread-7) [requests.packages.urllib3.connectionpool] Starting new HTTP connection (1): 90.155.51.249
16-10-12 19:11:02 ERROR (Thread-7) [netdisco.ssdp] Found malformed XML at http://90.155.51.249:49153/description4.xml:
16-10-12 19:11:02 INFO (Thread-7) [requests.packages.urllib3.connectionpool] Starting new HTTP connection (1): 90.155.51.252
16-10-12 19:11:02 ERROR (Thread-7) [netdisco.ssdp] Found malformed XML at http://90.155.51.252:49153/description1.xml:
16-10-12 19:11:02 INFO (Thread-7) [requests.packages.urllib3.connectionpool] Starting new HTTP connection (1): 90.155.51.252
16-10-12 19:11:02 ERROR (Thread-7) [netdisco.ssdp] Found malformed XML at http://90.155.51.252:49153/description3.xml:
16-10-12 19:11:02 INFO (Thread-7) [requests.packages.urllib3.connectionpool] Starting new HTTP connection (1): 90.155.51.249
16-10-12 19:11:02 ERROR (Thread-7) [netdisco.ssdp] Found malformed XML at http://90.155.51.249:49153/description5.xml:
16-10-12 19:11:02 INFO (Thread-7) [requests.packages.urllib3.connectionpool] Starting new HTTP connection (1): 90.155.51.249
16-10-12 19:11:02 ERROR (Thread-7) [netdisco.ssdp] Found malformed XML at http://90.155.51.249:49153/description6.xml:
16-10-12 19:11:02 INFO (Thread-7) [requests.packages.urllib3.connectionpool] Starting new HTTP connection (1): 90.155.51.252
16-10-12 19:11:02 ERROR (Thread-7) [netdisco.ssdp] Found malformed XML at http://90.155.51.252:49153/description0.xml:
16-10-12 19:11:02 INFO (Thread-7) [homeassistant.components.discovery] Found new service: mystrom ('BSB002', 'http://90.155.51.248', '00:17:88:22:EF:F0')
16-10-12 19:11:02 INFO (Thread-7) [homeassistant.components.discovery] Found new service: homekit {'sf': '0', 'md': 'BSB002', 'ci': '2', 'id': '00:17:88:22:EF:F0', 's#': '1', 'c#': '20', 'pv': '1.0', 'ff': '1', 'host': 'http://90.155.51.248'}

Note that 90.155.51.248 is my Philips hue hub; the IP address that "discovers" as a homekit and a "mystrom" (whatever that is). No lights are detected. Philips hue app and iConnectHue both connect to the hub ok, and can control lights.

phue.conf exists in the ~/.homeassistant directory with the following contents: {"90.155.51.248": {"username": ""}} and it's readable by my user, as are all config files. Firewall on the computer running hass is turned off.

This setup has previously been working for well over a couple of months; it only stopped today - this afternoon.

kxtcd950 commented 8 years ago

Addendum: After adding the lines: light: platform: hue host: 90.155.51.248

when next starting hass, I got the log entries:

16-10-12 19:29:59 INFO (Thread-1) [homeassistant.util.package] Attempting install of phue==0.8
16-10-12 19:30:15 INFO (Thread-1) [phue] Attempting to connect to the bridge...
16-10-12 19:30:15 INFO (Thread-1) [phue] Using ip: 90.155.51.248

I suspect that something didn't upgrade to the latest hue package version until I forcibly added the platform in the config. Would the old hue platform module not work with the newer version of hass which I just upgraded to so that I was running the latest homeassistant version to report the bug?

Worthy of note is that this hue problem started this afternoon, before I upgraded to the latest version of hass to report this bug, though.

partofthething commented 7 years ago

Isn't that a public IP address? Usually HUE, etc. should be connecting through your local LAN. Do you have a non-standard setup?

kxtcd950 commented 7 years ago

Yes, that's a public IP address; as is the IP address which the server is assigned. And both IP addresses are in the same subnet (it's a /27, for a total of 32 IP addresses).

Nonstandard? By home user "standards", yes. But by network standards, no there's nothing non-standard about it. As I've already said earlier in the thread, iConnectHue, and the official Hue app (v1 and v2) connect to the hub ok, because I've already gone through the pain of adding a source-nat rule to my router for Hue-related traffic. This question is about local service discovery, though, so I'm assuming that the connection to the Philips servers is largely irrelevant here; this is at the point the hass instance attempts to discover that on the local network (i.e. the public /27) there is another host which is a Philips Hue Hub (there most definately is) - which doesn't seem to need access to the internet at large.

stetho commented 7 years ago

But by network standards, no there's nothing non-standard about it.

Are you using externally routable addresses on your local network?

kxtcd950 commented 7 years ago

Yes, a /27. Have done for years; I have the block routed at me by my ISP.

stetho commented 7 years ago

Yes, I noticed. Your diskstation is exposed to the internet. Does your router have a routing table that tells it these addresses are internal?

kxtcd950 commented 7 years ago

Nope. All the hosts have the same subnet, so they all drop local traffic on the local network. It's exactly the same as a more conventional setup in that case.

balloobbot commented 7 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment :+1:

balloobbot commented 7 years ago

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem 👍