Hello, Home HomeKit (and Siri!) control via homebridge

smartapp_voice
requires_server

(JBrown) #601

When you finish your config should look something like this
{
“bridge”: {
“name”: “Homebridge”,
“username”: “D3:00:00:00:00:10”,
“port”: 51826,
“pin”: “031-45-155”
},
“description”: “JSON API”,
“platforms”: [{
“platform”: “SmartThings”,
“name”: “SmartThings”,
“app_url”: “https://graph-na02-useast1.api.smartthings.com:443/api/smartapps/installations/”,
“app_id”: "b05734ba-7bfa-4711-8bc2-e4aa4faXXXXXX”,
“access_token”: “bd567cdb-3299-4346-9274-361200XXXXXX”,
“polling_seconds”: 3600,
“update_method”: “direct”
}]
}


(JBrown) #602

After you complete plove’s setup inside the Smartthings app you should have a smartapp called JSON complete API and that is what you will use to add your Smartthings devices.


(Neil Oakley) #603

Thanks Jason - so I don’t need to list any accessories?

Also, the MAC address as the username, is that the MAC address of the smarthub?

This is what I currently have, it’s just missing some accessories (the app_id and access-token are dummy numbers):

{
“bridge”: {
“name”: “Homebridge”,
“username”: “CC:22:3D:E3:CE:30”,
“port”: 51826,
“pin”: “031-45-154”
},

"accessories": [

],

"platforms": [
    {
        "platform": "SmartThings",
        "name": "SmartThings",
        "app_url": "https://graph.api.smartthings.com:443/api/smartapps/installations/",
        "app_id": "0684d286-4426-47c4-8382-e761eeb5XXXX",
        "access_token": "5992d6de-0633-41c5-a91b-729116b3XXXX",
    "polling_seconds": 3600,
    "update_method": "direct",
    "direct_port": 8050,
    "api_seconds": 30
    }
]

}

When I then use the JSON smartapp to add devices, it give me a file full of things like this (without any accessories tags):

