Join GitHub today
Create Custom Sensor
The custom sensor is meant to handle string values. The sensor can just pass the string on, but its power is in the option to map strings to other alpha-numerical strings. In the User Interface labels can be given multiple texts, and with the image widget multiple images can be defined to represent the different states of a device.
Switch to the "Building Modeler" view in the designer.
Create or use an existing "read" command for your device which returns a string value.
In the "Create New Device" dialog click "Add Sensor", or select an existing device in the left-hand side device tree and choose "New Sensor".
In the "New Sensor" dialog, give your sensor a descriptive name (this name will be visible to User Interface designers) and select the read command that is used to retrieve the device's string value.
Select "Custom" as the sensor type -- this will tell the User Interface components bound to this sensor what type of values to expect. If you only need the string just finalise the sensor creation by pushing the Submit button.
If you need to convert your readings for example to the on or off value that a binary switch requires, do add the mappings as shown below: the retrieved values in the Value column, and the resulting values to be used by the switch under the column Name
Note: The mapping is not effective in the User Interface Designer widgets Label, and Image. There you have to do the mappings once more.