Configuring and Using an Actuator Setting

In the final step, we want to be able to easily control our device by using the generic actuator interface. This allows us to have a vendor independent access to all of our devices, similar to our sensor setting.

Creating the Setting

Open the configuration that you have previously created and add a new Actuator setting to it. The structure closely matches the structure of sensor definitions.

{
  "archetype": "LIGHT",
  "actuatorModule": [
    {
      "description": "Toggles the device LED on/off",
      "module": "abcd01f0",
      "component": 1,
      "register": 2,
      "offset": 0,
      "length": 1,
      "type": "SET_LIGHT",
      "dataType": "UINT8",
      "unit": "ON_OFF"
    }
  ]
}

Once you have configured and published you configuration, your device is ready to be controlled by using our MQTT actuator interface:

actuator publish

//The topic
rltn-iot/ORGA_UUID/NETWORK_UUID/DEVICE_UUID/actuator/SET_LIGHT/0/actuatorData

//Payload: Use 1 to switch the LED on, 0 to switch it off
{
  "value": 1,
  "timestamp": 1628857259621
}
Using the actuator interface will currently only use the actionType WRITE. Other actionTypes will be added in the future.

Wrapping it Up

Once everything is implemented, tested and your device is nearing production, you are ready to define the device catalog entries in our final chapter for this how to.