[RELEASE] Homebridge SmartThings v2.0

I have been working on getting my Samsung TVs (Q60R) to just simply have “on” and “off” functions in the Home app iOS for over 10 hours today. I’ve installed Homebridge on my RPi, got it up and working just fine, and started with trying https://github.com/tavicu/homebridge-samsung-tizen and got it set up, but I can’t seem to get the “allow/deny” popup to show on my TV. Doesn’t seem to matter what I do/change, it never shows up. Logs of that below:

[8/22/2020, 17:50:15] [Basement Console TV] [DEBUG] TV is offline [8/22/2020, 17:50:17] [Basement Console TV] [DEBUG] TV is offline [8/22/2020, 17:50:18] [Basement Console TV] [DEBUG] TV is offline [8/22/2020, 17:50:18] [Basement Console TV] Failed to pair! Make sure TV is online and you click "Allow" on the popup [8/22/2020, 17:50:18] [Basement Console TV] [DEBUG] PairFailedError: Failed to pair! Make sure TV is online and you click "Allow" on the popup at WebSocketSecure.pair (/usr/lib/node_modules/homebridge-samsung-tizen/lib/methods/wss.js:34:19) at processTicksAndRejections (internal/process/task_queues.js:97:5)

[Basement Console TV] Failed to open socket {"event":"ms.channel.timeOut"}

However, my when I connect my iPhone to my TV, it shows up immediately asking me to allow/deny the connection. I have the IP Remote enabled on the TV, too if that matters. What’s also weird is that when I use this, it does show up in the Home app, but it always says “No Response”.

I then tried @tonesto7’s SmartThings app. I’ve followed all the instructions and created the app in the SmartThings IDE/MySmartApps, made the changes in the SmartThings Classic app, etc.

I can see SmartThings working in Homebridge:

[8/22/2020, 10:01:10 pm] [SmartThings-v2] INFO: INFO: Your plugin version is up-to-date [8/22/2020, 10:01:10 pm] [SmartThings-v2] NOTICE: Sending Plugin Status to SmartThings | UpdateAvailable: false | newVersion: 2.3.8 [8/22/2020, 10:01:12 pm] [SmartThings-v2] NOTICE: Temperature Unit is Now: (F) [8/22/2020, 10:01:12 pm] [SmartThings-v2] WARN: Devices to Remove: (0) [] [8/22/2020, 10:01:12 pm] [SmartThings-v2] INFO: Devices to Update: (1) [8/22/2020, 10:01:12 pm] [SmartThings-v2] GOOD: Devices to Create: (0) [] [8/22/2020, 10:01:12 pm] [SmartThings-v2] WARN: Devices to Remove: (0) [] [8/22/2020, 10:01:12 pm] [SmartThings-v2] INFO: Devices to Update: (1) [8/22/2020, 10:01:12 pm] [SmartThings-v2] GOOD: Devices to Create: (0) [] [8/22/2020, 10:01:12 pm] [SmartThings-v2] ALERT: Total Initialization Time: (5 seconds) [8/22/2020, 10:01:12 pm] [SmartThings-v2] NOTICE: Unknown Capabilities: ["Tv Channel","Media Input Source","Media Playback","custom.picturemode","custom.error","custom.soundmode","custom.accessibility","custom.launchapp","custom.recording","custom.tvsearch","samsungtv.firmwareVersion","samsungtv.supportsPowerOnByOcf","Execute","Ocf","Media Track Control"] [8/22/2020, 10:01:12 pm] [SmartThings-v2] INFO: SmartThings DeviceCache Size: (1) [8/22/2020, 10:01:12 pm] [SmartThings-v2] INFO: WebServer Initiated... [8/22/2020, 10:01:12 pm] [SmartThings-v2] INFO: Sending StartDirect Request to SmartThings | SendToLocalHub: (false) [8/22/2020, 10:01:12 pm] [SmartThings-v2] INFO: Direct Connect Active | Listening at 192.168.1.188:8000

But, when I try to add any accessories to the Homebridge dashboard, they don’t do anything. And maybe I’m doing it wrong, but I just simply want to on/off switches. None of these accessories are seen in the Home app, either. Even though it seems like everything is setup okay, the Home app won’t recognize or action on any of the buttons/switches.

Any ideas? I feel like I’m so close to getting this.

