Big thanks for @Areson for his help/motivation in rewriting this.Another shout out to @nh.schotfam for your help on the optimizations for hubitat.
I also wanted to mention the following projects I referenced for inspiration for a few minor items and fixes:
direct_port
setting and defaults to 8000
.direct_ip
which is useful if you have multiple addresses.When properly setup, you should see something like this in your Homebridge startup immediately after the PIN:
[11/25/2019, 4:44:46 PM] [Hubitat-v2] Devices to Remove: (0) []
[11/25/2019, 4:44:46 PM] [Hubitat-v2] Devices to Update: (40)
[11/25/2019, 4:44:46 PM] [Hubitat-v2] Devices to Create: (0) []
[11/25/2019, 4:44:46 PM] [Hubitat-v2] Total Initialization Time: (2 seconds)
[11/25/2019, 4:44:46 PM] [Hubitat-v2] Unknown Capabilities: ["Power Source"]
[11/25/2019, 4:44:46 PM] [Hubitat-v2] Hubitat DeviceCache Size: (40)
[11/25/2019, 4:44:46 PM] [Hubitat-v2] WebServer Initiated...
[11/25/2019, 4:44:46 PM] [Hubitat-v2] Sending StartDirect Request to Hubitat | SendToLocalHub: (false)
[11/25/2019, 4:44:46 PM] [Hubitat-v2] Direct Connect Enabled and Listening on 10.0.0.163:8000
Installation comes in two parts:
Apps Code
in left navigation panelNew App
on the top right of pageImport
button:
https://raw.githubusercontent.com/tonesto7/homebridge-hubitat-tonesto7/master/apps/homebridge-v2.groovy
Import
button
OK
on the confirmation promptSave
and wait for the spining wheel to disappear and the page refreshesOAUTH
button:
Enable OAuth in App
Update
at the bottom.In the Hubitat UI, click on Apps
in the left navigation panel and click Add User App
.
Select Homebridge v2
from the choices on the list.
Configuring the App:
In Define Device Types
there are 8 inputs that can be used to force a device to be discovered as a specific type in HomeKit.NOTE: Do not select the same device in more that one input. If you select a device here, do not select that same device in the other device inputs on the previous page.
For any other devices you would like to add that weren't added in the previous step, just tap on the input next to an appropriate device group and then select each device you would like to use. (The same devices can be selected in any of the Sensor, Switch, Other inputs)
If you select the same device in multiple categories, it will only be shown once in HomeKit. You can safely check them all in all groups, aside from the NOTICE above.
Tap Done
Tap Done
You are finished with the App configuration!
NOTICE: I highly recommend using homebridge-config-ui-x to manage your homebridge instance, plugin and configs. This will allow you to use the web based form to configure this plugin.
npm i -g homebridge
(For Homebridge Install: Homebridge Instructions)npm i -g homebridge-hubitat-tonesto7
{
"platform": "Hubitat-v2",
"name": "Hubitat-v2",
"app_url_local": "http://10.0.0.40/apps/api/",
"app_url_cloud": "https://cloud.hubitat.com/api/561d981e-f986-4f7f-941d-5d43d1d0e0e1/apps/",
"app_id": 436,
"app_platform": "Hubitat",
"use_cloud": true,
"access_token": "1888d2bc-7792-1114-9f32-e4724e388a26",
"communityUserName": "tonesto7",
"direct_ip": "10.0.0.15",
"direct_port": 8000,
"temperature_unit": "F",
"validateTokenId": false,
"adaptive_lighting": true,
"adaptive_lighting_offset": 0,
"excluded_capabilities": {
"HUBITAT-DEVICE-ID-1": [
"Switch",
"Temperature Measurement"
]
},
"logConfig": {
"debug": false,
"showChanges": true
}
}
platform
& name
Required
This information is used by homebridge to identify the plugin and should be the settings above.
app_url_local
& app_url_cloud
& app_id
& access_token
Required
NOTICE: The app_url's in the example will be different for you.
To get this information, open the installed Hubitat Homebridge V2 App the Hubitat Web UI, and tap on View Configuration Data for Homebridge
use_cloud
Required | Default: false
This will enable the plugin to communicate with the hubitat app via the cloud url. (Mostly useful for troubleshooting local communication issues via ports)
communityUserName
Optional | Default: ''
Only needed when you are having issues with the plugin and you want me to be able to identify your reported exception errors.
direct_ip
Optional | Default: 'First available IP on your computer'
Most installations won't need this, but if for any reason it can't identify your ip address correctly, use this setting to force the IP presented to Hubitat for the hub to send to.
direct_port
Optional | Default: 8000
This is the port that the homebridge-hubitat-tonesto7
plugin will listen on for traffic from your hub. Make sure your firewall allows incoming traffic on this port from your Hubitat hub IP address to your HomeBridge instance.
temperature_unit
Optional | Default: F
This will allow you to define the temp unit to use. This can also be set in the HUbitat App
validateTokenId
Optional | Default: false
This forces the plugin to validate the Hubitat app token and location with that defined in the plugin configuration
adaptive_lighting
Optional | Default: true
This enables support for bulbs with Color Temp and Brightness to use HomeKit's new Adaptive Lighting features.
adaptive_lighting_offset
Optional | Default: 0
Defines a custom temperature adjustment factor. This can be used to define a linear deviation from the HomeKit Controller defined ColorTemperature schedule. For example supplying a value of -10 will reduce the ColorTemperature, which is calculated from the transition schedule, by 10 mired for every change.
consider_fan_by_name
Optional | Default: true
By default the plugin will identify a fan device by using a devices label, and whether it has Fan in the label.
consider_light_by_name
Optional | Default: false
By default the plugin will identify a light device by using a devices label, and whether it has Light in the label.
excluded_capabilities
Optional | Default: '{}' (None)
NOTICE: The Hubitat app offers many inputs to help filter out device capabilities. Only use this if the available inputs don't meet your needs. Specify the Hubitat device by ID and the associated capabilities you want the plugin to ignore.This prevents a Hubitat device creating unwanted or redundant HomeKit accessories.
logConfig
Optional
Define log output format options as well as enable the log file output.
debug
Optional | Default: false
Enables Debug log output.
showChanges
Optional | Default: true
Logs device event changes received from Hubitat.
Q: Can this support Axis Blinds?A: Maybe, it can support any device that has the windowShade capability and/or level attributes.
Homebridge 是一个轻量级 NodeJS 服务器,它模拟 iOS HomeKit API,提供从 HomeKit 到“智能家居”设备制造商提供的各种第三方 API 的基本桥接。通过 Homebridge 的桥接,可以让 Siri 控制完全不支持 HomeKit 的设备。 此外 Homebridge 支持插件。
homebridge-vsx homebridge-vsx is a plugin made for homebridge,which allows switching on and off your Pioneer AV receiver. All AV receivers (VSX and SC),which work with the iControl AV5 App are support
homebridge-sesame Control and monitor your Sesame smart lock with HomeKit integration. Prerequisites Installation of Homebridge iOS 11 or later Sesame lock with enabled cloud integration Sesame Wifi A
homebridge-panasonictv A homebridge plugin for turning on and off your Panasonic Viera TV. The plugin also has experimental support for changing the volume and channel. These characteristics are not r
Quick Start | Contribute A Wake on Lan plugin for Homebridge Turn your PCs, laptops, servers and more on and off through Siri Quick Start To install the plugin, head over to the machine with Homebridg
Docker Homebridge This Alpine/Ubuntu Linux based Docker image allows you to run Nfarina's Homebridge on your home network which emulates the iOS HomeKit API. This is a multi-arch image and will also r