EMQPERSIST – report a set value to the device shadow
Report a set value to the device shadow/twin. The operation depends on which AWSSHADOW
mode you set, either simple
or complete
.
You set AWSSHADOW
in the Configuration File. For more information, see
AWSSHADOW simple
mode
The shadow ETM performs the following automatically:
- Generates the JSON
state
andreported
ordesired
objects - Subscribes to the
shadow/update/delta
topic, and filters out the containing objects - Presents the host with the state object JSON content only, sent via URC
The host only sends the content of the reported
object.
AWSSHADOW complete
mode
The host sends the complete JSON for the shadow to ETM.
ETM sends the complete shadow message as a URC, without filtering.
EMQPERSIST commands
Type | Syntax | Returned Result |
---|---|---|
Test |
AT+EMQPERSIST=? |
OK
EMQPERSIST:<json> |
Read |
AT+EMQPERSIST? |
OK or ERROR |
Write |
AT+EMQPERSIST=<JSON> where JSON is the JSON code, which depends on the AWSSHADOW mode you configured. For Either the content of the AT+EMQPERSIST="{\"key\":value}" where If the passed-in text does not include If the passed-in text includes For example, for the reported text:
For example, for reported and desired text:
{\"state\":{\"reported\":{\"key\":\"value\"},\"desired\":{\"key\":\"value\"}}}. For The complete JSON data for the shadow/update topic is required, in this format: AT+EMQPERSIST="{\"state\":{\"reported\":{\"key\":value}}}" where
|
OK
SEND OK or ERROR |
Examples
For Simple
mode:
AT+EMQPERSIST="{\"Temperature\":-3.5}"
AT+EMQPERSIST="{\"Colour\":\"Blue\"}"
For Complete
mode, including setting AWSSHADOW to complete:
AT+EMQPERSIST="{\"state\":{\"reported\":{\"Temperature\":28.0}}}"