iklein99 / homebridge-smartthings

This is a plugin to Homebridge to connect your Smartthings network into Apple Home Kit.
Apache License 2.0
150 stars 52 forks source link

Smartthings Rollershades Not registering #216

Closed 20sixstring closed 9 months ago

20sixstring commented 9 months ago

Tilt Roller Shades For the past two years, I've been using the tonesto7 plugin on my Homebride to manage my Tilt RollerShades in HomeKit. However, last week, homebridge began generating a 401 error for smartthings in the logs. I've since installed this new plugin and noticed that it can access my SmartThings account successfully. However, it's only registering one out of the 4 devices, which happens to be a TV. My 3 Tilt roller shades are no longer visible.

This plugin doesn't retrieve all devices registered with SmartThings, as the previous version did. Any assistance you can provide would be immensely appreciated—I'm feeling quite lost without the ability to control my shades in HomeKit.

To Reproduce:

Expected behavior:

Logs: See extended log below. It appears that the RollerShades are being pushed to the plugin but the plugin doesn't register the devices.

02/09/2023, 02:47:16] Loaded plugin: homebridge-smartthings-ik@1.5.14 [02/09/2023, 02:47:16] Registering platform 'homebridge-smartthings-ik.HomeBridgeSmartThings' [02/09/2023, 02:47:16] --- [02/09/2023, 02:47:16] Loading 6 platforms... [02/09/2023, 02:47:16] [Smartthings Plug (IK)] Initializing HomeBridgeSmartThings platform... [02/09/2023, 02:47:16] [Smartthings Plug (IK)] Finished initializing platform: Smartthings Plug (IK) [02/09/2023, 02:47:16] [Smartthings Plug (IK)] Loading accessory from cache: Samsung Q70 Series (65) [02/09/2023, 02:47:16] [Smartthings Plug (IK)] Executed didFinishLaunching callback [02/09/2023, 02:47:16] [Smartthings Plug (IK)] Discovering devices... [02/09/2023, 02:47:18] [Smartthings Plug (IK)] Pushing Bedroom - Shades [02/09/2023, 02:47:18] [Smartthings Plug (IK)] Pushing Kitchen - Patio Door [02/09/2023, 02:47:18] [Smartthings Plug (IK)] Pushing Samsung Q70 Series (65) [02/09/2023, 02:47:18] [Smartthings Plug (IK)] Stored all devices. [02/09/2023, 02:47:18] [Smartthings Plug (IK)] DEVICE DATA: {"deviceId":"removed prefix 0000000000","name":"c2c-shade","label":"Bedroom - Shades","manufacturerName":"SmartThings","presentationId":"SmartThings-smartthings-c2c-shade","deviceManufacturerCode":"tilt","locationId":"0000000000","roomId":"0000000000","components":[{"id":"main","label":"main","capabilities":[{"id":"windowShade","version":1},{"id":"switchLevel","version":1},{"id":"refresh","version":1},{"id":"healthCheck","version":1}],"categories":[{"name":"Blind","categoryType":"manufacturer"}]}],"createTime":"2022-05-17T20:25:05.518Z","profile":{"id":"0000000000"},"viper":{"manufacturerName":"tilt","modelName":"Roller Shade","endpointAppId":"0000000000"},"type":"VIPER","restrictionTier":0,"allowed":[]} [02/09/2023, 02:47:18] [Smartthings Plug (IK)] DEVICE DATA: {"deviceId":"removed prefix 0000000000","name":"c2c-shade","label":"Kitchen - Patio Door","manufacturerName":"SmartThings","presentationId":"SmartThings-smartthings-c2c-shade","deviceManufacturerCode":"tilt","locationId":"0000000000","roomId":"0000000000","components":[{"id":"main","label":"main","capabilities":[{"id":"windowShade","version":1},{"id":"switchLevel","version":1},{"id":"refresh","version":1},{"id":"healthCheck","version":1}],"categories":[{"name":"Blind","categoryType":"manufacturer"}]}],"createTime":"2022-05-17T20:25:05.519Z","profile":{"id":"0000000000"},"viper":{"manufacturerName":"tilt","modelName":"Roller Shade","endpointAppId":"0000000000"},"type":"VIPER","restrictionTier":0,"allowed":[]} [02/09/2023, 02:47:18] [Smartthings Plug (IK)] Restoring existing accessory from cache: Samsung Q70 Series (65) [02/09/2023, 02:47:18] [Smartthings Plug (IK)] Creating instance of SwitchService for capabilities switch [02/09/2023, 02:47:18] [Smartthings Plug (IK)] Adding SwitchService to Samsung Q70 Series (65) [02/09/2023, 02:47:18] [Smartthings Plug (IK)] Registered SwitchService for capabilities switch

