tonesto7 / homebridge-smartthings

SmartThings Homebridge Plugin
384 stars 768 forks source link

Fibaro switch 2 is added but does not work. #265

Closed vanyadavidenko closed 4 years ago

vanyadavidenko commented 6 years ago

Hello. First of all - thanks for all the awesome job you've done. The first and only issue I have happened on the 8th device connection. You rock!

So, here's the problem: I've added Fibaro Single Switch 2 (FGS-213) to my Smartthings bridge. For that I used device handler from erocm123.

The switch works from Smartthings app (the old/classic one) - I'm able to observe energy usage as well as turn the lights on/off.

It also gets added to homebridge-smartthings:

... [2018-6-9 01:34:42] [SmartThings] Device Added - Group EnergyMeter, Name Bathroom Light, ID faf3a4ec-d9d6-4a96-b056-5e70f81c3f40 [2018-6-9 01:34:42] [SmartThings] Unknown Capabilities: ["Water Sensor","Health Check","Button","Holdable Button"]

In iPhone's Home app the switch is presented as switch, however, it has no effect after turning on/off. I assume the problem is that it's added as "EnergyMeter"?

I tried reconnecting it (by disabling and enabling in JSON API) - same result. PS: (not sure if that helps) I'm able to switch the light from IFTTT, so the DH seems to be ok.

UPDATE: it also works with Google Home. So the problem is definitely simple but I don't know where to start from :-(

vanyadavidenko commented 6 years ago

Okay. I fixed/hacked this by editing smartthings.js:224 and commenting out the second part of condition:

if (device.capabilities["Switch"] !== undefined /*&& this.deviceGroup == "unknown"*/) { ------------------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Now the device is added as 2 switches - one for EnergyMeter (no-op in Home app) and one for Switch (works in Home app!).

However, please reconsider this second condition because it seems to be erroneous at least in some cases.