[RELEASE] Homebridge SmartThings v2.0

[RELEASE] Homebridge SmartThings v2.0

I’m happy to release the new version of my homebridge-smartthings-tonesto7

Changes

Plugin

  • Completely rewrote the entire plugin using modern javascript structure.

  • The code is now much cleaner, easier to update/maintain, and easier for others to follow.

  • This translates into a faster/leaner and way more stable plugin than previous versions.

  • The plugin now uses the Homebridge Dynamic platform API, meaning it no longer requires a restart of the Homebridge service for device changes to occur.

  • The plugin now utilizes the device cache on service restart to prevent losing all of your devices when the plugin fails to start for an extended period of time.

  • It will now remove devices no longer selected under SmartThings.

  • Introduced an all-new logging system to provide more insight into issues and status, as well as write them to a file.

  • I used all of the issues from my existing plugin to repair this new version.

  • Many, many other bug fixes for devices, commands, and many other items.

  • Important NOTICE:
    Due to the changes in the plugin API you can not directly update the plugin, you will need to add as a new accessory and setup your devices/automations/scenes again.
    On a positive note, you can use the same SmartApp instance though as long as you update to the latest code.

SmartApp

  • Reworked and cleaned up the UI so it’s now more organized and easier to follow.
  • Added new capability filter options.
  • Optimized the command/event streaming system to perform faster and more reliably.
  • Added duplicate device detection cleanups so Homekit doesn’t try to create duplicate devices and throw an error.
  • Many, many other bug fixes and cleanups.

Instructions

Issues:

Please report any issues here: Issues · tonesto7/homebridge-smartthings · GitHub

20 Likes

Awesome… I just upgraded. It took only 5 min (without re-adding devices). Also, I really like the new app layout.

…let the testing begin!

Thank you for the great upgrade!

2 Likes

v1 wasn’t working for me properly at all anymore.
v2 runs as expected instantly, thank you for all the hard work!!

1 Like

I’m using a RPi for a different node proxy integration. Can I also install this node proxy on the same RPi if it’s in a different directory?

Stupid question. I have this set up and SHM commands from Homebridge to SmartThings works as expected (same behavior as v1), but if I do it from the SmartThings side, I see an event in the IDE that it says it is setting the status, but it never shows up on the Homekit side (no associated event). So it seems it is only happening one way

HB > ST:

HB: 7:21:39 AM][SmartThings-v2]NOTICE: Sending Device Command: stay | Value: Nothing | DeviceID: (alarmSystemStatus_...) | SendToLocalHub: (true)
ST: 7:21:39 AM: debug Sending LOCATION Event (alarm system status | ALARMSYSTEMSTATUS: stay) to Homebridge at (x.x.x.x:xxxx)

ST > HB:

ST: 7:24:32 AM: debug Sending LOCATION Event (alarm system status | ALARMSYSTEMSTATUS: off) to Homebridge at (x.x.x.x:xxxx)
HB: Nada

Just an FYI, I am not experiencing that. It syncs fine for me.

1 Like

Maybe I need to test this more. Can you open up and issue on GitHub for this so I don’t forget it

:+1: you got it!

https://github.com/tonesto7/homebridge-smartthings-v2/issues/9

1 Like

Tried to upgrade by v1 install (which has always worked flawlessly by the way) to this tonight and unfortunately it’s broken everything.

Homebridge keeps rebooting, the only thing in the error log I can catch is this

[12/8/2019, 9:54:59 PM][SmartThings-v2]ERROR: uncaughtException: Cannot add a bridged Accessory with the same UUID as another bridged Accessory: 38034c10-1bee-4ac6-8691-ca67ccbbe199

I’ve deleted the cachedAccessories file in .homebridge/Accessories but homebridge still doesn’t run properly. All I can get is one switch to appear from SmartThings.

Oh, also this…

[12/8/2019, 10:00:32 PM] TypeError: Cannot read property 'info' of undefined
    at ST_Platform.configureAccessory (/usr/local/lib/node_modules/homebridge-smartthings-v2/src/ST_Platform.js:204:18)
    at Server._configCachedPlatformAccessories (/usr/local/lib/node_modules/homebridge/lib/server.js:386:24)
    at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:93:8)
    at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:59:10)
    at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
    at Module._compile (internal/modules/cjs/loader.js:956:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1025:10)
    at internal/main/run_main_module.js:17:11

I’ve stated clearly that you can not directly update your v1 plugin to version 2.0.

You will need to make sure to update the config in the old v1 location and remove the accessories and persist folder from that folder as well.
You will also need to remove the bridge from the Home app on your phone and reconnect the new v2 bridge

Hi Anthony,

I did think i’d done all that to be honest - for some reason it’s working fine now anyway - really strange. I left it for a while and it worked ok. I had removed everything from version 1 though, including even the SmartApp and tried to set everything up from scratch.

Anyway it’s working now and it’s great being able to add virtual switches without needing to reboot Homebridge! Thanks for the hardwork.

Hi all, I’m pretty new with the smartthings environment, and I mainly bought one because I wanted to have my Zigbee line in thermostats hooked to my Homebridge setup. To my pleasure, this V2 integration just happens the day I received my V3 Hub.

So I follow all the instruction but I get an error when I launch Homebridge. I was about to log an issue on GitHub when I saw that i need to have a device handler, saved and published, but I didn’t see any device handler that needed to be added in the procedures.

Can u guys help me? Thx

I’ve only had my RaspPi a few days and this was my first project as I’m trying to learn some new things. Took some failed attempts but was fairly easy after I followed the directions for my setup. Still don’t know what I’m doing but I’m excited my garage door opener works with Home-Kit now! Thanks!

1 Like

Hello all, this is the error i get, maybe you can help me with that!

Thank you!!!

For those who are migrating from v1. What did you delete the computer (i.e the old plugin)? And what did you delete on the home app?

  • I removed the v1 Homebridge in Apple home app
  • Deleted v1 SmartApp
  • installed v2 Homebridge Plugin
  • installed v2 SmartApp
  • updated config.json
  • added Homebridge v2 to apple home app
    Done!
1 Like

Let me amend this list some:

  • I removed the v1 Homebridge in Apple home app
  • update the v1 smartapp to v2 SmartApp
  • installed v2 Homebridge Plugin
  • updated config.json
  • added Homebridge v2 to apple home app
2 Likes

Just wanted to say thank you for fixing this. With the addition of the Ring Homebridge plugin, I can now control my Ring Alarm from SmartThings.

1 Like

Do I have to use apple tv or ipad as a bridge for control from wan ?