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

Add support for fauxmo devices to be discovered by HomeAssistant #121

Merged
merged 1 commit into from
Jan 13, 2024

Conversation

howdypierce
Copy link
Contributor

Description

Makes two changes needed for HomeAssistant to discover and manage fauxmo devices:

  • HomeAssistant relies on pywemo for device discovery. The pywemo.discover_devices() function sends an ssdp probe using the string "urn:Belkin:service:basicevent:1". This change causes fauxmo to respond to that probe so that pywemo.discover_devices will find fauxmo devices.

  • As mentioned in Fauxmo does not work with Home Assistant #88, HomeAssistant uses the serial number returned by a "real" Wemo to disambiguate devices, if more than one device shares an IP address. This changes causes fauxmo to respond to a setup message with the serial number, so that multiple fauxmo devices will be seen from HomeAssistant. This change was mentioned in the discussion for Issue 88 but does not appear to have been merged to master.

Status

**READY

Related Issues

Steps to Test or Reproduce

Unfortunately I don’t have a system that is capable of running make test-all (even before my change). I have, however, manually tested the change against pywemo.discover_devices (from pywemo 0.9.1) and also against HomeAssistant 2023.11.3.

Makes two changes needed for HomeAssistant to discover and manage
fauxmo devices:

* HomeAssistant relies on pywemo for device discovery. The
  pywemo.discover_devices() function sends an ssdp probe of the string
  "urn:Belkin:service:basicevent:1". This change causes fauxmo to respond to
  that probe so that pywemo.discover_devices will find fauxmo devices.

* As mentioned in n8henrie#88,
  HomeAssistant uses the serial number returned by a "real" Wemo to
  disambiguate devices, if more than one device shares an IP
  address. This changes causes fauxmo to respond to a setup message
  with the serial number, so that multiple fauxmo devices will be seen
  from HomeAssistant.
@n8henrie
Copy link
Owner

n8henrie commented Jan 8, 2024

Interesting, thanks for the PR! I do everything in the opposite direction, having the devices primarily in hass and using fauxmo just to interface between Alexa and hass.

Off the bat, I don't see any reason that permitting things to go in the opposite direction would be problematic. I'll do some testing.

@n8henrie n8henrie changed the base branch from master to dev January 9, 2024 23:00
@n8henrie n8henrie merged commit 158a967 into n8henrie:dev Jan 13, 2024
4 checks passed
@n8henrie
Copy link
Owner

Seems to work. Thanks!

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

Successfully merging this pull request may close these issues.

2 participants