Dynamic Refreshing Image URL

Posted on
Thu Aug 20, 2020 11:16 am
Different Computers offline
User avatar
Posts: 2533
Joined: Jan 02, 2016
Location: East Coast

Re: Dynamic Refreshing Image URL

ok, and just like that, I found it.

I'm not sure what I was doing before that was not changing the CurrentCam variable, but when I used one of my old action groups to change CurrentCam, it worked and the errors stopped.

So never mind, I guess? Time to figure another way to get pics out of security spy for use in Indigo.

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Posted on
Thu Aug 20, 2020 1:22 pm
Different Computers offline
User avatar
Posts: 2533
Joined: Jan 02, 2016
Location: East Coast

Re: Dynamic Refreshing Image URL

All right, with that issue behind me, now it's on to getting security spy images working with DRI.

I tried the base64 encoding of auth ala http://ip:port/++image?cameraNum=6&widt ... bleddygook trick, but I get "unauthorized."

When encoding, do encode *this whole thing as is*
Code: Select all
username:password


Or do I encode the username and the password separately and put a colon in between them? I've actually tried both and both get the same error.

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Posted on
Thu Aug 20, 2020 1:45 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Dynamic Refreshing Image URL

jroach wrote:
Jay,

At the beginning of this thread you had talked about a solution that might work for me:

http://USERNAME:PASSWORD@localhost:8176/variable_url_redirect/redirect?name=VARIABLENAME


You mentioned that there might be a more secure method in 7.1+

I'm trying to create. control page that will display the camera selected without leaving the page (see image). Would the method above work and is it the best approach now?


It would only work if the URL you are redirecting to doesn't require authentication. The authentication above is for contacting the Indigo Web server (note that you also need to turn on HTTP Basic authentication for IWS).

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu Aug 20, 2020 1:48 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: Dynamic Refreshing Image URL

Different Computers wrote:
When encoding, do encode *this whole thing as is*
Code: Select all
username:password


Or do I encode the username and the password separately and put a colon in between them? I've actually tried both and both get the same error.

I've never done it but based on this post from mundmc, the entire thing is base64 encoded. As an example he said durosity:test would become ZHVyb3NpdHk6dGVzdA==.

Image

Posted on
Thu Aug 20, 2020 2:00 pm
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

Dynamic Refreshing Image URL

Different Computers wrote:
All right, with that issue behind me, now it's on to getting security spy images working with DRI.

I tried the base64 encoding of auth ala http://ip:port/++image?cameraNum=6&widt ... bleddygook trick, but I get "unauthorized."

When encoding, do encode *this whole thing as is*
Code: Select all
username:password


Or do I encode the username and the password separately and put a colon in between them? I've actually tried both and both get the same error.
Hmmmm, I think I got this working by inputting the string “username:pwd” (no quotes) into a base64 encoder. That worked for at least one other person. Hmmmm.

Mine looked like this:

Code: Select all
http://192.168.1.10:8000/++image?cameraNum=6&width=546&height=360page?auth=b2tleREDACTED9sZGVyOQ==

Posted on
Fri Aug 21, 2020 7:30 am
Different Computers offline
User avatar
Posts: 2533
Joined: Jan 02, 2016
Location: East Coast

Re: Dynamic Refreshing Image URL

When I put the URL with the encoded username/pwd in a browser window, it does not work. I get the standard authorization popup. It also gives me either "No status line received - the server has closed the connection" or "unauthorized" when I try it in Indigo.

Time for more investigation.

Super oddly, when I put one of these URLs statically in a control page, it does work. Though in this case it's with the authentication in front of the URL.

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Posted on
Fri Aug 21, 2020 8:33 am
jroach offline
Posts: 254
Joined: Oct 29, 2010

Re: Dynamic Refreshing Image URL

Jay, thanks for the quick reply as always.

Let me rephrase my question.... What is the best way to create a control page where a button is pressed and it places the video from SS into an area that is not where the button is located (same page but different area)? I want to creat a button for each camera but only one area to display the image.

