Using the IoT Cloud and a web Dashboard with a Nano 33 IoT, some "Read & Write" variables.
When my Nano reboots, I set some important default values that will always work -- a safety measure. So if it doesn't have network, it should all "just work."
I have these as "onChange" Read & Write values on the web Dashboard so they can be adjusted in real-time. Problem: If my Nano reboots, it picks up these adjusted values on the Dashboard, not "my" defaults.
Example: I have a Read & Write thermostat setting on the Dashboard, which my script sets to 440. If the Nano reboots, it will start out with the 440, but then it will take on the value on the Dashboard, even if the Dashboard has not been moved since the Nano has rebooted.
I have tried setting the values both before and after ArduinoCloud in setup(). Same result.
I might be able to put a flag in the "onChange" areas of the code to "ignore the first 'change'" -- that's the only thing I can think to try at the mo (outside of editing automatically generated code, which I don't want to do). Is this what other people do?
Q1: How can I make it so that if the Nano reboots I can use "my" default values no matter what the web Dashboard says? Then if someone uses the Dashboard to change the slider, the new value would be used.
Q1a: If this is "doable," is there an option to "have it both ways"? To both force my defaults (and ignore the Dashboard) at reboot OR to go ahead and use the Dashboard values at reboot? I can see both as valuable.
I noted a similar item here, but I think it's the reverse of my request:
Thanks!