You will need a Raspberry Pi, setup with Raspberian and homebridge
You can also use a machine in the host, but these instructions pertain to a Raspberry Pi
You will need to have your QwikSwitch cloud account with your devices added:
You will need an api client, like insomnia to connect to your QwikSwitch acccount and build the xml:
Right click and then click on "new request".

Call it "auth" and select "POST" and change "no body" to "JSON" then click on "Create".

You will need your email address from your QwikSwitch account, as well as the cloud key, printed on your WIFI bridge:
Paste in the following:
{
"email": "your...@gmail.com",
"masterKey": "12er569fetp"
}
Next to "POST", paste in the following url:
Now click on "Send"
Copy the output "rw": XXXXXXXXX This is your api key.

Right click and click on "new request"

Call it "status" and select "get" and then click on "create"

Add the following URL, replacing XXXXXXX with your api key you got in the auth step above.
Next to "GET", paste in the following url:
Now click on "Send":
Note
Make a note of the order of the devices, as this is how you will need to add them to homebridge.

Navigate to the ip of your homebridge server and login with:
Username: admin
Password: admin

You will see a QR code, you will need to scan this code with your iphone

Open Apple HomeKit on your iphone and click on the + and then click on "Add Accessory".

Now scan the QR Code on the homebride web page, and this will add HomeBridge as a bridge to your account.

Go back to your Homebridge web GUI and click on Plugins and install the following 2 plugins:

Click on "Config" and and replace the contents of accessories with the below:
Note
Replace the following with your settings:
"accessories": [
{
"accessory": "HTTP-LIGHTBULB",
"name": "Kitchen Light",
"onUrl": "http://qwikswitch.com/api/v1/control/XXXXXXX/?device=@2c11111&setlevel=100",
"offUrl": "http://qwikswitch.com/api/v1/control/XXXXXXX/?device=@2c11111&setlevel=0",
"statusUrl": "http://qwikswitch.com/api/v1/state/XXXXXX/",
"statusPattern": "@2c11111(.|\n)*value\":1(.|\n)*@2d22222"
},
{
"accessory": "HTTP-LIGHTBULB",
"name": "Lounge Light",
"onUrl": "http://qwikswitch.com/api/v1/control/XXXXXXX/?device=@2d22222&setlevel=100",
"offUrl": "http://qwikswitch.com/api/v1/control/XXXXXXX/?device=@2d22222&setlevel=0",
"statusUrl": "http://qwikswitch.com/api/v1/state/XXXXXXX/",
"statusPattern": "@2d22222(.|\n)*value\":1(.|\n)*@2e33333"
},
{
"accessory": "HTTP-SWITCH",
"name": "Fountain",
"onUrl": "http://qwikswitch.com/api/v1/control/XXXXXXXXXX/?device=@2e33333&setlevel=100",
"offUrl": "http://qwikswitch.com/api/v1/control/XXXXXXXXX/?device=@2e33333&setlevel=0",
"statusUrl": "http://qwikswitch.com/api/v1/state/XXXXXXXX/",
"statusPattern": "@2e3333(.|\n)*value\":1(.|\n)"
}
],
"platforms": [
{
"name": "Config",
"port": 8581,
"platform": "config"
}
]
}
You must keep your device id in the exact order of the output of your api call.

Note the order in StatusPattern.
StatusPattern is a regex between 2 devices, so you have to have the 2 devices in order to get the correct on and off status.

--
You received this message because you are subscribed to the Google Groups "QwikSwitch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qwikswitch+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qwikswitch/dba688ea-6b8a-4e81-93d8-da425a5c1402o%40googlegroups.com.