Advice appreciated.

Posted on
Fri Aug 21, 2020 8:59 am
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Dynamic Refreshing Image URL

jroach wrote:
Jay, thanks for the quick reply as always.

Let me rephrase my question.... What is the best way to create a control page where a button is pressed and it places the video from SS into an area that is not where the button is located (same page but different area)? I want to creat a button for each camera but only one area to display the image.

Advice appreciated.


To be perfectly honest and based on your mockup, I'd just create the control page, hardcode the SS url in a dynamic refreshing image URL element, the duplicate the page for each camera and hardcode the image URL. Then for each button, just have it switch to the correct page. So no trickeration with dynamic URLs or forwarding. The effect would be the same - click the button and the image changes - but is much easier to configure. Duplication is usually seen as wasteful, but because these things end up being static for years after initial implementation, it really is often the easiest approach.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Fri Aug 21, 2020 11:09 am
jroach offline
Posts: 254
Joined: Oct 29, 2010

Re: Dynamic Refreshing Image URL

Jay, thanks I'll give that a try.

So, if I have a dozen cameras I'll have a dozen pages... from what I know, that should be pretty straight forward to duplicate then change the camera number and button.

If I have other elements on that page (Lights, HVAC, Audio, etc), will those be preserved in the duplicating process ie: if a light shows as "on" for the primary page that the duplicate will also show as on?

I know....give it a try :)

Thanks again.

Posted on
Fri Aug 21, 2020 11:26 am
whmoorejr offline
User avatar
Posts: 762
Joined: Jan 15, 2013
Location: Houston, TX

Re: Dynamic Refreshing Image URL

jroach wrote:
will those be preserved in the duplicating process .
. Yes. All buttons, actions, images, etc are all preserved when duplicated.

Bill
My Plugin: My People

Posted on
Sun Aug 23, 2020 3:40 pm
jroach offline
Posts: 254
Joined: Oct 29, 2010

Re: Dynamic Refreshing Image URL

Jay,

I tried your idea of just making a new page for each camera ie: each camera has its own page and when you touch the camera name it switches pages.

Not certain if there is a way around this but I tried both "advance to control page" or "replace with control page" but its obvious its moving to a new page. I was hoping it would be like the +on and be seemless.

Thoughts appreciated.

Posted on
Mon Aug 24, 2020 1:21 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Dynamic Refreshing Image URL

Yeah, I had forgotten about the flip transition when you use replace with control page. When viewing in a browser it does exactly as you'd like, just not in the iOS client.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Wed Jul 07, 2021 3:47 pm
EagleDTW offline
Posts: 69
Joined: Apr 30, 2020

Re: Dynamic Refreshing Image URL

Hi Jay,

I love the static image dynamic refresh feature - I'm running into an issue currently that the images are from pre-upgrade public folder and not currently what is in the public folder inside the 2021.1 folder of web server. Any help appreciated?

Thank you,
Daniel

Posted on
Sat Jul 10, 2021 8:26 am
Different Computers offline
User avatar
Posts: 2533
Joined: Jan 02, 2016
Location: East Coast

Re: Dynamic Refreshing Image URL

Do you have any hard coded paths in whatever is serving the image? Probably a control page, and those paths need to be adjusted when the public folder path changes.

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Posted on
Mon Jul 12, 2021 7:03 pm
EagleDTW offline
Posts: 69
Joined: Apr 30, 2020

Re: Dynamic Refreshing Image URL

I have it dynamically linked to the server which should point to any new install:

http://username:password@localhost:8176 ... e=ImageURL

With the variable containing this:
http://localhost:8176/public/frames-0.png

It seems to all be dynamic and I’ve even deleted and emptied the trash of the old 7.5 install but still runs through the images from the day before the update to 2021.1.

Page 7 of 9 1 ... 4, 5, 6, 7, 8, 9

Who is online

Users browsing this forum: No registered users and 21 guests