Adding your QwikSwitch cloud account to Apple HomeKit

93 views
Skip to first unread message

rezi...@gmail.com

unread,
Jul 20, 2020, 2:22:05 AM7/20/20
to QwikSwitch
Took me a while to get it working, but I finally have my QwikSwich appliances attached to Apple Homekit, which i can then control Via Siri

The basics are:
QwikSwitch relays connected to wifi Bridge, which connects to QwickSwitch's cloud account.
A self hosted homebridge server on your Raspberry Pi, which is connected to your Apple Icloud Account

Would appreciate feedback if you have, so I can make corrections, etc.
Source, updates and corrections to be made on my site: https://shaunmegaw.co.za/homebridge/

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:

API Calls#

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".

image

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

image

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.

image

Right click and click on "new request"

image

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

image

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.

image

Homebridge#

Connect HomeBridge To Your Apple HomeKit#

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

Username: admin

Password: admin

image

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

image

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

image

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

image

Accessories#

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

  • homebridge-http-lightbulb
  • homebridge-http-switch

image

Click on "Config" and and replace the contents of accessories with the below:

Note

Replace the following with your settings:

  • XXXXXXXX - api key
  • @2c11111 - Qwikswitch replay device 1
  • @2d22222 - Qwikswitch replay device 2
  • @2e33333 - Qwikswitch replay device 3
    "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.

image

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.

image

QwikSwitch

unread,
Jul 20, 2020, 2:30:33 AM7/20/20
to QwikSwitch
We would suggest contacting Homebot, they have done some dev on this and may be able to help. 

Karman de Lange

unread,
Jul 21, 2020, 3:08:17 AM7/21/20
to QwikSwitch
I've done simular but using qwickswitch usb and running a python script (https://github.com/liaan/QwikSwitch-mqtt) to convert commands from/to MQTT . Then use openhab to bridge the mqtt to homekit/alexa All is local, so no need for external parties so works even if internet is down..   (except alexa)


Great work to get it going though.... I know the pain/suffering it takes to get these to work with each other :)


On Monday, July 20, 2020 at 8:22:05 AM UTC+2, (unknown) wrote:

Brennan Babb

unread,
Jul 24, 2020, 9:02:21 AM7/24/20
to QwikSwitch
Ive had this working for a while but with the old Qwikswitch modem on a raspberry pi.
I have a mixed set of home control devices working qwikswitch and sonoff.
Pretty much similar to the above.
Siri is your friend, also got the Alarm sensor kit which helps greatly with home automation and sensors
The Home pod with this and a few apple TVs its the SHIT!  all my cameras hooked into Fffmpeg on the raspberry pi too.  ping me if you guys want tips.


--
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.
Reply all
Reply to author
Forward
0 new messages