Examples of using Environment Variables

I can see the Device OS API for this feature but there aren't any examples.

Can I check System.getEnv() each loop or should this be on a less frequent basis.

You typically only get the value once. Even if changed on the cloud side while your firmware is running, the change is only applied when the device reboots, so there is no real advantage of getting the value constantly.

Device-level environment variables that are added, removed, or changed are delivered immediately to online devices that have not disabled updates. These are delivered via an OTA update, and the device will have the new values available when the device reboots. Firmware running on the device will never see the value change while running.

OK - that is clear now. So I will just test for the value in Setup(). I must have missed this documentation somewhere.