Page 1 of 1

Selectable image source in a single Refreshing Image URL

PostPosted: Tue Aug 16, 2016 8:31 am
by citysnaps
Hi...

I've been using Indigo for about a month and am extremely pleased. In my phone's Indigo Touch control page I have a variety of light controls, motion sensor reporting, and four IP camera streams. It all works great and am very happy.

Currently each IP camera periodically refreshes four separate Refreshing Image URL fields, using:

//localhost:8000/++image?cameraNum=0&width=1080&height=607&quality=60
//localhost:8000/++image?cameraNum=1&width=1080&height=607&quality=60
//localhost:8000/++image?cameraNum=2&width=1080&height=607&quality=60
//localhost:8000/++image?cameraNum=3&width=1080&height=607&quality=60

As that's wasteful on bandwidth and phone screen real estate, I'd like to instead have just a single Refreshing Image URL container on my control page. And then,, depending on the state of a variable that is updated from a button taking on values of 0, 1, 2, or 3, put one of the above four URL's into the URL field for the single image container.

I can handle managing and incrementing the variable from successive button pushes in Indigo. But need to select and put one of the above four URLs into the control page's refreshing image URLs based on the value of that button variable.

I suspect that feature is not built-in. But have a feeling there is something I can do with a bit of external code. Can someone point me in the right direction?

Thanks!

Re: Selectable image source in a single Refreshing Image URL

PostPosted: Tue Aug 16, 2016 8:57 am
by jay (support)
Pretty sure you could write an IWS plugin that would look at the variable value then redirect to the appropriate URL. IWS plugins are legacy but should continue to work in Indigo 7.

Re: Selectable image source in a single Refreshing Image URL

PostPosted: Tue Aug 16, 2016 9:10 am
by citysnaps
Thanks for the speedy reply - appreciate it!

Will check out IWS Plugins.

Re: Selectable image source in a single Refreshing Image URL

PostPosted: Tue Aug 16, 2016 9:55 am
by johnpolasek
I set up a different control page for each camera, kept in a floder labeled "Cameras". I have always assumed that until I activated a page, it did not actually load anything... Is that an erroneous assumption?

Re: Selectable image source in a single Refreshing Image URL

PostPosted: Tue Aug 16, 2016 11:47 pm
by bkmar1192
I have done this by using symbolic links. I have directions on how I did it over here:

viewtopic.php?f=133&t=1506&p=121610#p121610

Basically you have a symbolic link that points to your video file and then issue a unix command via Apple Script to refresh the symbolic link. In the example above I loop through each of my cameras. However, using the same technique, I have a different page that has a small versions of my cameras and clicking on them displays the camera in a bigger screen. Works great.

Re: Selectable image source in a single Refreshing Image URL

PostPosted: Fri Jul 28, 2017 10:49 am
by jay (support)
Just as a followup: viewtopic.php?f=134&t=18729