String value to resource gets extra escaping when written from cloud action

Hi,

I have a virtual resource (“SampleState”) that I once in a while wants to write to from a cloud action. I want to write the value “shutdown” (without the quotes).
The type of quote (’ vs ") does not change the behavior. I write the value like this

      "elems": {
        "virtual": {
          "SampleState": {
            "value": ['shutdown'] 
                   }

And here is the debug log, note this line
Jun 22 14:48:50 fx30s user.info Legato: INFO | cloudInterface[1268]/cloudcomp T=main | operation.c RunPushValue() 358 | admin_PushJson("/app/virtual/SampleState/value",0, "["shutdown"]")

Is this a bug or should I be doing this differently?

Jun 22 14:48:50 fx30s user.debug Legato:  DBUG | avcDaemon[1240]/avcDaemon T=main | osDebug.c lwm2m_printf() 84 | [lwm2m_handle_packet:602] Entering
Jun 22 14:48:50 fx30s user.debug Legato:  DBUG | avcDaemon[1240]/avcDaemon T=main | osDebug.c lwm2m_printf() 84 | [lwm2m_handle_packet:608] Parsed: blk: 0 ver 1, type 0, tkl 8, code 0.03, mid 15977, Content type: 60
Jun 22 14:48:50 fx30s user.debug Legato:  DBUG | avcDaemon[1240]/avcDaemon T=main | osDebug.c lwm2m_printf() 84 | [lwm2m_handle_packet:609] Payload: x?{"t":2,"i":368,"r":{"/virtual/SampleState/value":["shutdown"]}}
Jun 22 14:48:50 fx30s user.debug Legato:  DBUG | avcDaemon[1240]/avcDaemon T=main | osDebug.c lwm2m_printf() 84 | [handle_request:237] Entering
Jun 22 14:48:50 fx30s user.debug Legato:  DBUG | avcDaemon[1240]/avcDaemon T=main | coap.c CoapMessageHandler() 312 | Rx Msg from server: code 3 streamStatus 0 contentType 60 length 65
Jun 22 14:48:50 fx30s user.debug Legato:  DBUG | avcDaemon[1240]/avcDaemon T=main | osDebug.c lwm2m_printf() 84 | [lwm2mcore_ExeCommandEndHandler:1920] No command request end handler to invoke
Jun 22 14:48:50 fx30s user.debug Legato:  DBUG | avcDaemon[1240]/avcDaemon T=main | osDebug.c lwm2m_printf() 84 | [lwm2m_handle_packet:727] lwm2mcore_ExeCommandEndHandler returns 0
Jun 22 14:48:50 fx30s user.debug Legato:  DBUG | avcDaemon[1240]/avcDaemon T=main | osDebug.c lwm2m_printf() 84 | [lwm2mcore_ExecPostRequestHandler:1888] No post-request session handler to invoke
Jun 22 14:48:50 fx30s user.debug Legato:  DBUG | avcDaemon[1240]/avcDaemon T=main | osTimer.c lwm2mcore_TimerIsRunning() 216 | LWM2MCORE_TIMER_INACTIVITY timer is running 1
Jun 22 14:48:50 fx30s user.debug Legato:  DBUG | avcDaemon[1240]/avcDaemon T=main | osTimer.c lwm2mcore_TimerSet() 103 | lwm2mcore_TimerSet LWM2MCORE_TIMER_INACTIVITY (id:1, time 20 sec)
Jun 22 14:48:50 fx30s user.debug Legato:  DBUG | avcDaemon[1240]/avcDaemon T=main | osTimer.c lwm2mcore_TimerSet() 127 | Update previously created timer LWM2MCORE_TIMER_INACTIVITY
Jun 22 14:48:50 fx30s user.debug Legato:  DBUG | avcDaemon[1240]/framework T=main | timer.c le_timer_Start() 1104 | Starting timer 'LWM2MCORE_TIMER_INACTIVITY'
Jun 22 14:48:50 fx30s user.info Legato:  INFO | cloudInterface[1268]/cloudcomp T=main | av.c validateRequest() 434 | PATH: /cloudInterface/dh/cmd
Jun 22 14:48:50 fx30s user.info Legato:  INFO | cloudInterface[1268]/cloudcomp T=main | command.c cmd_StoreCommand() 61 | Server sent command: {"t":2,"i":368,"r":{"/virtual/SampleState/value":["shutdown"]}}
Jun 22 14:48:50 fx30s user.warn Legato: -WRN- | configMonitor[1269]/configMonitor T=main | configMonitor.c cloud_cm_StartMonitoring() 274 | '/app/virtual/SampleState/value' will not be monitored as app did not register
Jun 22 14:48:50 fx30s user.debug Legato:  DBUG | cloudInterface[1268]/cloudcomp T=main | util.c freeHash() 39 | Cleaning key "/app/virtual/SampleState/value" in map "commands"
Jun 22 14:48:50 fx30s user.info Legato:  INFO | cloudInterface[1268]/cloudcomp T=main | command.c cmd_StoreCommand() 122 | Server sent command is valid
Jun 22 14:48:50 fx30s user.info Legato:  INFO | avcDaemon[1240]/avcDaemon T=main | coap.c le_coap_SendResponse() 504 | Response: CoAP response from app
Jun 22 14:48:50 fx30s user.debug Legato:  DBUG | avcDaemon[1240]/avcDaemon T=main | osDebug.c lwm2m_printf() 84 | [lwm2mcore_ConnectionGetType:1565] state 5 --> isDeviceManagement 1
Jun 22 14:48:50 fx30s user.debug Legato:  DBUG | avcDaemon[1240]/avcDaemon T=main | osDebug.c lwm2m_printf() 84 | [GetRegisteredServer:1315] State: STATE_READY, shortServerId: 1
Jun 22 14:48:50 fx30s user.debug Legato:  DBUG | avcDaemon[1240]/avcDaemon T=main | osDebug.c lwm2m_printf() 84 | [prv_send_response:1126] Response code = 68
Jun 22 14:48:50 fx30s user.debug Legato:  DBUG | avcDaemon[1240]/avcDaemon T=main | osDebug.c lwm2m_printf() 84 | [prv_send_response:1127] Payload length = 0
Jun 22 14:48:50 fx30s user.debug Legato:  DBUG | avcDaemon[1240]/avcDaemon T=main | osDebug.c lwm2m_printf() 84 | [prv_send_response:1132] Block2 transfer 0/0/0 @ 0 bytes
Jun 22 14:48:50 fx30s user.debug Legato:  DBUG | avcDaemon[1240]/avcDaemon T=main | osDebug.c lwm2m_printf() 84 | [prv_send_response:1137] Block1 transfer 0/0/0 @ 0 bytes
Jun 22 14:48:50 fx30s user.debug Legato:  DBUG | avcDaemon[1240]/avcDaemon T=main | osDebug.c lwm2m_printf() 84 | [message_send:1478] Entering
Jun 22 14:48:50 fx30s user.debug Legato:  DBUG | avcDaemon[1240]/avcDaemon T=main | osDebug.c lwm2m_printf() 84 | [message_send:1480] Size to allocate: 39
Jun 22 14:48:50 fx30s user.debug Legato:  DBUG | avcDaemon[1240]/avcDaemon T=main | osDebug.c lwm2m_printf() 84 | [message_send:1487] coap_serialize_message() returned 28
Jun 22 14:48:50 fx30s user.debug Legato:  DBUG | avcDaemon[1240]/avcDaemon T=main | osTime.c lwm2m_gettime() 44 | Device time: 1624366130
Jun 22 14:48:50 fx30s user.debug Legato:  DBUG | avcDaemon[1240]/avcDaemon T=main | osTime.c lwm2m_gettime() 44 | Device time: 1624366130
Jun 22 14:48:50 fx30s user.debug Legato:  DBUG | avcDaemon[1240]/avcDaemon T=main | osDebug.c lwm2m_printf() 84 | [ConnectionSend:974] now - connP->lastSend 0
Jun 22 14:48:50 fx30s user.debug Legato:  DBUG | avcDaemon[1240]/avcDaemon T=main | osDebug.c lwm2m_printf() 84 | [ConnectionSend:975] now - connP->lastReceived 0
Jun 22 14:48:50 fx30s user.debug Legato:  DBUG | avcDaemon[1240]/avcDaemon T=main | osDebug.c lwm2m_printf() 84 | [ConnectionSend:976] DtlsNatTimeout 86400
Jun 22 14:48:50 fx30s user.debug Legato:  DBUG | avcDaemon[1240]/avcDaemon T=main | osDebug.c lwm2m_printf() 84 | [ConnectionSend:1007] ConnectionSend SEC length 28
Jun 22 14:48:50 fx30s user.debug Legato:  DBUG | avcDaemon[1240]/avcDaemon T=main | osDebug.c lwm2m_printf() 84 | [SendData:270] SendData
Jun 22 14:48:50 fx30s user.debug Legato:  DBUG | avcDaemon[1240]/avcDaemon T=main | osDebug.c lwm2m_printf() 84 | [SendData:291] Sending 57 bytes to [52.17.142.62]:5686
Jun 22 14:48:50 fx30s user.debug Legato:  DBUG | avcDaemon[1240]/avcDaemon T=main | osTime.c lwm2m_gettime() 44 | Device time: 1624366130
Jun 22 14:48:50 fx30s user.debug Legato:  DBUG | cloudInterface[1268]/cloudcomp T=main | main.c ExecCommand() 288 | Executing received command
Jun 22 14:48:50 fx30s user.info Legato:  INFO | cloudInterface[1268]/cloudcomp T=main | operation.c RunPushValue() 358 | admin_PushJson("/app/virtual/SampleState/value",0, "["shutdown"]")
Jun 22 14:48:50 fx30s user.debug Legato:  DBUG | dataHub[1297]/framework T=main | mem.c le_mem_ForceAlloc() 1172 | Memory pool 'dataHub.Small String Sample' overflowed. Expanded to 64 blocks.
Jun 22 12:48:50 fx30s user.debug Legato:  DBUG | actions[1200]/actionRunner T=main | actionRunner.c actionRunner_JSInputJsonPushHandler() 677 | Action l60630328337dab5dbbdd962f not enabled/loaded

Regards
Jes

Hello Jes,

Have you tried,

which shoudl work

A.