I got it working! Not exactly sure what I did but a combination of resetting everything, deleting accessories and persist folders, along with resetting Homebridge, removings/re-adding Homebridge from homekit…I managed to get the two TVs to have on/off switches.

Is there a way to add a “change input” command or a “change volume/mute” command? When I tried to add these Devices again in SmartThings, it obviously complained about duplicate devices.

@tonesto7 I know you’re busy with everything but just saw the latest update and have an issue I’ve seen with your updates before. I got through the process of updating, it finished and tells me success but yet homebridge still tells me your plug-in needs updating afterwards. I’ve tried updating three times now and every time it’s told me it successfully updated but still shows an available update. Any advice?

Here’s the entire process.

Also curious if you have any way of adding scenes to homebridge similar to when you had routines.

I’m in the process of migrating from a v1 to v3 hub. I don’t have all the devices moved over, but would like to test homebridge on the new hub. Can I simply add the new hub platform snippet to the config file, or are additional steps needed?

Just follow the instructions here to set up Homebridge.

Use the community app installer for the Smartapp. (I think you still have to enable oauth in the ide?!).

The config for the SmartThings Plugin is in the smartapp. If you use the Homebridge GUI, you can actually just copy/paste the config data from the Smartapp into the plugin configuration.

Sorry I wasn’t clear. I want to add a second hub to my homebridge location in addition to the old hub, which I’ve has running on the Pi image pretty
much since it came out. I’m assuming I just add another platform section to the config file, correct?

Hi! I can not find the Homebridge SmartApp in the SmartThings Classic App. Is it still available, and where should I look?

Please follow the instructions/steps to install Homebridge v2 here:

1 Like

Hm…I never tried that but it will probably work. I don’t know if you may need to have a different name for the 2nd platform and if thie is in the code smartapp (where you could probably change it?) … good luck!

1 Like

The app_id and access_token appear to be unique across each platform config. Hopefully those serve to uniquely link an instance of the smartapp to a particular hub.

I’m away from that location today, but can experiment tomorrow and report back.

I put the config for the second hub in the config.json, and, after restarting homebridge, all the accessories from the second hub showed up fine. Experiment successful!

2 Likes

Well, I spoke too soon. I had a power outage and the Homebridge server rebooted; after that, it failed to start up with the message:

[9/4/2020, 14:13:57] The dynamic platform SmartThings-v2 from the plugin homebridge smartthings seems to be configured multiple times in your config.json. This behaviour was deprecated in homebridge v1.0.0 and will be removed in v2.0.0!

Later on in the log, there were multiple errors of the type:

Error: listen EADDRINUSE: address already in use :::8000

So, despite the initial success, it appears you cannot reliably have two separate SmartThings hubs in one Homebridge instance.

@tonesto7 or anyone else,

Can someone assist with the errors I’m getting trying to setup the Smartthings plugin with Homebridge. No devices in Homekit, but it appears as if it’s reading the states of the devices slowly in the logs. Thanks in advance:

I just recently installed the SmartThings app by following the directions of setting up the SmartApp in IDE, configuring the devices within the SmartApp, and installing the SmartThings plugin, but after rebooting my Homebridge I’m not getting any devices in Homekit. I’ve pasted an output of my log below and it looks like there’s an error of some sort. If anyone can help it would be appreciated. I have about 100 devices in SmartThings that I was trying to add:

9/10/2020, 4:07:23 pm] [SmartThings-v2] INFO: Homebridge Version: 2.6

[9/10/2020, 4:07:23 pm] [SmartThings-v2] INFO: SmartThings-v2 Plugin Version: 2.3.8

[9/10/2020, 4:07:23 pm] [SmartThings-v2] INFO: Checking Package Version for Updates…

[9/10/2020, 16:07:23] [BraviaPlatform] Restoring US Master TV from HomeKit

[9/10/2020, 16:07:23] [BraviaPlatform] Restoring DS Living TV from HomeKit

[9/10/2020, 16:07:23] [BraviaPlatform] Restoring US Living TV from HomeKit

[9/10/2020, 4:07:23 pm] [SmartThings-v2] INFO: Fetching SmartThings-v2 Devices. NOTICE: This may take a moment if you have a large number of device data is being loaded!

[9/10/2020, 4:07:23 pm] [SmartThings-v2] GOOD: Refreshing All Device Data | Source: (First Launch)

