I’m trying to write a smart app which allows users to select multiple modes, and for each mode, set additional settings. I want to do this with dynamic pages and it doesn’t appear possible to generate a dynamic page from a method. Rather, I’ve discovered I have to jump to the page with an href and if I want to pass the selected mode as a parameter, I’m finding it get’s lost on submit since href parameters do not persist.
Any suggestions for how to work around this limitation?
Yep - I’ve been using your code for motion lighting as an example to learn off of. The key difference is that you set settings (i.e.: time) only once…and I’m trying to set variables for time for each mode selected.
So something like:
Mode1 starting
Mode1 ending
Mode2 starting
Mode2 ending
ModeN starting
ModeN ending
I’ve found that I could use your bit for selecting of modes and then create a page that creates new variables for each mode:
starting$modeX
ending$modeX
And this has worked successfully for saving variables except the href params weren’t persisting so the display of those variables would change to null after submitting changes. If I leave the page and go back to it - the app remembered what I put in each field though.
Using maxwells suggestion of state I think I can figure out how to get around this.
For the record I’m working on creating an app that will let you set routines to run for each mode which change depending on a user defined scheduled. So that when you leave it sets to the away mode for that time and when you return it changes to the correct home mode. Much like routine director but more customizable since I like to have multiple modes after sunset (i.e.: evening and night)