{“location”:{“latitude”:51.58334724,“longitude”:0.50953396,“mode”:“Home”,“name”:“Home”,“temperature_scale”:“C”,“zip_code”:“00000”,“hubIP”:“192.168.0.35”,“smartapp_version”:“0.5.5”},“deviceList”:

{“name”:“Study Light”,“basename”:“Study Light”,“deviceid”:“68a27c23-124e-4c01-8475-3b917596a50a”,“status”:“ACTIVE”,“manufacturerName”:null,“modelName”:null,“lastTime”:“2017-12-05T19:17:19+0000”,“capabilities”:{“Switch”:1,“Switch Level”:1},“commands”:{“on”:[],“off”:[],“setLevel”:[“NUMBER”,“NUMBER”],“register”:[]},“attributes”:{“switch”:“off”,“level”:100.0}}


(Neil Oakley) #604

THANK YOU THANK YOU THANK YOU

This community is amazing. I finally got this working on a windows server. The port 8000 was being used for something else so I just added in a line in the config.json to use a different port. I’ve never had any coding or experience with python, node, npm, git or linux before this week and it’s only through peoples willingness to help and well documented solutions that I figured it all out.

I had to resolve a problem that the Home app on iOS didn’t see any accessories so i deleted the Accessories and Persist folders in .Homebridge and restarted the server. BINGO. Everything now works perfectly.

I’m so happy and grateful for everyones help.


(John) #605

For those who may be interested in HomeKit and Homebridge, I submitted a plugin https://www.npmjs.com/package/homebridge-cmd4
that lets you virtualize almost all devices in HomeKit so you can try HomeKit without having any devices at all. I only had a light myself and wanted to see what else HomeKit can do.
May I also suggest you try the Eve app, instead of the HomeKit App as it is farther along than HomeKit is.
John


(JBrown) #606

You may want to set static ip addresses for your SmartThings hub, computer and Apple TV. So you don’t have any problems in the future.


(Jg506) #607

Why not use the ST app? Best feature of HomeKit IMO is fast access to (9) favorite devices from iOS control center, and Siri integration, for anything else I use native ST app. Event processing using Smartthings-Homebridge lags so much it is pointless to do any ST device monitoring or event driven automation using HomeKit


(Paul Lovelace) #609

I’d like to second jg506’s comment on using ST as the main controller. At this time the Smartthings app is far better than any HomeKit app I’ve been able to find. I use the plugin for Siri control, favoriting and platform convergence. It allows a HomeKit scene to activate Smartthings devices, Native HomeKit devices and other platforms with home bridge plugins.
Hats off to everyone in the home bridge community who built out the platform that makes it all work.


( Reddad) #610

(Ryan Murphy) #611

Hi everyone,

My Homebridge appears to be running properly on my Docker, but my Home app doesn’t seem to pull in Homebridge.

Oddly, after hours and hours of trying and fudging with things a few days ago, my Home app was able to pull in Homebridge and the devices I’ve pushed into the JSON but, when my Synology automatically updated itself and restarted everything, everything lost connection. I was hoping that removing Homebridge from my Home app and trying to re-discover it would work but the Home app won’t recognize it.

Here’s what the Homebridge logs show after it starts up:

[12/21/2017, 6:06:27 AM] Loaded config.json with 0 accessories and 1 platforms.
[12/21/2017, 6:06:27 AM] Loading 1 platforms...
[12/21/2017, 6:06:27 AM] [SmartThings] Initializing homebridge-smartthings.SmartThings platform...
[12/21/2017, 6:06:27 AM] [SmartThings] Fetching Smart Things devices.
[12/21/2017, 6:06:33 AM] [SmartThings] Device Added - Group garage_doors, Name Garage Door, ID abcd
[12/21/2017, 6:06:33 AM] [SmartThings] Device Added - Group switch, Name Projector, ID abcd
[12/21/2017, 6:06:33 AM] [SmartThings] Device Added - Group locks, Name Simulated Front Door, ID abcd
[12/21/2017, 6:06:33 AM] [SmartThings] Unknown Capabilities: ["Relay Switch","Health Check"]
[12/21/2017, 6:06:33 AM] [SmartThings] Initializing platform accessory 'Garage Door'...
[12/21/2017, 6:06:33 AM] [SmartThings] Initializing platform accessory 'Projector'...
[12/21/2017, 6:06:33 AM] [SmartThings] Initializing platform accessory 'Simulated Front Door'...
Scan this code with your HomeKit App on your iOS device to pair with Homebridge:
[12/21/2017, 6:06:33 AM] Homebridge is running on port 51826.
[12/21/2017, 6:06:33 AM] [SmartThings] Direct Connect Is Listening On 169.254.178.74:8000

Here’s my config.json:

{
    "description": "JSON API",
    "platforms": [
        {
            "platform": "homebridge-smartthings.SmartThings",
            "name": "SmartThings",
            "app_url": "https://graph-na02-useast1.api.smartthings.com:443/api/smartapps/installations/",
            "app_id": "d8c32a52-d5bd-4053-a5ef-1234abcdef",
            "access_token": "fcd3b90e-8c9b-4aff-b0b4-123456abcdef"
        }
    ],
    "bridge": {
        "name": "Homebridge",
        "username": "AA:BB:CC:DD:EE:FF",
        "port": 51826,
        "pin": "123-45-678"
    }
}

Here’s what I’m pushing into package.json:

{
	"name": "homebridge-smartthings",
	"description": "HomeBridge plugin for Smart Things",
	"version": "0.5.1",
	"repository": {
		"type": "git",
		"url": "git://github.com/pdlove/homebridge-smartthings.git"
	},
	"license": "ISC",
	"preferGlobal": true,
	"keywords": [
		"homebridge-plugin",
		"sensibo"
	],
	"engines": {
		"node": ">=0.12.0",
		"homebridge": ">=0.3.1"
	},
	"dependencies": {
		"pubnub": ">=4.4.0"
	}
}

I’ve tried playing with config.json (using the additional lines specific to IP, port, etc.) but no variation seems to work. I’m also on the same home network via wires/wireless connectivity, of course. And my JSON SmartApp seems to be configured correctly (as it pulls in whichever devices I’ve pushed into it) with all devices in the “Most Devices” section (aka not double entered).

I’m honestly stumped about why my Home app isn’t seeing Homebridge consistently (or even why it worked that one time). I feel like I’ve done all the right steps.

Has anyone run into this issue before? I couldn’t seem to find anyone else that had reported and gotten it fixed. Any suggestions for where to look?


(Jg506) #612

Since iOS 11 there is some sort for caching that prevents rediscovering a homebridge bridge previously discovered. The way to overcome this issue is to discover using IOS 10 device or to modify the username inside config.json (even one digit change will suffice).


(Ryan Murphy) #613

Sadly, I don’t have any iOS 10 devices so that’s not an option. And I thought I tried using another username value in config.json but I don’t believe it worked (though it may have been what allowed it to get recognized earlier). I’ll give it another try tonight when I get home.

If you (or anyone) have any other ideas/thoughts, I’m excited to try them! :slight_smile:


(JBrown) #614

Try your config like this.
{
“bridge”: {
“name”: “Homebridge”,
“username”: “AA:BB:CC:DD:EE:FF”,
“port”: 51826,
“pin”: “123-45-678”
},
“description”: “JSON API”,
“platforms”: [
{
“platform”: “homebridge-smartthings.SmartThings”,
“name”: “SmartThings”,
“app_url”: “https://graph-na02-useast1.api.smartthings.com:443/api/smartapps/installations/”,
“app_id”: “d8c32a52-d5bd-4053-a5ef-1234abcdef”,
“access_token”: “fcd3b90e-8c9b-4aff-b0b4-123456abcdef”
}
]

}
[/quote]


(Ryan Murphy) #615

@jg506, no go with trying a different user name value. I even deleted the accessories and persist folders to be safe.
@Jason_Brown, no go with trying your JSON. FYI copying from SmartThings puts in the rich text quote rather than the standard one so I had to swap that out in order for the container to properly run.

I’m not sure what else to try here… :confused:


#616

Ninja search skills are failing me.

How does one go about adding additional devices after initial successful installation. I tried last night and the only way I could get it to work was to remove homebridge from the Home app, stop hombridge (rpi), add new devices, include new device in the json api/app interface, restart homebridge and then add back to Homekit/Home app. Of course, this requires reconfiguring the names/scenes/etc.

Is there an easier/quicker way?

Thanks


(Huy Nguyen) #617

Whenever I add a new device is simply add the app in the JSON ST smartapp and the restart homebridge. The launch the home app and the new device appears in my default room and I move it from there. Haven’t had to redo HomeKit every time


#618

great. thanks for the quick reply. i tried that last night and didn’t immediately see change. I’ll give it another go this evening.


(Jg506) #619

Try changing bridge name as well. I remember seeing few threads about this problem in homebridge main git repo page (nfarina’s repo). Issue is not related to smartthings platform integration so you can utilize the larger community there.


(Jg506) #620

Key is to restart homebridge after exposing new device in the smartapp. No need to remove and re-add the bridge in home app. Process should be exactly what @huydnguyen said


(pascal) #621

*** update: Closing issue, did not realize decides was a 3rd party app. Homebridge works with apple Home app to add home kit. Issue is when adding home kit from devices app. Devices is by LinkDesk. Closing issue