[Bug] Issue With Dynamic Page


(Jonny) #1

I am not certain where to post bug reports or issues, but just noticed an issue when using dynamicPage in a smart app. Using the code below, the function is being called twice every interval causing the logging to spiral out of control.

definition(
    name: "TestApp",
    namespace: "randuhmm",
    author: "Jonny Morrill",
    description: "testing",
    category: "",
    iconUrl: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png",
    iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png",
    iconX3Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png")

preferences {
    page(name: "testFunc", title: "Test Func", content: "testFunc")
}

def testFunc() {
    log.debug 'testFunc()'
    dynamicPage(name: "testFunc", title: "Test Func", nextPage: "", refreshInterval: 5, install: true, uninstall: true) {
        section("Example...") {
        }
    }
}

The logs for this SmartApp look like this:

9779fd5c-b67e-4916-8b60-8873bef14562 9:46:38 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:38 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:38 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:38 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:38 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:38 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:38 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:38 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:38 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:38 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:38 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:38 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:38 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:38 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:38 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:37 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:37 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:37 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:37 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:37 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:37 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:37 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:37 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:37 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:37 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:37 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:37 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:37 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:37 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:37 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:37 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:37 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:33 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:33 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:32 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:32 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:32 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:32 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:32 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:32 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:32 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:32 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:32 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:32 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:32 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:32 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:27 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:27 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:27 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:27 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:27 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:27 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:26 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:26 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:21 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:21 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:21 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:21 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:16 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:16 PM: debug testFunc()
9779fd5c-b67e-4916-8b60-8873bef14562 9:46:11 PM: debug testFunc()

As you can see the number of concurrent function calls is increasing exponentially every cycle. It would be a great help if anyone could confirm this behavior on their end. Thanks!


[RELEASE] Konnected Security 2.0 - Connect Wired Alarm System Sensors and Siren to SmartThings - big update and new name!
(Mike Maxwell) #3

Try setting refreshInterval to 0…


(Jason "The Enabler" as deemed so by @Smart) #4

Try thinking next page and actual name, or, just remove that.


(Jonny) #5

Setting the refreshInterval property to zero disables the refresh entirely, which is not my intention. I do need the refresh enabled so that I can periodically execute a function.


(Jonny) #6

Removing the nextPage="" property did not change the behavior =/ good call tho as it is unnecessary.


(Mike Maxwell) #7

Yea, I get that, it was just a test…


(Jason Mok) #8
def testFunc() {
    log.debug 'testFunc()'
    if(!state.pageRefresh ) { state.pageRefresh = 2 }
    state.pageRefresh =  state.pageRefresh + 2
    dynamicPage(name: "testFunc", title: "Test Func", refreshInterval:  state.pageRefresh , install: true, uninstall: true) {
        section("Example...") {
        }
    }
}
updated() {
     state.pageRefresh = 2
}

Use this code to ease off the refresh. nevertheless, it’s still a bug on ST’s end


(Jonny) #9

Nice work-around! Works pretty well from my initial tests.