[9/10/2020, 16:07:23] Homebridge is running on port xxxxx.

[9/10/2020, 16:07:28] [Config] Starting terminal session

[9/10/2020, 4:07:31 pm] [SmartThings-v2] INFO: INFO: Your plugin version is up-to-date

[9/10/2020, 4:07:31 pm] [SmartThings-v2] NOTICE: Sending Plugin Status to SmartThings | UpdateAvailable: false | newVersion: 2.3.8

[9/10/2020, 4:07:33 pm] [SmartThings-v2] ERROR: getDevices Error: undefined | Message: timeout of 10000ms exceeded

[9/10/2020, 4:07:33 pm] [SmartThings-v2] ALERT: Total Initialization Time: (11 seconds)

[9/10/2020, 4:07:33 pm] [SmartThings-v2] NOTICE: Unknown Capabilities: []

[9/10/2020, 4:07:33 pm] [SmartThings-v2] INFO: SmartThings DeviceCache Size: (0)

[9/10/2020, 4:07:33 pm] [SmartThings-v2] INFO: WebServer Initiated…

[9/10/2020, 4:07:33 pm] [SmartThings-v2] INFO: Sending StartDirect Request to SmartThings | SendToLocalHub: (false)

[9/10/2020, 4:07:34 pm] [SmartThings-v2] INFO: Direct Connect Active | Listening at xxx.xxx.xxx.xxx:xxxx

[9/10/2020, 4:07:34 pm] [SmartThings-v2] INFO: SmartThings-v2 Hub Communication Established

[9/10/2020, 4:08:13 pm] [SmartThings-v2] INFO: [Device Event]: (xxxxxxxx’s Room Button) [TEMPERATURE] is 69

[9/10/2020, 4:08:41 pm] [SmartThings-v2] INFO: [Device Event]: (xxxxxx’s Room Button) [TEMPERATURE] is 68

[9/10/2020, 16:08:42] [Config] Terminal session ended.

[9/10/2020, 16:09:20] [Config] Starting terminal session

Disregard. I was able to get it working. I ended up doing the following:

  1. Uninstall Homebridge plug-in and reboot
  2. Delete SmartApp from SmartThings App
  3. Add SmartApp from SmartThings App
  4. Install Homebridge plug-in, configure settings, and reboot

When I re-added the SmartApp in SmartThings, I got a completely new AppID and AppToken from the config. I guess when I first installed the SmartApp those 2 fields were incorrect in the config file in the App.

Anyway, hope this helps someone else.

2 Likes

Anyone running homebridge on a dietpi install?

I appreciate all the effort that went into this, but it not work for me. Two problems compared to the original homebridge that I’ve been using for a while:

  • While the iOS Home app worked fine, on my Macs I either got “No Response” for all of my non-Homekit devices or a kind-of working, but out of sync arrangement of devices
  • Remote access over the internet always yielded “No Response” for all of my non-Homekit devices

I tried all manner of attempts to reset the network, reboot routers, etc., but nothing worked. Finally I reverted the Mac Mini that hosts homebridge back to a previous state with the original homebridge package, setup the old json complete api app in SmartThings, and all is good again except for several hours wasted.

I think this is a Homebridge thing and not the ST plugin. I have had issues where the Home app on my phone is correct and the one on my MAC and my Wife’s phone shows the same devices as unresponsive. It happened just now so I restarted Homebidge and then restarted the Home app on my MAC. Now all is in sync. Apple have been doing a lot of updates that impact Homekit recently in iOS 13.7 and now iOS 14. The iPAD app look quite different to when I last looked.

After installing via the repository and publishing, I’m unable to find homebridge v2 under smart apps and my apps in the smartthings classic app. Is this release no longer installable because of the transition happening?

Edit : please disregard. I had published on another family members account and it did not show up to add on my app. Using their account in the app it showed up fine. Sorry!

Hey @tonesto7 I just updated my Homebridge to your latest by removing v2 and replacing with the approved version – works great. I still can’t get the service install working, but that’s not a big deal. My main question is are you working on a version that will work with the new ST ecosystem after they shut down the Groovy API? I am trying to limit my dependence on Groovy which is why I am asking. I’m jamming hard on a HousePanel version that will work with the new API and a user provided Grok login… should be okay. Are you considering something similar? Would be cool to compare notes.