Skip to content

Improve emulated_hue compatibility with newer systems#35148

Merged
bdraco merged 6 commits intohome-assistant:devfrom
Tho85:emulated-hue-freeathome
May 4, 2020
Merged

Improve emulated_hue compatibility with newer systems#35148
bdraco merged 6 commits intohome-assistant:devfrom
Tho85:emulated-hue-freeathome

Conversation

@Tho85
Copy link
Copy Markdown
Contributor

@Tho85 Tho85 commented May 3, 2020

Proposed change

Add some missing fields and API routes to emulated_hue to make it discoverable by a Busch-Jaeger free@home SysAP.

free@home is a smart home solution distributed by Busch-Jaeger that consists of in-wall sensors/actors and a system access point (SysAP). The SysAP can discover Philips Hue bridges and control announced Hue bulbs.

This PR makes the following changes to the emulated_hue API:

  • Send a correct serial number in description.xml and UPnP discovery packets. This seems to be the correct way to do it, since some devices try to derive a MAC address from the serial.
  • Send a newer IPbridge version (1.16.0) as well as API version(1.17.0)
  • Announce that the emulated bridge has a link button
  • Add a /api/{username}/config route that returns the config part of the /api/{username} full-state route

The integration also continues to work at least with Amazon Alexa. Other devices were not tested due to lack of hardware.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

Comment thread homeassistant/components/emulated_hue/hue_api.py
@bdraco
Copy link
Copy Markdown
Member

bdraco commented May 3, 2020

Screen Shot 2020-05-03 at 3 12 53 PM

Would you please add a test to make sure the endpoint isn't accessible from a public ip address

Comment thread homeassistant/components/emulated_hue/upnp.py Outdated
@bdraco
Copy link
Copy Markdown
Member

bdraco commented May 3, 2020

Tested the changes with a harmony hub. It wasn't able to find the bridge anymore

@bdraco
Copy link
Copy Markdown
Member

bdraco commented May 3, 2020

Appears to be working now that the Host line was removed.

Doing some more testing with it

@Tho85
Copy link
Copy Markdown
Contributor Author

Tho85 commented May 3, 2020

It is also discovered by the official "Philips Hue Bridge v1" Android app. (...which then complained about an outdated firmware on the "bridge"; the following firmware upgrade miraculously failed 😉 )

@Tho85
Copy link
Copy Markdown
Contributor Author

Tho85 commented May 3, 2020

... after changing the HUE_API_USERNAME to nouser, I forgot to add

@bdraco
Copy link
Copy Markdown
Member

bdraco commented May 3, 2020

... after changing the HUE_API_USERNAME to nouser, I forgot to add

Any downside you can think of to setting it to nouser in this PR? Seems the closer it can get to the hue implementation the more compatible its likely to be.

@Tho85
Copy link
Copy Markdown
Contributor Author

Tho85 commented May 3, 2020

I was thinking about that as well. I'll test it with my devices and see what happens

Tho85 added 2 commits May 4, 2020 00:34
nouser seems to be used by the official Hue Bridge v1 Android app and is
used by other projects as well
@Tho85
Copy link
Copy Markdown
Contributor Author

Tho85 commented May 3, 2020

nouser works with the original app, my Amazon Echo, and the free@home SysAP. It is also used by various other projects around the net, so let's stick with that.

@bdraco
Copy link
Copy Markdown
Member

bdraco commented May 4, 2020

@Tho85 Would you please fix the conflict with the other branch that just merged. I'll test after dinner with harmony

@bdraco
Copy link
Copy Markdown
Member

bdraco commented May 4, 2020

Working with harmony ok!

I'm also able to find the bridge with Colors for Hue mac desktop app.

@bdraco bdraco changed the title Make emulated hue detectable by Busch-Jaeger free@home SysAP Improve emulated_hue compatibility with newer systems May 4, 2020
@bdraco bdraco merged commit c5379a0 into home-assistant:dev May 4, 2020
@lock lock Bot locked and limited conversation to collaborators May 5, 2020
@Tho85 Tho85 deleted the emulated-hue-freeathome branch May 10, 2020 09:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants