lwm2m.oir.write action
The lwm2m.oir.read trigger action will write the value of a resource or values of all the resources associated with an object.
Action
To access the lwm2m.oir.write trigger action:
- In the Adding trigger screen, under Lwm2m click and drag the lwm2m.oir.write to the canvas.
Canvas
When dragged onto the canvas, the appearance of the action is a rectangle with two routing points.
The left routing point (red) is the failure route. This route will be taken if there is an error during execution.
The right routing point (green) is the success route. This route will be taken if action executes successfully.
Form
Resource Instance Type Handling
When working with LwM2M resources in triggers, you'll encounter two types of resources: Single Instance and Multiple Instance. Each type has specific options for how the resource should be updated.
Resource Types and Options
Resources Types | Options | Form |
---|---|---|
Single Instance Resources |
|
![]() |
Multiple Instance Resources |
|
![]() |
Parameters
Name | Type | Required | Description |
---|---|---|---|
Thing key | String | Yes | The thing key of the LWM2M device. |
Object | String | Yes | Click on the Object drop-down and then select the object that contains the resource to be written |
Instance ID | String | Yes | The Instance ID of the object that contains the resource or resources to be written. |
Resource | String | The Resource that needs to be updated | |
Encoding | Integer | The encoding that needs to be done. | |
Value | String | Yes | The value to be written. The Value must be in JSON format when writing to multiple resources. For example: {"MultipleResId1":"value1", "MultipleResId2":"value2"} |
Replace | Boolean | The default behavior is to perform a partial update (transmitting the data using the POST method code), to only change the values of the fields specified in the data parameter. When the Replace flag is selected (and set to true), the message will be sent using the PUT method code, and the device will use the data provided to completely overwrite the path, by first erasing all information at the specified path and writing only the values specified in the data parameter. |
To write an empty string to a resource or resource instance, use the Unicode string termination character "\u0000" as the value.

The value to be written. Multiple resources and can be written using two formats: Array and Map. The difference in behavior between the two are:
Array:
Will lead to a write of a list of values without specifying the index to the device. The first value will be written in position 1, the second in position 2 and so on for the consecutive positions;
Example writing a multiple resource:
{["value1", "value2",..., "valueN"]}
Example writing more resources of an instance (one single and one multiple resources):
{"resIdX":"valueN", "resIdMultipleY":["value1", "value2",..., "valueN"]}
Map:
Will lead to a write where the values will be written in relation to a specific key index. Positions can be consecutive or not, this will follow the key index reported in the API.
Example writing a multiple resource:
{..., "keyIndexK":"valueK", ..., "keyIndexN":"valueN", ...}
Example writing more resources of an instance (one single and one multiple resources):
{"resIdX":"valueX", "resIdMultipleY":{..., "keyIndexK":"valueK", ..., "keyIndexN":"valueN", ...}}