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.
Retain Device Status while offline
-
- Posts: 309
- Joined: Wed Feb 20, 2019 7:02 am
Re: Retain Device Status while offline
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).
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).
Who is online
Users browsing this forum: No registered users and 71 guests