Home Automation and Integration with Alexa / Google Home

Had some success with this with my iAqualink and a Raspberry Pi (to host the Python Script) and using IFTT recipes , but then ran short on time:

GitHub - evancg37/Alexa-Pool-Control: A simple HTTP server that allows an Amazon Echo to interpret voice commands to operate an iAquaLink pool controller over WiFi

The author was willing to help and cleaned up his instructions quite a bit, but he's a student and time became an issue for him also. Maybe others will chime in.
No where as elegant as what Jandy could do directly but least it was fun to ask Alexa to turn on the pool and watch the pumps start by voice! proving it could be done :)
 
Hey woody, re
Don't trust it!...............My Smartthings hub lost it's zigbee mind last week and I get to add every little thing back in when replacement arrives.
Was just over a year old.

I'm thinking about getting the smart things 2 hub to eventually integrate my pe653 and accuweater sensors plus some equipment monitoring devices for the pool house. (I would have to use the Intermatic hack code from the smart things forum.)

But I've been wondering about the fact that the smart things hub has no local memory. Have you looked into any alternatives seeing as you've been victim of this phenom? Is it not possible to store your settings on the cloud?
 
"They're working on it" is all I've seen in the forums discussions. It would have to be some kind of saved profile of all your "things" that you could download back into the app I think.
 
Hmm. Maybe I should wait another year to see if either wink, smartthings or Intermatic get things dialed in ;) thanks for the heads up. Was resetting it a two-scotch or a three-scotch endeavor?
Easier if I hadn't tried to short cut the process as an experiment! When they say to remove all your smart apps, rules and routines and such as well as all your stuff----they mean it. Ya gotta blast it all out of Alexa too and rediscover it all, rename and such.

If you hold off till you think everything is integrated and works like it "should"----you'll never do it. Jump on in!
 
For anyone who wants to do something custom

It depends on how you want to do your setup but heres how Alexa work's.
All devices jump into multicast address "239.255.255.250"
After, All devices wait for an incoming udp Multicast packet on port 1900

Alexa broadcast to all units
M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
MAN: "ssdp:discover"
MX: 15
ST: urn:Belkin:device:**


The remote device response back with


"HTTP/1.1 200 OK\r\n"
"CACHE-CONTROL: max-age=86400\r\n"
"DATE: Mon, 22 Jun 2015 17:24:01 GMT\r\n"
"EXT:\r\n"
"LOCATION: http://%s:%d/setup.xml\r\n"
"OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01\r\n"
"01-NLS: %s\r\n"
"SERVER: Unspecified, UPnP/1.0, Unspecified\r\n"
"ST: %s\r\n"
"USN: uuid:Socket-1_0-%s::"
"%s\r\n" // %s = urn:Belkin:device:** (Echo Dot 2Gen, Echo 1Gen) or %s = upnp:rootdevice (Echo 2Gen, Echo Plus)
"X-User-Agent: redsonic\r\n"
"\r\n";


Alexa parses the LOCATION part (Grabbing IP and Port) then request for it to get the list of skills via TCP now not UDP


the device response with


const char SETUP_TEMPLATE[] =
"<?xml version="1.0"?>"
"<root xmlns="urn:Belkin:device-1-0">"
"<device>"
"<deviceType>urn:Belkin:device:controllee:1</deviceType>"
"<friendlyName>%s</friendlyName>"
"<manufacturer>Belkin International Inc.</manufacturer>"
"<modelName>Socket</modelName>"
"<modelNumber>1.0</modelNumber>"
"<UDN>uuid:Socket-1_0-%s</UDN>"
"<serialNumber>%s</serialNumber>"
"<binaryState>0</binaryState>"
"<serviceList>"
"<service>"
"<serviceType>urn:Belkin:service:basicevent:1</serviceType>"
"<serviceId>urn:Belkin:serviceId:basicevent1</serviceId>"
"<controlURL>/upnp/control/basicevent1</controlURL>"
"<eventSubURL>/upnp/event/basicevent1</eventSubURL>"
"<SCPDURL>/eventservice.xml</SCPDURL>"
"</service>"
"<service>"
"<serviceType>urn:Belkin:service:metainfo:1</serviceType>"
"<serviceId>urn:Belkin:serviceId:metainfo1</serviceId>"
"<controlURL>/upnp/control/metainfo1</controlURL>"
"<eventSubURL>/upnp/event/metainfo1</eventSubURL>"
"<SCPDURL>/metainfoservice.xml</SCPDURL>"
"</service>"
"</serviceList>"
"</device>"
"</root>\r\n";


Once the request is completed Alexa will remember the information parsed in the SETUP_TEMPLATE and make its future calls to the BasicEvent URL for on and off functions


You can then handle the request like so also via TCP