Show the Homebridge logs here, remove any sensitive information.

Plugin Config: { "name": "Smartthings Plug (IK)", "BaseURL": "https://api.smartthings.com/v1/", "AccessToken": "Valid", "GarageDoorMaxPoll": 40, "PollLocksSeconds": 10, "PollDoorsSeconds": 10, "PollSensorsSeconds": 5, "PollSwitchesAndLightsSeconds": 10, "PollWindowShadesSeconds": 20, "ExposeHumiditySensorForAirConditioners": false, "OptionalModeForAirConditioners": "None", "platform": "HomeBridgeSmartThings" } Show your Homebridge config.json here, remove any sensitive information.



**Screenshots:**
<!-- If applicable, add screenshots to help explain your problem. -->

**Environment:**

* **Plugin Version**:
* **Homebridge Version**: <!-- homebridge -V -->
* **Node.js Version**: <!-- node -v -->
* **NPM Version**: <!-- npm -v -->
* **Operating System**: <!-- Raspbian / Ubuntu / Debian / Windows / macOS / Docker / hb-service -->

<!-- Click the "Preview" tab before you submit to ensure the formatting is correct. -->
iklein99 commented 9 months ago

Your shades do not support the "windowShadeLevel" capability like others do, which is why the plugin isn't picking it up. Instead, it supports "switchLevel". I'll work on a fix for this. I'll let you know when it is available to test.

20sixstring commented 9 months ago

Thank you...looking forward to it.

iklein99 commented 9 months ago

@20sixstring , please update the plugin to release 1.5.16 and try it. Let me know if it recognizes and works with your shades.

20sixstring commented 9 months ago

Hi, I tried the new version and it doesn't show my shades. Here is the log:

