HTTP Get script

Posted on
Mon Feb 27, 2023 8:28 pm
Korey offline
User avatar
Posts: 811
Joined: Jun 04, 2008
Location: Henderson, NV

HTTP Get script

Seeing as how it does not look like the Autelis Jandy plugin will ever be updated to Python 3, I'm trying preemptively to get control of my Autelis Jandy pool controller this way: user:pass@poolcontrol/set.cgi?name=pump&value=0. It works via browser.

Daves fantastic Ghost XML grabs all the data I need, I just need a way to control the functions once Indigo lets go of Python 2.

How do I send this using a python script ?

I have tried a bunch of examples online but have not found a solution. :(

Thanks in advance for your wisdom.

--
Korey

Posted on
Mon Feb 27, 2023 10:53 pm
whmoorejr offline
User avatar
Posts: 762
Joined: Jan 15, 2013
Location: Houston, TX

Re: HTTP Get script

This worked for cameras to get an image.... might work for a pool pump?

Code: Select all
import requests
from requests.auth import HTTPDigestAuth
r = requests.get('http://IPADDRESS/poolcontrol/set.cgi?name=pump&value=0', auth=HTTPDigestAuth('user', 'pass'))
r.raise_for_status()

Bill
My Plugin: My People

Posted on
Tue Feb 28, 2023 9:47 am
Korey offline
User avatar
Posts: 811
Joined: Jun 04, 2008
Location: Henderson, NV

Re: HTTP Get script

Thanks So much Bill!

All I had to do is change the Auth to Basic and it works! :wink:

Not as sexy as a full blown plugin, but it will do the trick when the time comes.

This code turns off the pump:

Code: Select all
import requests
from requests.auth import HTTPBasicAuth
r = requests.get('http://192.168.0.248/set.cgi?name=pump&value=0', auth=HTTPBasicAuth('user', 'pass'))
r.raise_for_status()


Thanks Again!

--
Korey

Posted on
Fri Apr 28, 2023 9:03 am
pgershon offline
Posts: 506
Joined: Jul 10, 2004

Re: HTTP Get script

You might want to look at this too. I would love to integrate my AquaLink into Indigo.

https://github.com/sfeakes/AqualinkD

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests

cron