char
XMLresponse[5120];
if (strstr(pusrdata, "POST /upnp/control/basicevent1 HTTP/1.1") != NULL)
{
if (strstr(pusrdata, "<BinaryState>0</BinaryState>") != NULL)
{
//os_printf("Off");
os_sprintf(XMLresponse, SETSTATE_TEMPLATE, "0");
send(pconn, (uint8*)HEADERS, os_strlen(HEADERS));
send(pconn, (uint8*)XMLresponse, os_strlen(XMLresponse));
conn_disconnect(&TCPptrespconn);
}
if (strstr(pusrdata, "<BinaryState>1</BinaryState>") != NULL)
{
//os_printf("On");
os_sprintf(XMLresponse, SETSTATE_TEMPLATE, "1");
conn_send(pconn, (uint8*)HEADERS, os_strlen(HEADERS));
conn_send(pconn, (uint8*)XMLresponse, os_strlen(XMLresponse));
conn_disconnect(&TCPptrespconn);
}
}

I hope this helps someone.
 
I setup mine with a particle photon running an 8 channel relay.
3 of the relay channels run pump speed on my variable speed pump and I can select 8 different speeds.
1 runs my pool light and I can select colors based on power cycling the relay.
The other four control valve actuators.
The whole project is then tied together in my smartthings hub which has control of the rest of my homes lighting including patio lighting and other outdoor lighting. Everything can be voice controlled etc. I love it and it was a fun project. Considering photons are 19 bucks and 8 channel relay boards are like 10 bucks I feel that I got a huge bang for my buck You can find details of my project here.
Automated Pool Controller - Projects Stories - SmartThings Community
I also made a sensor for under my skimmer basket that does water temperature and water level that sends info to another photon that controls water valves one for my patio misters and one for my pool so it’s an over engineered automated auto fill setup too.
 
If you hold off till you think everything is integrated and works like it "should"----you'll never do it. Jump on in!

Okay, Woody, feet now wet from jumping in ;) Only a 1-gin job so far...

I have the Smartthings Hub controlling my simple PE653 setup now, and by using multichannel buttons, have heat, pump and swg running on set schedules. In other words, I've managed to get control to my phone for offsite monitoring, which was the goal.

My temp sensor is 3 degrees lower than my in-pool thermometer, and my dome monitoring sensors don't appear to be st compatible, and I need my electrician to separate my pool light from an outdoor GFCI outlet for independent control, but its a start ;)

Someday I will get to the bscuderi level of HA ;)
 
You're WAAAAAY ahead of me! But .....that 3 degree difference is pretty typical I think. I have an open/close sensor on a patio door with a temp sensor in it. Hanging right next to it is a traditional style thermometer. Yep......3 degrees difference measuring air temps.
 

Enjoying this content?

Support TFP with a donation.

Give Support
Speaking of light years ahead, @bscuderi WOW I took a peek at your home-rolled ST integration...that's awesome!

Why thank you! It was a lot of fun and I learned a lot on the process. I was new to programming so it was my first go at something like this. But after reading lots of sample code on particles websites for control of things I was able to figure my way around what I needed to do. I saw you mentioned gfci protection of the pool light. To be clear my pool light is gfci protected I just wired it downstream from a gfci outlet on my panel. I do not think in any circumstance you would want to bypass this.
 
No, not planning to bypass it ;) The issue is (I think) the way the outdoor outlet and the pool light are tied together on the same circuit. My switch for the pool light is outdoors (eg outdoor type lever switch.)

My guy could have wired the circuit into my pe653 but then I'd be turning off the outlet when I turned off the pool light so we need to separate the two if we want to control from indoor. Don't know of any smart switches rated like the outdoor type lever.
 
No, not planning to bypass it ;) The issue is (I think) the way the outdoor outlet and the pool light are tied together on the same circuit. My switch for the pool light is outdoors (eg outdoor type lever switch.)

My guy could have wired the circuit into my pe653 but then I'd be turning off the outlet when I turned off the pool light so we need to separate the two if we want to control from indoor. Don't know of any smart switches rated like the outdoor type lever.
I’m just using a hubless smart switch installed in an outdoor box with a weather tight cover. The switch doesn’t need to be outdoor rated if it’s protected inside a weathertight outdoor box.
 
For $140 (plus the cost of an Alexa Dot), I put together an Alexa control system that operates my pool lights, spa lights, patio lighting, barbecue lights, gazebo lighting, spa pump and heater.

My main pool operations were already automated without any pool automation system. My pump (an Intelliflo) is programmed to come on in the a.m. at preselected speed to run the infloor heads. Then switch speeds to the minimum required for the SWG, which is controled by a simple Intermatic timer.

If heat is called for and available at the solar panel a ($250) SolarTouch controller ramps up the pump and opens the valve. When done it closes the valve and returns control to the pump.

After the pool is chlorinated for the day the pump slows to 1,000 rpm for some extra filtration. Late in evening it shuts down, then repeats the program the next day.

So, what I have a system which is programmed to clean, chlorinate, and heat the pool all automatically with no effort on my part. This is done with no automation system, just using the onboard pump timer, a basic Intermatic timer, SolarTouch controller and one valve actuator.

And now, for well under $200, I’ve added smart switches to give me Alexa control of:
Spa pump
Heater
Spa light
Pool light
Patio lights
Barbecue lights
Gazebo lights.

For details, see the separate thread I started:

Alexa pool control on a shoestring budget
 
Thread Status
Hello , This thread has been inactive for over 60 days. New postings here are unlikely to be seen or responded to by other members. For better visibility, consider Starting A New Thread.