zenion / homebridge-plugin-hubspace

Apache License 2.0
6 stars 5 forks source link

Smart socket shows up as light with brightness instead of switch. #2

Open kirchmeyer opened 1 year ago

kirchmeyer commented 1 year ago

Describe The Bug:

It's the smart socket from Home Depot. https://www.homedepot.com/p/Commercial-Electric-Indoor-Outdoor-Smart-Hubspace-Screw-Based-Lighting-Socket-HPLA11CWB/316692074

This is the error from the homebridge log. The light still does function for on and off, just with the error and the fact that it's a slider instead of a switch.

To Reproduce: Setup as prescribed.

Expected behavior: Should be switch instead of slider.

Logs:

[11/23/2022, 5:54:34 PM] [homebridge-plugin-hubspace] This plugin generated a warning from the characteristic 'Brightness': characteristic value expected valid finite number and received "undefined" (undefined). See https://homebridge.io/w/JtMGR for more info.

Environment:

zenion commented 1 year ago

im working on a feature complete version of this plugin that will address this. i honestly initially just created this for my string lights initially 😀

hopefully will have some time to implement more devices over the coming weeks

rgranadino commented 1 year ago

Ran into this issue as well. I had just cloned this repo last night to start poking around to try to see if I could contribute a PR to resolve the issue. Happy to help in anyway.

jgstroud commented 1 year ago

For a quick patch you can just change the hard coded Lightbulb to a hard coded Outlet, and remove the brightness attribute.

The outlet only shows up as a single device even though it has 2 outlets. Looks like the hubspace api only returns a single device with separate actions for each socket. So, I'm thinking somehow this needs to get broken up into multiple devices.

zenion commented 1 year ago

yeah you’re spot on. they use afero iot platform behind the scenes and every THING is one asset in their platform. there’s a bit of remodeling to do to deal with devices that need to be multiple underlying devices for homekit

i will have some time this weekend and plan to make some progress here

rgranadino commented 1 year ago

One side effect I noticed from changing the type from Lightbulb to Outlet is that it created two new devices and left the old ones.

jgstroud commented 1 year ago

You just need to remove the cached objects in HomeBridge. Click the triple dots in the top right corner, then HomeBridge settings. From there you can remove the cached items.

fratinize commented 1 year ago

Just purchased this smart socket and it shows as a switch