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

Problem connecting to Hue Bridge #8

Closed
thomasi82 opened this issue Nov 1, 2020 · 33 comments
Closed

Problem connecting to Hue Bridge #8

thomasi82 opened this issue Nov 1, 2020 · 33 comments

Comments

@thomasi82
Copy link

When I try to connect ot my Hue Bridge the Stream Deck app finds the bridge andt connects to it. But when I ty to select the bridge it's not listed in the drop down menu of the button I have selected. The drop down meny only has the options "No Bridges" and "Add new"

@petermein
Copy link

I'm experiencing the same issue, here some addiational logging information.

11:38:23.076 Start polling to create cache
11:38:37.895 No bridge configured
11:38:38.601 No bridge configured
11:58:44.326 Stop polling to create cache
11:58:44.326 Start polling to create cache
11:59:04.937 Stop polling to create cache
11:59:04.937 Start polling to create cache
12:37:36.280 Bridge 001788fffeb37f3d not found in cache
12:37:36.650 Bridge 001788fffeb37f3d not found in cache
12:37:37.457 Bridge 001788fffeb37f3d not found in cache
12:37:37.767 Bridge 001788fffeb37f3d not found in cache
12:37:38.139 Bridge 001788fffeb37f3d not found in cache
12:39:22.102 No bridge configured
19:04:55.832 Stop polling to create cache
19:04:55.833 Start polling to create cache
19:04:56.120 Stop polling to create cache
19:04:56.121 Start polling to create cache
19:13:38.846 Stop polling to create cache
19:13:38.846 Start polling to create cache
19:13:41.703 Stop polling to create cache
19:13:41.703 Start polling to create cache
19:16:37.128 Bridge 001788fffeb37f3d not found in cache

@Timac
Copy link

Timac commented Nov 13, 2020

If you uninstall and reinstall the Philips Hue plugin from the More Actions... window, does it help?

@thomasi82
Copy link
Author

I tried to reinstall the plugin a couple of times, but that did not help.
That being said, after I tried connecting the hub and did not show in the stream deck app I just left it. When I returned to the computer the next day evereything was OK. It seems like it just needed some time. It has been stable since and when I make changes on the Hue Bride they become available in the stream deck app almost instantly.

@benstegink
Copy link

I just connected (supposedly) my bridge to my streamdeck as well and have the same issue as above where it doesn't show. Hopefully, mine will magically show up in the next day or two as well?

@Trupacz
Copy link

Trupacz commented Nov 18, 2020

I had the same problem i needed to Close Stream Deck and Manualy Start it as Administrator. There is a problem with this plugin not detecting hub when started with Auto Start. All my buttons and macros are working prefectly fine but when starting stream deck as administrator in Autostart ony Philips Hue plugin is broken.

@Kissmann
Copy link

I have the same problem when i start streamdeck as an administrator the hue app will not show my bridge if i close Stream Deck and start it as an user it will show my bridge.

@jaeichel
Copy link

+1 for a fix please :)

I also ran into the same issue recently.

"No bridges" were available for previously working buttons.

  • I closed the app, rebooted my hub, opened the open - no change
  • I closed the app, rebooted my hub, opened the open, readded the bridge (bridge added) - no change
  • Then I restarted the streamdeck app again, and the bridge was visible and working again.

@AdamDavidHill
Copy link

I have the same symptoms as described above, but unlike the other user, removing and reinstalling the plugin fixed it for me.

@jaeichel
Copy link

jaeichel commented Aug 5, 2021

As an update, I continue to run into this issue intermittently. I continue to use my process above, which generally continues to fix it for my case.

@richsark2000
Copy link

richsark2000 commented Aug 6, 2021 via email

@jaeichel
Copy link

jaeichel commented Aug 6, 2021

@richsark2000 I've done a bit of hacking with my Philips hue bridge in the past and I think it has a IP address using TCP with the http protocol. I wonder if streamdeck is "searching" for this ip address using something non-TCP, like a UDP broadcast or multi-cast to handle cases where the Philips hue bridge changes it's ip.

