KOGAN smarter home products use Tuya protocols except using a slightly different url and device domain. This means you can use the existing homebridge-tuya plugin for homebridge except using a different process to obtain the device id and keys.
Pre-requisites: First, Install the Kogan Smarter Home app on your idevice then add and configure all your kogan devices. (DO THIS FIRST!).
I am also assuming you already have homebridge setup and running. If not, I strongly reccomend you install homebridge via docker such as https://github.com/oznu/docker-homebridge (Makes it easy to get up and running)
Then:
- Visit https://github.com/codetheweb/homebridge-tuya and install the tuya plugin to homebridge using
npm i homebridge-tuya
(you can put this in your startup.sh file if using docker or else add -g if you're not using docker)
add the new platform to your config.json:
{
"platform": "TuyaPlatform",
"name": "TuyaPlatform",
"devices": [
]
}
Devices are blank for now, lets find them!
- You can scape ID and KEYs from kogan products such as the Smart energy plugs by running Anyproxy on your computer and then opening the Smarter Home app. Anyproxy will capture HTTPS queries which include device id and passwords.
Install anyproxy from here: https://github.com/alibaba/anyproxy and ensure you add the proxy certificate to your iPhone and setup the proxy. Run using anyproxy --intercept --ws-intercept
- Open the Smarter Home app. Visit the anyproxy dashboard url on your laptop and check out the queries captured via anyproxy.
You will get a few https queries which include the device id and keys.
Sample:
{
"result": [
{
"result": [
{
"devId": "XXXXXXXX HERE IS YOUR DEVICE ID XXXXXXXXX",
"dpMaxTime": 1542869607548,
"virtual": false,
"productId": "<Ignore this>",
"dps": { "1": true, "2": 0, "3": 0, "4": 0, "5": 0, "6": 0 },
"activeTime": 1542868361,
"ip": "xxx",
"lon": "xxx",
"moduleMap": {
"wifi": {
"upgradeStatus": 0,
...
},
"uuid": "XXX HERE IS THE DEVICE ID AGAIN XXXX",
"name": "Toaster",
"isShare": false,
"timezoneId": "xxx",
"iconUrl": "https://images.tuyaus.com/smart/icon/1536896591itvclcq5ns_0.png",
"lat": "-37.822664",
"runtimeEnv": "prod",
"localKey": "XXXX HERE IS YOUR KEY XXX"
},
(more devices listed here)
Write down the DEVICE ID and KEYS from the devices you wish to configure. Above is an example of my toaster wall outlet.
Now, add all your devices to the config.json you started earlier:
{
"platform": "TuyaPlatform",
"name": "TuyaPlatform",
"devices": [
{
"name": "Tuya Outlet Device 1",
"id": "XXX PUT THE DEVICE ID HERE",
"key": "XXXXX PUT THE DEVICE KEY HERE XXXXX"
},
{
"name": "Tuya Dimmer Switch Device 2",
"id": "...",
"key": "...",
"type": "dimmer"
}
]
}
- Restart your homebridge server and the devices should appear in homekit!
Troubleshooting:
- Kill the home app on your iphone
- Restart your iphone
- Restart your apple tv
- Restart your homebridge server
My result value seemed to be encoded or encrypted somehow, it just shows letters, numbers, some + and /