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

What do you need to get locks and shades working? #4

Closed veonua closed 1 year ago

veonua commented 2 years ago

I want to help you with these types of devices, please let me know what is needed

iklein99 commented 2 years ago

If you want, I can add some capabilities for locks and shades, but you'd have to do the testing for me. Can you commit to doing that?

veonua commented 2 years ago

yes sure, just let me know what to test. also you can create a virtual devices

On Mon, 13 Jun 2022 at 00:26, iklein99 @.***> wrote:

If you want, I can add some capabilities for locks and shades, but you'd have to do the testing for me. Can you commit to doing that?

— Reply to this email directly, view it on GitHub https://github.com/iklein99/homebridge-smartthings/issues/4#issuecomment-1153308453, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALYALV6KFZYIQYIJFCJRZTVOZPZ5ANCNFSM5YSAFOKQ . You are receiving this because you authored the thread.Message ID: @.***>

iklein99 commented 2 years ago

I added support for a lock. Would you be able to test it for me? I created a beta version for you to test. To install this, you need to get to a command line and use this command:

sudo npm install -g homebridge-smartthings-ik@beta

After you run this, restart homebridge and make sure the version of the plugin is 1.1.4-beta.0.

Please let me now how you make out. I am going to add the shade next.

veonua commented 2 years ago

hmm, installed the plug-in via hombridge UI on my Raspberry Pi, and it seems like there is no npm only pnpm do you know if it's possible to install beta via hombridge UI?

iklein99 commented 2 years ago

npm is there somehere. homebridge uses it to install the plugins. You may have to look around. Otherwise, once I'm able to I'll just publish the plugin normally and you can upgrade, but I can't right now.

veonua commented 2 years ago

lock works! ... it seems the plugin doesn't get device updates from the ST, so if I turn on lights or open the lock manually the device will stuck in the homekit. it tries to open opened lock and the operation never finishes.

iklein99 commented 2 years ago

The issue is that Smartthings doesn't tell hoebridge when something changes, so it may show a bad state. The same happens with a garage door. But if you click on the device in Smartthings, it should refresh appropriately. Its about the best I can do with smartthings.

veonua commented 2 years ago

can you do

https://developer-preview.smartthings.com/docs/connected-services/subscriptions/

iklein99 commented 2 years ago

Subscriptions require an endpoint with an SSL certificate and would require each user to set that up. A little too complex I think.

iklein99 commented 2 years ago

Version 1.1.4 of the plugin now supports locks.

veonua commented 2 years ago

add shades please

iklein99 commented 2 years ago

Run this command:

curl -H "Authorization: Bearer: " https://api.smartthings.com/v1/devices > devices.json

and send me the output. i need to see what your window shade looks like. Replace with your actual token which you used to configure the plugin. email me the results to iklein99@comcast.net.

iklein99 commented 2 years ago

Please install homebridge-smartthings-ik@1.1.7-beta.0 and let me know if that works for your window shade / blinds. If it doesn't, please clear out your logs, run homebridge in debug mode and send me the complete logs.

Please let me know if your shade works.

veonua commented 2 years ago

could you please tell more how do I run in the debug mode

I can see

[15/06/2022, 12:37:37] [Smartthings(new)] onGet() FAILED for Living room Curtain. Comm error.
[15/06/2022, 12:37:37] [Smartthings(new)] onGet() FAILED for Right shade. Comm error.
[15/06/2022, 12:37:37] [Smartthings(new)] onGet() FAILED for Curtains. Comm error.
[15/06/2022, 12:37:37] [Smartthings(new)] onGet() FAILED for Left shade. Comm error.
[15/06/2022, 12:37:37] [Smartthings(new)] onGet() FAILED for Central shade. Comm error.
[15/06/2022, 12:37:37] [Smartthings(new)] onGet() FAILED for Second bedroom curtains. Comm error.

in my logs

iklein99 commented 2 years ago

Click on the ellipsis (three dots in upper right corner) and click on Homebridge Settings.

Then toggle on debug mode from there:

On Jun 18, 2022, at 6:59 AM, Andrew Me @.***> wrote:

could you please tell more how do I run in the debug mode

I can see

[15/06/2022, 12:37:37] [Smartthings(new)] onGet() FAILED for Living room Curtain. Comm error. [15/06/2022, 12:37:37] [Smartthings(new)] onGet() FAILED for Right shade. Comm error. [15/06/2022, 12:37:37] [Smartthings(new)] onGet() FAILED for Curtains. Comm error. [15/06/2022, 12:37:37] [Smartthings(new)] onGet() FAILED for Left shade. Comm error. [15/06/2022, 12:37:37] [Smartthings(new)] onGet() FAILED for Central shade. Comm error. [15/06/2022, 12:37:37] [Smartthings(new)] onGet() FAILED for Second bedroom curtains. Comm error. in my logs

— Reply to this email directly, view it on GitHub https://github.com/iklein99/homebridge-smartthings/issues/4#issuecomment-1159444415, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABG55EVQHCJEI6YW4INBXDLVPWTZFANCNFSM5YSAFOKQ. You are receiving this because you commented.

robjampar commented 1 year ago

how about adding a configurable polling request that runs every 30 seconds to resync a device state?

robjampar commented 1 year ago

im running into the same problem (i want to check that the back door lock is locked every night, but i can't do that if it has been locked manually and therefore the plugin still says its unlocked!)

robjampar commented 1 year ago

something like this

https://github.com/iklein99/homebridge-smartthings/pull/13

(untested)

iklein99 commented 1 year ago

This is a good idea. I'll look at doing that. Thanks for the recommendation.

iklein99 commented 1 year ago

Polling for locks has been added. Closing this item.

robjampar commented 1 year ago

nice!

i've tested this and it needs a minor update, the target state and current state both need to be updated when it syncs

https://github.com/iklein99/homebridge-smartthings/pull/14

robjampar commented 1 year ago

also this pattern probably could be used for other device types as well