With a bit of planning, you can make sure that your IoT devices stay in sync with the cloud and behave in a predictable way for your users. The concept uses a "desired state" that is watched by the device for changes from the cloud. The device then reports back its actual state as a separate collection of data.