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 changing Outlets to Lights #59

Closed
PeteCooney opened this issue Jul 24, 2020 · 5 comments
Closed

Add support for changing Outlets to Lights #59

PeteCooney opened this issue Jul 24, 2020 · 5 comments

Comments

@PeteCooney
Copy link

I have a number of MSS210 plug adapters that I use to control lights (table lamps etc) around the house.
While it's possible to change the type of device within the Home app, it would be great to be able to override the default service type when creating the accessory within Homebridge.

@dylanfrankcom
Copy link
Contributor

dylanfrankcom commented Jul 24, 2020

Hey @PeteCooney, while I can see where you're coming from I think doing so would add a layer of unnecessary complexity to the setup process, make breaking changes to the user's current config, and could introduce bugs due to how Homebridge sets up a devices characteristics.

When a device in initialized within Homebridge it is assigned characteristics based on the service type provided by the plugin, an outlet from the Meross plugin in this situation. If the user is allowed to edit this value they would be able to initialize let's say a MSS210 as a MSG100 (Garage door opener). The MSS210 would then be sending incompatible requests to the Meross server such as a setting and receiving a GarageDoorState which could result in errors.

If you would like to experiment with this you can edit line 101 in index.js and initialize the device as a different service type. Simple on/off requests should still work but setting different states of an incompatible device such as colour, luminance, or status' could result in errors.

I feel as though the goal of a plugin is to provide a simplistic interface between the device and Homebridge and let the Home.app / HomeKit handle the rest. Let me know your thoughts!

@PeteCooney
Copy link
Author

Hi @dylanfrankcom, thanks for the detailed reply, much appreciated.

Regarding some of the risks you highlight:

  1. Complexity in setup: The additional setting would be optional and only apply to outlet type devices (if it's not present, or applied to an "unsupported" device, it simply gets ignored.
  2. Break existing config: As above, making this an optional setting would not break any existing config as the fall-back position would be to treat the device as its default type.
  3. Potential for bugs: Any change carries the potential to introduce bugs, however the risk could be minimised as highlighted above.
  4. Unsupported/unexpected message types: The scenario I'm suggesting applies specifically to plug-type outlets and only to change the device type between switch & light. This would certainly minimise the risk you highlight.
  5. Colour, luminance etc: These are admittedly a little harder to avoid. My MoesGo dimmer switches, connected via the homebridge-tuya-web plugin, have this issue and HomeBridge displays an error message if you try to set the colour/temperature of these devices.

I may take you up on the idea of tinkering with the code and, if I find an elegant solution, I'll be sure to submit a pull request for review.

@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot added the stale label Aug 11, 2020
@github-actions
Copy link
Contributor

This issue has been automatically closed because it has not had recent activity. Thank you for your contributions.

@donavanbecker
Copy link
Collaborator

See #151

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

3 participants