23/09/2023, 10:51:35] Loaded plugin: homebridge-smartthings-ik@1.5.16 [23/09/2023, 10:51:35] Registering platform 'homebridge-smartthings-ik.HomeBridgeSmartThings' [23/09/2023, 10:51:35] --- [23/09/2023, 10:51:35] Loading 6 platforms... [[23/09/2023, 10:51:35] [Smartthings Plug (IK)] Initializing HomeBridgeSmartThings platform... [23/09/2023, 10:51:35] [Smartthings Plug (IK)] Finished initializing platform: Smartthings Plug (IK) [23/09/2023, 10:51:35] [Smartthings Plug (IK)] Loading accessory from cache: Samsung Q70 Series (65) [23/09/2023, 10:51:35] [Smartthings Plug (IK)] Executed didFinishLaunching callback [23/09/2023, 10:51:35] [Smartthings Plug (IK)] Discovering devices... [23/09/2023, 10:51:36] [Smartthings Plug (IK)] Pushing Bedroom - Shades [23/09/2023, 10:51:36] [Smartthings Plug (IK)] Pushing Kitchen - Patio Door [23/09/2023, 10:51:36] [Smartthings Plug (IK)] Pushing Samsung Q70 Series (65) [23/09/2023, 10:51:36] [Smartthings Plug (IK)] Stored all devices. [23/09/2023, 10:51:36] [Smartthings Plug (IK)] DEVICE DATA: {"deviceId":"04c60dd1-65bf-4be3-b20a-71df4b30b734","name":"c2c-shade","label":"Bedroom - Shades","manufacturerName":"SmartThings","presentationId":"SmartThings-smartthings-c2c-shade","deviceManufacturerCode":"tilt","locationId":"9886494b-6b21-4759-b571-956ef364680f","ownerId":"c0c53ab4-3446-6ad5-0f63-6f7a02013648","roomId":"8544e989-e132-426e-ae96-624e0b5fda5c","components":[{"id":"main","label":"main","capabilities":[{"id":"windowShade","version":1},{"id":"switchLevel","version":1},{"id":"refresh","version":1},{"id":"healthCheck","version":1}],"categories":[{"name":"Blind","categoryType":"manufacturer"}]}],"createTime":"2022-05-17T20:25:05.518Z","profile":{"id":"0ceffb3e-10d3-4123-bb42-2a92c93c6e25"},"viper":{"manufacturerName":"tilt","modelName":"Roller Shade","endpointAppId":"viper_efc1cb20-84ba-11ea-9332-5b85bdd174bc"},"type":"VIPER","restrictionTier":0,"allowed":[]} [23/09/2023, 10:51:36] [Smartthings Plug (IK)] DEVICE DATA: {"deviceId":"042f4605-8262-4cd3-af7b-d806cc7ddbd1","name":"c2c-shade","label":"Kitchen - Patio Door","manufacturerName":"SmartThings","presentationId":"SmartThings-smartthings-c2c-shade","deviceManufacturerCode":"tilt","locationId":"9886494b-6b21-4759-b571-956ef364680f","ownerId":"c0c53ab4-3446-6ad5-0f63-6f7a02013648","roomId":"8544e989-e132-426e-ae96-624e0b5fda5c","components":[{"id":"main","label":"main","capabilities":[{"id":"windowShade","version":1},{"id":"switchLevel","version":1},{"id":"refresh","version":1},{"id":"healthCheck","version":1}],"categories":[{"name":"Blind","categoryType":"manufacturer"}]}],"createTime":"2022-05-17T20:25:05.519Z","profile":{"id":"0ceffb3e-10d3-4123-bb42-2a92c93c6e25"},"viper":{"manufacturerName":"tilt","modelName":"Roller Shade","endpointAppId":"viper_efc1cb20-84ba-11ea-9332-5b85bdd174bc"},"type":"VIPER","restrictionTier":0,"allowed":[]} [23/09/2023, 10:51:36] [Smartthings Plug (IK)] Restoring existing accessory from cache: Samsung Q70 Series (65) [23/09/2023, 10:51:36] [Smartthings Plug (IK)] Creating instance of SwitchService for capabilities switch [23/09/2023, 10:51:36] [Smartthings Plug (IK)] Adding SwitchService to Samsung Q70 Series (65) [23/09/2023, 10:51:36] [Smartthings Plug (IK)] Registered SwitchService for capabilities switch [23/09/2023, 10:51:37] [Smartthings Plug (IK)] Received getSwitchState() event for Samsung Q70 Series (65) [23/09/2023, 10:51:37] [Smartthings Plug (IK)] Samsung Q70 Series (65) is offline

iklein99 commented 9 months ago

@20sixstring , I think I found the issue. Please update to 1.5.17 and try again.

20sixstring commented 9 months ago

Much Appreciated...It's working! It's nice to have my Tilt Rollershades back in HomeKit.

iklein99 commented 9 months ago

And thank you for the kind contribution!

20sixstring commented 3 months ago

Hi, Since you updated the code, my roller shades have been functioning properly. However, I've encountered a recurring issue: whenever I use Alexa or the Tilt app to control the shades, the HomeKit app indicates that the device is in the process of closing or opening but never updates to show the final open or closed status. To resolve this, I need to slightly adjust the openness percentage in the HomeKit app, which then causes the shades to move slightly and finally displays the correct openness percentage. This problem only arises when I control the shades with Alexa or the Tilt app; HomeKit doesn't seem to automatically refresh to display the current status. There seems to be an issue with the polling status feature, currently, I have it set to 20.

20sixstring commented 3 months ago

Additionally, I've noticed that when this issue occurs, the Homebridge accessories correctly display the actual percentage on the web browser under the accessories section. However, the iOS HomeKit app persists in showing the shades as either opening or closing, without reverting to the specific percentage open or closed.