Class ControllerProtocol

java.lang.Object
org.openremote.agent.protocol.AbstractProtocol<ControllerAgent,ControllerAgentLink>
org.openremote.agent.protocol.controller.ControllerProtocol
All Implemented Interfaces:
org.openremote.model.asset.agent.Protocol<ControllerAgent>

public class ControllerProtocol extends AbstractProtocol<ControllerAgent,ControllerAgentLink>
This is a Controller 2.5 protocol to communicate with a running Controller 2.5 instance and getting sensor's status and executing commands.

The protocol communicate with Controller by using Controller REST API.

The protocol manage two kinds of request :

  • A set of polling requests (one by controller/device name couple) pollingSensorList. For each request we just wait for a response 200 (new status) or 403 (timeout after 60 seconds) and relaunch the same request as soon as we have one of those two responses.
  • Executing commands provided by Write Attribute with necessary information. There is different kind of situations explained in ControllerCommand

Two cases are considered:

  • A sensor : if we want to link an attribute to a controller 2.5 sensor to get status we should create an Attribute with proper type considering the situation (temperature, time,...) and two necessary META ControllerAgent#META_DEVICE_NAME and ControllerAgent#META_SENSOR_NAME
  • A command : if we want to execute a command on a controller 2.5, we create an attribute with the following available META (see details in ControllerCommand) : ControllerAgent#META_DEVICE_NAME or ControllerAgent#META_COMMAND_DEVICE_NAME, ControllerAgent#META_COMMAND_NAME or ControllerAgent#META_COMMANDS_MAP