I have no idea if this will fix it, but I wonder if you can manually set the IP address of your Philips hue bridge by configuring your DHCP router at home to give the philips hue a static ip address on your local network. Of course it still might break if the streamdeck plugin relies on a UDP search mechanism and doesn't try to connect to a previous ip address directly. If I have some time to look through their source code I can see what it's trying to do. The short version is, if it's using UDP multi-cast, the VPN can disrupt that mechanism. If that's the case, there should be a way to patch it (maybe one-line? probably a bit more depending). Without digging in I can't say for sure what is happening.

@jaeichel
Copy link

jaeichel commented Aug 7, 2021

@richsark2000 looks like streamdeck is using the standard philips hue discovery mechanism API - code

It is looking up https://discovery.meethue.com and the site returns the local ip address of your bridge. Then stream deck just uses that as a result.

Try visiting https://discovery.meethue.com/ with and without your VPN and see what it returns. You might see something like [{"id":"BE6988A71EF9919F","internalipaddress":"192.168.1.12"}] <- (this is not my real one btw). Then try to go to the website of the ip that it returns and you should see your bridge. For my bridge I would go to http://192.168.1.12 and it returns a page "HUE PERSONAL WIRELESS LIGHTING". If you can see it on both the VPN and at home, it should work fine and something else is wrong. Most likely you won't get the right ip returned (if anything) from your VPN connection.

I think this is why... I think the philips hue bridge, sends it's IP address to the philips server for services. IF you are on the same network at home, you can go to https://discovery.meethue.com (Philips Hue probably sees you going to this website from your home ip address - the router WAN address - and returns the home IP address of your bridge on your home network). If you are not at home or "virtually in the office" through your VPN, the philips hue website thinks you are in your work and would return the work's bridge ip address - if they had one instead of your home system. Of course there is still the auth part of it so you cannot simply use your work's or someone else's address without pairing... long story short, I think this is where it's breakding down in your use case.

What to do about it? If you are able to code, you can submit a patch and improve the discovery system. They are using the standard philips API method, but you can enhance it to add more caching and a way to deal with your situation.

If you are not able to code, there might be a work around. First, check that your work VPN ip range is different from your home range - they probably are unless you did something custom at home. If they are the same, you are out of luck. Second, try using the streamdeck to control your lights BEFORE connecting to the VPN, then after you connect to the VPN see if the buttons still work. It's only a workaround, but it might be a way to get your system to find the bridge before connecting to the VPN and then allowing you to remember it for a while. I'm not sure how long it will last, but it did work on my system when I setup something similar.

[edit] - it is also possible your work VPN is routing ALL traffic to your work. Any calls to your local network might be going off to your work so streamdeck will send the message, your work VPN might take it, and the bridge will never see it. If so, you can try to contact your IT or maybe tweak your vpn config yourself, but if ALL traffic is routed, you are also out of luck. - technically you could override your VPN and manually setup a routing table but that's way beyond the scope for streamdeck or philips hue.

Good luck!

@AdamDavidHill
Copy link

AdamDavidHill commented Aug 12, 2021

I had the same issue again. This time I tried @Trupacz approach to compare, that is, simply quit Stream Deck from sys tray and then launch it manually as Administrator. It worked fine straight away. No need to re-discover bridges, etc.

@richsark2000
Copy link

richsark2000 commented Aug 12, 2021 via email

@Steinorama
Copy link

Hi. Thanks for the reply. I’m using a MacBook Pro. Already have admin. Still having the issue following quitting it and all apps and reopen. It works for 20 min then back to not working.

Open Activity Monitor and Quit the Streamdeck process. When it starts again it should work.

@ibriefer
Copy link

should make this so we can just enter the ip on our network the bridge has been assigned

@Lusayalumino
Copy link

Wow Jaeichel, tremendously helpful -- THANK YOU. My stream deck was seeing the hue hub, but wouldn't pair with it. I was hard wired and decided to turn on my wi-fi -- instantly I was able to pair. So unfortunately, the way my network is hooked up, I can only control Hue via streamdeck when my wifi is enabled. But this saved my a lot of frustration, and helped me understand the root cause. Thanks again for your thoughtful and thorough post.

@jaeichel
Copy link

jaeichel commented Feb 24, 2022

As a follow-up, I was doing a test locally and with minimal coding and a small amount of bravery you can patch your local plugin pretty easily.

