A Python script that allows an Amazon Alexa to interpret voice commands to operate an iAqualink pool control system by Zodiac Pool Systems.
Requires Flask, Selenium, and a PhantomJS executable.
pip install flask
pip install selenium
PhantomJS is a portable, invisible web browser that the script uses to communicate with iAqualink.
Download PhantomJS here and place the extracted phantomjs.exe file in the same directory as the Python script.
This script uses IFTTT.com to communciate with the Amazon Alexa. You will have to create an IFTTT service for every command to be said to your Alexa ("Alexa, trigger pool on" or "Alexa, trigger hot tub off", etc.)
To begin, create an IFTTT applet triggered by Amazon Alexa - Say a specific phrase, and set it up for the command you want to be executing.
Then choose the Webhooks action service.
The URL should be set to your IP address. IFTTT.com is going to send an HTTP POST request to port 3737 on this IP address.
The method of the request is POST.
The content type is application/json.
The body of this request must be formatted correctly as a JSON table. This is what a correctly formatted request contains:
{ "key" : "<YOUR KEY HERE>", "device" : "<DEVICE HERE>", "mode" : "<MODE HERE>" }
The key
field contains the same key as the one defined in the string atop the Python script (default 555).
The device
field contains the name of the device being targeted: TUB, POOL, LIGHTS, FEATURE, BUBBLES, or ALL.
The mode
field contains the desired state of the device: ON or OFF.
This script attempts to navigate the web interface for iAqualink. Depending on your pool equipment, some buttons in the webpages may be out of order causing the script to malfunction. If everything appears to be setup correctly and your pool is being controlled incorrectly, contact me!