I set slider value, device receives the value and performs task per value sent. However, the slider then resets to min value, in my case "0", sends the "0" where the code performs task per "0" value, not what I want. Is the slider suppose to stay at the value I set? If so, why does it not stay at that value?

Hi, you should define the resources to also support reporting the current value. From documentation:

Our sketch usually defines some parameters or variables that are used inside the loop code. This kind of resources are normally used to handle or control the execution behaviour. With this kind of resources we can modify any parameter we want to expose, like a float, an integer, a boolean, etc.In this example it is possible to remotelly modify the boolean sdLogging variable defined as a global variable.

thing["logging"] << inputValue(sdLogging);

It is also possible to define a callback function to know when the variable has changed, so we can perform any other action. For this use case, define the resource as the following to have some code executed when the hysteresisVar changes.

The slide setting now stays at last state and only changes when I move the slide.

The choice to use and the original design of "C++ 11 Lambda Functions" is genius. I have to admit, I'm not a seasoned C++ user so when I first had to setup a Thinger.io resource, I was clueless as to how it worked. I spent some time understanding C++ 11 Lambda Functions (here's a video I found helpful; https://www.youtube.com/watch?v=uk0Ytomv0wY ), very convenient and powerful.

Nice you get it working! Yes, using lambdas allowed a clean code and an easy resource definition. Resources in thinger are like callbacks that can receive and/or generate output... so, they are finally functions. The above definition, inputValue, is simple a macro that is translated to the same lambda you have posted, but in a compact format. But understanding the basic concepts, allows you more flexibility

Thanks for this post, it really was very useful and the solution was quite easy. Paul, I was looking for information about the lambda functions and the video you posted was very timely. Thank you.

I have a question, I have some sensors that are not permanently on, and I would like the variable that is obtained from the dashboard through the slide widget will not be reset every time the device is turned on. Is this possible?