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.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`stateTransformation`| One or more transformation (concatenated with `∩`) used to convert device data to channel state, e.g. `REGEX:.*?STATE=(.*?);.*`| string, number, dimmer, switch, rollershutter |
87
-
|`commandTransformation`| One or more transformation (concatenated with `∩`) used to convert command to device data, e.g. `JS:device.js`| string, number, dimmer, switch, rollershutter |
86
+
|`stateTransformation`| One or more transformation (concatenated with `∩`) used to convert device data to channel state, e.g. `REGEX(.*?STATE=(.*?);.*)`| string, number, dimmer, switch, rollershutter |
87
+
|`commandTransformation`| One or more transformation (concatenated with `∩`) used to convert command to device data, e.g. `JS(device.js)`| string, number, dimmer, switch, rollershutter |
88
88
|`commandFormat`| Format string applied to the command before transform, e.g. `ID=671;COMMAND=%s`| string, number, dimmer, rollershutter |
89
89
|`onValue`| Send this value when receiving an ON command | switch, dimmer |
90
90
|`offValue`| Send this value when receiving an OFF command | switch, dimmer |
@@ -94,6 +94,11 @@ The configuration for the `serialBridge` channels consists of the following para
94
94
|`downValue`| Send this value when receiving a DOWN command | rollershutter |
95
95
|`stopValue`| Send this value when receiving a STOP command | rollershutter |
96
96
97
+
Transformations can be chained in the UI by listing each transformation on a separate line, or by separating them with the mathematical intersection character "∩".
98
+
Transformations are defined using this syntax: `TYPE(FUNCTION)`, e.g.: `JSONPATH($.path)`.
99
+
The syntax: `TYPE:FUNCTION` is still supported, e.g.: `JSONPATH:$.path`.
100
+
Please note that the values will be discarded if one transformation fails (e.g. REGEX did not match).
101
+
97
102
## Full Example
98
103
99
104
The following example is for a device connected to a serial port which provides data for many different sensors and we are interested in the temperature from a particular sensor.
Copy file name to clipboardExpand all lines: bundles/org.openhab.binding.serial/src/main/java/org/openhab/binding/serial/internal/SerialHandlerFactory.java
Copy file name to clipboardExpand all lines: bundles/org.openhab.binding.serial/src/main/java/org/openhab/binding/serial/internal/channel/ChannelConfig.java
Copy file name to clipboardExpand all lines: bundles/org.openhab.binding.serial/src/main/java/org/openhab/binding/serial/internal/channel/DeviceChannel.java
Copy file name to clipboardExpand all lines: bundles/org.openhab.binding.serial/src/main/java/org/openhab/binding/serial/internal/channel/DeviceChannelFactory.java
Copy file name to clipboardExpand all lines: bundles/org.openhab.binding.serial/src/main/java/org/openhab/binding/serial/internal/channel/DimmerChannel.java
Copy file name to clipboardExpand all lines: bundles/org.openhab.binding.serial/src/main/java/org/openhab/binding/serial/internal/channel/NumberChannel.java
Copy file name to clipboardExpand all lines: bundles/org.openhab.binding.serial/src/main/java/org/openhab/binding/serial/internal/channel/RollershutterChannel.java
Copy file name to clipboardExpand all lines: bundles/org.openhab.binding.serial/src/main/java/org/openhab/binding/serial/internal/channel/StringChannel.java
Copy file name to clipboardExpand all lines: bundles/org.openhab.binding.serial/src/main/java/org/openhab/binding/serial/internal/channel/SwitchChannel.java
Copy file name to clipboardExpand all lines: bundles/org.openhab.binding.serial/src/main/java/org/openhab/binding/serial/internal/handler/SerialDeviceHandler.java
Copy file name to clipboardExpand all lines: bundles/org.openhab.binding.serial/src/main/java/org/openhab/binding/serial/internal/transform/CascadedValueTransformationImpl.java
0 commit comments