http action group for external app?

Posted on
Fri Dec 29, 2017 8:25 am
Seeker offline
Posts: 440
Joined: Aug 05, 2013

http action group for external app?

Using homeremote's geo feature, i'd like to trigger a change of the blue iris camera app (on another PC) when the geo enters/exits.

what's the best way to add an indigo action group to execute the following?

Code: Select all
change blue iris to profile 1
http://192.168.2.100:8000/admin?user=USER&pw=PASSWORD&profile=1


I tried adding the command to a python script action, but it gives a syntax error.

thanks

Posted on
Fri Dec 29, 2017 9:28 am
Different Computers offline
User avatar
Posts: 2566
Joined: Jan 02, 2016
Location: East Coast

Re: http action group for external app?

If I understand what you're trying to do, can't you create a shell script containing a curl command and have the action group execute that?

Sonoma on a Mac Mini M1 running Airfoil Pro, Bond Home, Camect, Roku Network Remote, Hue Lights, DomoPad, Adapters, Home Assistant Agent, HomeKitLinkSiri, EPS Smart Dimmer, Fantastic Weather, Nanoleaf, LED Simple Effects, Grafana. UnifiAP

Posted on
Fri Dec 29, 2017 9:46 am
jay (support) offline
Site Admin
User avatar
Posts: 18238
Joined: Mar 19, 2008
Location: Austin, Texas

Re: http action group for external app?

This Python script should do the trick (Indigo 7+ required):

Code: Select all
import requests
requests.get("http://192.168.2.100:8000/admin?user=USER&pw=PASSWORD&profile=1")

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Fri Dec 29, 2017 3:51 pm
Seeker offline
Posts: 440
Joined: Aug 05, 2013

Re: http action group for external app?

i simply want to have an action group that emulates me manually entering:

Code: Select all
http://192.168.2.100:8000/admin?user=USER&pw=PASSWORD&profile=1


into a browser. that command changes blue iris's profile.

i tried:

Code: Select all
import urllib2
urllib2.urlopen("http://192.168.2.100:8000/admin?user=USER&pw=PASSWORD&profile=1")


but that does not change the profile. manually entering the address into safari does.

Posted on
Fri Dec 29, 2017 4:38 pm
jay (support) offline
Site Admin
User avatar
Posts: 18238
Joined: Mar 19, 2008
Location: Austin, Texas

Re: http action group for external app?

Did you try my version of that script? I'm quite surprised that your script didn't work - they are functionally equal. I wonder if your browser has some username/password cached? That would cause the browser to automatically send the basic or digest HTTP authentication information. Try a different browser and see if the URL works there as well.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Fri Dec 29, 2017 4:47 pm
Seeker offline
Posts: 440
Joined: Aug 05, 2013

Re: http action group for external app?

sorry, Jay, i missed your response!

I tried your code in a python script action group, hit execute while monitoring the BI control page and there is no change to the profile. copy/paste the http:... to safari and hit enter and the profile changes. note that when i use safari I get this returned on the page:

signal=green
profile=1
lock=1


thanks for any suggestions.

Posted on
Fri Dec 29, 2017 4:58 pm
jay (support) offline
Site Admin
User avatar
Posts: 18238
Joined: Mar 19, 2008
Location: Austin, Texas

Re: http action group for external app?

Did you try another browser as I suggested to make sure Safari isn't using cached authentication data?

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Fri Dec 29, 2017 6:04 pm
Seeker offline
Posts: 440
Joined: Aug 05, 2013

Re: http action group for external app?

jay, you are correct. i tried it in chrome and i get 'authentication required'. let me play with the command.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 0 guests