Help with Pages


(Louis Parks) #1

Hello, I am trying to finish up my app and make it really configurable but I am having a lot of difficultly getting the pages to work correctly in the simulator. For some reason every time I try to add pages to my preferences, my input devices stop working. Any help would be appreciated I would love to finish this guy up.

preferences {
          section("controller") {
            input "buttonDevice", "capability.button", title: "Button", multiple: false, required: true
          }
         section("sonos") {
           input "sonos", "capability.musicPlayer", title: "On this Sonos player", multiple:false, required: true
         }
}

This does not work at all. The events from the remote never fire.

preferences {
        page(name:"choose devices",install:true,uninstall:true){
          section("controller") {
            input "buttonDevice", "capability.button", title: "Button", multiple: false, required: true
          }
         section("sonos") {
           input "sonos", "capability.musicPlayer", title: "On this Sonos player", multiple:false, required: true
         }
        }
}

(Chrisb) #2

Ugh… I hate pages! :slight_smile:

I’ve yet to do much work with them as my initial apps were all written before pages were really an option.

Two recommendations:

First, try it without pages. Just put all your just in the preferences section. Yeah, it’ll make for a long input (especially when scrolling on the mobile screen) but at least you’ll be able to test that it all works that way and then know that it’s something with pages vs. something wrong with the code.

Second, try looking at some of the sample apps or share apps that use pages and try to figure out the proper syntax from those. I thought I saw somewhere that you needed to indicate which page was next or something like that… but maybe that was in the preferences section?