- Posted on
Tue Feb 21, 2017 11:42 am
-
Professor Falken
offline
-
- Posts: 289
- Joined: Mar 29, 2015
Thanks Matt,
After spending many hours designing a page or two, I figured I'd just go the extra distance and create some real buttons instead of using the clear ones-- that way they click and change with a press. As the song says, "If you do it all, you ought'a do it right!"
But now I have a different question:
I am pretty sure that the answer to this is "no", but before I dive much further into migraine-inducing variable creation and logic for a work-around, I figured I'd ask on the forum.
Does the Control Page editor function allow a page element to link to a different page based on a variable state? Nothing like this has jumped out at me either in the program or via forum searches.
Let me give my current example to illustrate what I am trying to do...
I have a button on my general dashboard called "seasonal lighting". This button points to a page with several outdoor seasonal light displays that are hooked up to Insteon Outdoor Modules. There are 3 of them. They are mostly run by schedules, but sometimes we need to manually toggle them, hence the presence on the dashboard page.
The modules control different outdoor decorations depending on the season -- Halloween, Christmas, Mardi Gras, etc. (Oh, I'm very popular with the neighbors). I have created nice little off and on images for each thing, i.e., offs and ons for the 3 Christmas decorations, for the three Mardi Gras ones, etc.
Now, ideally, pressing the "seasonal lighting" button on the dashboard would take you only to the appropriate season page, by following a settable season variable. But as near as I can tell that is not natively possible in the control page editor. One item can not link to multiple page target options, right?
I could have an intermediate page where the user selects the season and that then links to the correct season page, but that seems sloppy-- forcing you to pick something every time that by definition is the same for months at a time.
I have found a work-around that (mostly) works, but it involves creating a series of module specific display variables that change, triggered by a change in the global "season" variable, as well as by a change in the on/off state of each of the three modules. Additionally, I created background images for each of the seasons, but instead of saving them to the background folder and using them that way, I saved them in the variable folder. They are full page size images that are then treated like a variable by Indigo, even though they are functioning more like a background in the actual display. That way the "background" of the page also changes with the Season variable.
So by doing this I have a single, linked page that changes both the background image, as well as 3 different on/off toggleable outdoor modules that have different images depending on the season. Admittedly, I have spent WAY too much time on this little side project, and no one in my family really appreciates the work that goes into having those pretty little pictures change-- but I digress...
So what's the issue, if everything works OK?
1) Doing it this way, with several variables tied to the overall season, each module's on and off state, etc. creates a LOT of moving parts. I haven't fully tested it, but it has the feeling of something that could easily get out of sync with the modules' states if, for example, an Insteon command is missed by the outdoor module but the server toggles the on/off image variable I created and shows an ON picture for an OFF device. At some point I'll go play around and unplug a module and see what happens when I toggle it in the app.
2) There is also a a kink in that when the user changes the season variable, the module device images aren't adjusted to the new season until each is toggled once (because the final image display change has to be triggered by "becomes on" and "becomes off" so that the image shows a correct lit or unlit decoration ). There is probably variable-controlled work-around for this, but I haven'y yet figured it out. Ideally, on a season change, the server would check the on/off state of each module, then set the corresponding display value to the correct season and on/off state image for each one. This way a season change would change both the background and the device images in their correct current states seamlessly.
Alternatively, I could just have the server automatically toggle the three modules to off on a season change- it's not like that is something that happens much anyway when in regular use. We really should only have to change it in Decemeber, January, October...
Having the original dashboard page link be able to point to different target control pages based on the Season variable would greatly simplify all of this, as the regular background image function could be used, and a single image pair tied to the device state of each module would be defined and work like it does on most Control Pages. But as I said at the top, I suspect this isn't supported by Indigo at present.
If so, can we add it as a feature request?
Thanks
FWIW, designing these pages is really fun. I am constantly amazed at what you can do with Indigo. I'll post some pics on the "post your control pages" string once they are a little more complete.