Dynamic Refreshing Image URL

Posted on
Tue May 01, 2018 3:05 pm
jay (support) offline
Site Admin
User avatar
Posts: 16212
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Dynamic Refreshing Image URL

Here's how I have one scenario set up on my dev Mac:

ss178.png
ss178.png (198.15 KiB) Viewed 1265 times


I have a Refreshing Image URL control page element that points to the DRI url, which itself points to a variable named "avatar_pict_url". That URL then points to a static image that I'm serving up from the public section of IWS (note no need for creds there) as shown by the Finder window in the lower right side.

Without picts, I can't really tell if this is what you were trying to do or not. If not, post screen caps of the relevant parts.

I'm also wondering why you're using the public folder mechanism here - there doesn't seem to really be a need, at least from what I can understand.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Tue May 01, 2018 3:53 pm
Different Computers offline
User avatar
Posts: 1973
Joined: Jan 02, 2016
Location: East Coast

Re: Dynamic Refreshing Image URL

Yup, that's what I was trying to do--wrong. I think every DRI variable I tried had left out the port for images local to the Indigo Server.

I'll know for sure when I get off my own network tomorrow.

And thanks for pointing out to me that what I'm doing doesn't need to be in the public directory. That's an outmoded thought leftover from an earlier attempt than the python version I'm now using.

SmartThings refugee, so happy to be on Indigo. 10.13.6 on an i5 MBP w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKit Bridge, MatplotLib, Plex, uniFAP, Wunderground, Nanoleaf, LED Simple Effects, Airfoil Pro, Grafana.

Posted on
Tue May 01, 2018 4:06 pm
Different Computers offline
User avatar
Posts: 1973
Joined: Jan 02, 2016
Location: East Coast

Re: Dynamic Refreshing Image URL

Still not getting something.

Tried moving stuff into /images and changing the url variable to
Code: Select all
http://localhost:8176/images/whatev.jpg

results in
Code: Select all
   WebServer                       http://localhost:8176/variable_url_redirect/redirect?name=CurrentCam load error: HTTP Error 401: Unauthorized

SmartThings refugee, so happy to be on Indigo. 10.13.6 on an i5 MBP w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKit Bridge, MatplotLib, Plex, uniFAP, Wunderground, Nanoleaf, LED Simple Effects, Airfoil Pro, Grafana.

Posted on
Tue May 01, 2018 4:17 pm
jay (support) offline
Site Admin
User avatar
Posts: 16212
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Dynamic Refreshing Image URL

Different Computers wrote:
Still not getting something.

Tried moving stuff into /images and changing the url variable to
Code: Select all
http://localhost:8176/images/whatev.jpg

results in
Code: Select all
   WebServer                       http://localhost:8176/variable_url_redirect/redirect?name=CurrentCam load error: HTTP Error 401: Unauthorized


I'm still trying to figure out what you're trying to do exactly.

When you moved it to the /images/ directory it became protected again. The DRI plugin doesn't handle HTTP authentication so that won't work.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Tue May 01, 2018 4:55 pm
Different Computers offline
User avatar
Posts: 1973
Joined: Jan 02, 2016
Location: East Coast

Re: Dynamic Refreshing Image URL

ok, let me step all the way back.

First, a reminder that my DSL connection is limited to 0.8 Mbps.

Because of that, it seems wise to me to, whenever possible, minimize travel outside the network for resources that are inside the network, while the viewing client is inside my network.

If I make every DRI URL variable that resides on my IWS (in the public folder, because no auth) start with https://myindigoname.indigodomo.net , then every time I pull up a control page, even if I'm home on my LAN and using the http://indigoservername.local address, then all the images, which are the large things in these pages, will have to go UP to the reflector and then back down to my router and then to my client computer that requested the page. Right?

But I see that since I can have my indigo server's control pages include entirely non-routing, non-resolvable LAN only addresses as DRI URL variables, it made me wonder if I could use a non-routable address for server-resident images too.

SmartThings refugee, so happy to be on Indigo. 10.13.6 on an i5 MBP w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKit Bridge, MatplotLib, Plex, uniFAP, Wunderground, Nanoleaf, LED Simple Effects, Airfoil Pro, Grafana.

Posted on
Wed May 02, 2018 9:18 am
jay (support) offline
Site Admin
User avatar
Posts: 16212
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Dynamic Refreshing Image URL

Ok, I get it, thanks for the full description. To restate: you'd like to serve up static images via IWS locally over the network when the client is on the same network as the server, but also have the same image available via reflector when the client isn't local.

Using the DRI plugin with a variable that points to the IWS public folder served up by the local Indigo Server will work correctly in that scenario.

However, you can avoid the extra redirects, plugins, and public directory if you can just replace the image in the Indigo server's filesystem whenever it changes. Use a file:/// URL in the Refreshing Image URL control page element type and point it to the image. Maybe that's not possible in your scenario but I thought I'd mention it as an option.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Tue Dec 24, 2019 7:50 pm
durosity offline
User avatar
Posts: 3944
Joined: May 10, 2012
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Dynamic Refreshing Image URL

