Page 1 of 1

Retain Device Status while offline

Posted: Mon Nov 06, 2023 3:43 pm
by mark.waters
Is it possible to retain the state of a rainmaker device while offline?

Ideally I would like to make change to a device state while it is offline so that when it is powered on it could read the state from the cloud side and update itself accordingly.

For example, with an RGB bulb, the colour could be changed on the app while the device is offline, then when powered on it would immediately change to requested colour.

Re: Retain Device Status while offline

Posted: Fri Nov 10, 2023 7:38 pm
by ESP_Piyush
Hi Mark,

We have a command-response feature available already which is not yet mentioned in the docs but has been silently introduced in the led_light example along with usage instructions. Basically you can create a command (in your case, the device state) with a timeout . If the device is online, it will get those values right away, but if it is offline, it will fetch all pending commands when it comes online and perform those operations. You can choose appropriate timeout based on your case. The timeout is in seconds and can have max value of 2592000 (30 days).