Basically you can hack the discovery process,

You can hard-code your local bridge id and ip into that line locally so that it persists no matter what network you are on. This should work as long as you can ping / visit that ip in a browser.

  • Manually find your bridge info, many ways to do this, here's what I did,
    • visit https://discovery.meethue.com/ when streamdeck works and get the info
      • e.g. [{"id":"BE6988A71EF9919F","internalipaddress":"192.168.1.12","port":443}]

A tiny bit of hacking....

  • Find the plugin folder,
    • On Windows, navigate to %appdata%\Elgato\StreamDeck\Plugins\com.elgato.philips-hue.sdPlugin\plugin\js\philips
    • On Mac, ~/Library/Application Support/com.elgato.StreamDeck/Plugins/com.elgato.philips-hue.sdPlugin/plugin/js/philips
  • Open up the cache.js file in a text editor (notepad, VSCode, etc) (here's the original source)
  • Find the line discovery = {};
  • Replace that line with your info, e.g. discovery = { 'BE6988A71EF9919F': { 'ip': '192.168.1.12' } };
  • Save the cache.js file and restart the streamdeck application (close it out and start it again)

That's it!

Note: if you update the plugin, you might need to reapply your hack...
Note: probably a good idea to statically assign your bridge ip address if you are going to hardcode it here

@jaeichel
Copy link

@dkern is it worth re-openning this issue and having a look at PR-30? I've continued to have issues, but I'm hoping that this fix might address them. I'm not sure how to do wide spread testing, but "it works on my local machine" :P.

@dkern
Copy link
Contributor

dkern commented Feb 24, 2022

In the latest Version of the plugin here on git, there is a Feature to add your bridge by IP manially. No hacking needed.

@Lusayalumino
Copy link

Thanks so much jaeichel, I tried what you laid out, but didn't work for me. After turning off WiFi and rebooting StreamDeck, still "NO HUBS FOUND".

@Lusayalumino
Copy link

In the latest Version of the plugin here on git, there is a Feature to add your bridge by IP manially. No hacking needed.

dkern, can you post a link to that plugin?

@dkern
Copy link
Contributor

dkern commented Feb 24, 2022

Its right here in this repository. Just download it and do a manual installation (copy the files).

@Lusayalumino
Copy link

Lusayalumino commented Feb 25, 2022 via email

@dkern
Copy link
Contributor

dkern commented Feb 25, 2022

Yes, it is that plugin. But we're working on that, so there are updates from time to time. By now, the manual add feature is not rolled out and must be installed manually from git, if you want to use it now. Otherwise you need to wait for the deployment.

@Lusayalumino
Copy link

I uninstalled 1.4 from the Stream Deck Store > restarted Stream Deck > installed 1.5. > Edited cache.js -- still not working. One interesting thing is that although I installed 1.5, when I go to the store it says 1.4 is installed. Caching issue?

@tommykjensen
Copy link

This is a crazy issue. I get this problem every time I boot my windows machine.

When I go to https://discovery.meethue.com/ I see multiple adresses and none of them matches the ip adress or id for my hub.

What are the chances of getting a change to the plugin so it is possible to manually specify the ip adress of the hub ?

@dkern
Copy link
Contributor

dkern commented Jun 7, 2022

What are the chances of getting a change to the plugin so it is possible to manually specify the ip adress of the hub ?

It is already integrated in the version here on github. You need to manually update the files for now to have it on your system.

@tommykjensen
Copy link

tommykjensen commented Jun 7, 2022 via email

@tommykjensen
Copy link

I figured it out.

@wgilpin
Copy link

wgilpin commented Oct 20, 2022

Want to share?

@WinkelCode
Copy link

WinkelCode commented Nov 14, 2022

Is there a reason why we can't just use SSDP? This would the the obvious answer to the problems here.

@ThermalTran
Copy link

Howdy, guys.

I know this post is old, but I have the same issue. I can find and "add" my Philips Hue bridge in the Stream Deck software, and then after I complete the pairing, there is no bridge to select from the dropdown menu. I've tried everything in this post, but nothing works. I'm running Stream Deck software version: 6.7.3 (21005)

Thanks in advance for any help you can provide.

Screenshot 2024-10-01 165303

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