This thing is driving my crazy. I have searched all over the web but can’t find the answer to my question…
state.currentLevel = "${devices*.currentValue("level")[0]}"
log.debug "${state.currentLevel}"
state.nextLevel = state.currentLevel + 1
log.debug "nextLevel"
log.debug "${state.nextLevel}"
Example
currentLevel 's value is 7. Then I want to add 1 to the value for nextLevel. Should be 8, but it becomes 71. Why??
In the smartapp developers guide they have exactly the same code.
state.switchCounter = state.switchCounter + 1
What am I doing wrong?