Create Custom Sensor

Pierre Kil edited this page Nov 30, 2017 · 4 revisions

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.

  1. Switch to the "Building Modeler" view in the designer.

  2. Create or use an existing "read" command for your device which returns a string value.

  3. 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".

Building Modeler

Custom 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.

See Also

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.