So I don’t suppose there’s been any more thought on making this work with authenticated sources.. namely directly from SecuritySpy? The reason I ask is I’ve been playing with this as a way to get Indigo to show an error image if SecuritySpy isn’t available or the camera is down or whatever rather than ending up with literally thousands of 404 errors in the activity log (several tablets running indigo touch with 11 cameras refreshing every second sure makes for a lot of entries the second SS quits!). Now I can get my way of doing it to work but it’s quite janky.. I have to get SS to copy an image to an ftp server or to the reflector public folder*, then get it to use that url, but as you can imagine that takes a heck of a lot more effort and it results in the refresh period for images often going to 2-3 seconds rather than the 1 I want. Or is anyone aware of a way of getting SS5 to allow unauthenticated access local on the sever?

*also I’d suspect this would be the bane of M&Js existence... reflector being uploaded with new images every second and read by multiple devices over and over and over again.. not to mention the fact I want to keep it all local with little or no cloud reliance and also the fact anyone could potentially access those images if they could work out the file names..

Computer says no.

Posted on
Wed Dec 25, 2019 10:39 am
mundmc offline
User avatar
Posts: 702
Joined: Sep 14, 2012

Re: Dynamic Refreshing Image URL

My Christmas gift to you is trying to remember how I got dynamic url’s to work with security spy!

IIRC, when I did it, I just needed to base64 encode my username and password (there are websites that will convert for you) and I passed it along in the url: https://www.base64decode.org

The schema is something like:
http://ip:port/++image?cameraNum=6&widt ... bleddygook

That last part after “auth=“ is, a base64 encoding of user and password using the format “username:password” (no quotes).

Example:
durosity:test is encoded as:
ZHVyb3NpdHk6dGVzdA==
(Decode it for yourself at above site)

Hope this works for you!

Posted on
Wed Dec 25, 2019 10:59 am
durosity offline
User avatar
Posts: 3944
Joined: May 10, 2012
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Dynamic Refreshing Image URL

Ooooh handy! If that works you’re officially Santa Claus! I’ll try it out soon!

Computer says no.

Posted on
Wed Dec 25, 2019 1:13 pm
norcoscia offline
User avatar
Posts: 883
Joined: Sep 09, 2015

Re: Dynamic Refreshing Image URL

I'm too lazy to read the entire post above but I use SS camera inputs on my control pages - lots of them - I use the format below to insert a refreshing URL. Hope that helps and happy holiday!!!!!

http://username:password@IPaddress:Port ... height=365
Attachments
2019-12-25_11-05-24.jpeg
2019-12-25_11-05-24.jpeg (55.04 KiB) Viewed 600 times

_______
Norm

Posted on
Wed Dec 25, 2019 1:47 pm
mundmc offline
User avatar
Posts: 702
Joined: Sep 14, 2012

Re: Dynamic Refreshing Image URL

durosity wrote:
Ooooh handy! If that works you’re officially Santa Claus! I’ll try it out soon!


Ho ho ho- it did for me!

This is officially the second time I have been helpful to a regular here!

Posted on
Wed Dec 25, 2019 8:02 pm
durosity offline
User avatar
Posts: 3944
Joined: May 10, 2012
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Dynamic Refreshing Image URL

If you want to be helpful again feel free to send lots of money to...

Computer says no.

Posted on
Wed Dec 25, 2019 8:02 pm
durosity offline
User avatar
Posts: 3944
Joined: May 10, 2012
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Dynamic Refreshing Image URL

norcoscia wrote:
I'm too lazy to read the entire post above but I use SS camera inputs on my control pages - lots of them - I use the format below to insert a refreshing URL. Hope that helps and happy holiday!!!!!

http://username:password@IPaddress:Port ... height=365


Oddly enough that’s exactly where I started with it but it didn’t work what SS version are you running?

Computer says no.

Posted on
Thu Dec 26, 2019 8:54 am
norcoscia offline
User avatar
Posts: 883
Joined: Sep 09, 2015

Re: Dynamic Refreshing Image URL

The latest v5 but I put all the URLs in place under SS v4 and that worked great -- I'm running SS and Indigo on the same machine but doubt that would make any difference. The only issue is -- if I try to push a really large sized image I will get an error stating it was to big that rolls in my log until I exit the CP with that image - but the image does work (and update) anyway. There is a setting in SS you need to enable (I think) to allow web access, other that that it was straight forward . I got the idea after Matt posted the solution a long time ago while he was helping another user...

_______
Norm

Posted on
Sat Dec 28, 2019 4:07 am
durosity offline
User avatar
Posts: 3944
Joined: May 10, 2012
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Dynamic Refreshing Image URL

norcoscia wrote:
The latest v5 but I put all the URLs in place under SS v4 and that worked great -- I'm running SS and Indigo on the same machine but doubt that would make any difference. The only issue is -- if I try to push a really large sized image I will get an error stating it was to big that rolls in my log until I exit the CP with that image - but the image does work (and update) anyway. There is a setting in SS you need to enable (I think) to allow web access, other that that it was straight forward . I got the idea after Matt posted the solution a long time ago while he was helping another user...


Alas still no joy. However mundmc's base64 encoding worked so it's now up and running! Thanks both of ya!

Computer says no.

Who is online

Users browsing this forum: No registered users and 0 guests