- **transformationPattern**: An optional transformation pattern like [JSONPath](https://goessner.net/articles/JsonPath/index.html#e2) that is applied to the incoming availability payload.
The result of the transformations is then checked against `payloadAvailable` and `payloadNotAvailable`.
- **string**: This channel can show the received text on the given topic and can send text to a given topic.
- **number**: This channel can show the received number on the given topic and can send a number to a given topic. It can have a min, max and step values.
- **dimmer**: This channel handles numeric values as percentages. It can have min, max and step values.
- **contact**: This channel represents an open/close state of a given topic.
- **switch**: This channel represents an on/off state of a given topic and can send an on/off value to a given topic.
- **colorRGB**: This channel handles color values in RGB format. (Deprecated)
- **colorHSB**: This channel handles color values in HSB format. (Deprecated)
- **color**: This channel handles color values in HSB, RGB or xyY (x,y,brightness) formats.
- **location**: This channel handles a location.
- **image**: This channel handles binary images in common java supported formats (bmp,jpg,png).
- **datetime**: This channel handles date/time values.
- **rollershutter**: This channel is for rollershutters.
- **stateTopic**: The MQTT topic that represents the state of the thing. This can be empty, the thing channel will be a state-less trigger then. You can use a wildcard topic like "sensors/+/event" to retrieve state from multiple MQTT topics.
- **transformationPattern**: An optional transformation pattern like [JSONPath](https://goessner.net/articles/JsonPath/index.html#e2) that is applied to all incoming MQTT values.
- **transformationPatternOut**: An optional transformation pattern like [JSONPath](https://goessner.net/articles/JsonPath/index.html#e2) that is applied before publishing a value to MQTT.
- **commandTopic**: The MQTT topic that commands are send to. This can be empty, the thing channel will be read-only then. Transformations are not applied for sending data.
- **formatBeforePublish**: Format a value before it is published to the MQTT broker. The default is to just pass the channel/item state. If you want to apply a prefix, say "MYCOLOR,", you would use "MYCOLOR,%s". Currently only "%s" is supported.
- **postCommand**: If `true`, the received MQTT value will not only update the state of linked items, but command it.
You usually need this to be `true` if your item is also linked to another channel, say a KNX actor, and you want a received MQTT payload to command that KNX actor.
- **retained**: The value will be published to the command topic as retained message. A retained value stays on the broker and can even be seen by MQTT clients that are subscribing at a later point in time.
- **qos**: QoS of this channel. Overrides the connection QoS (defined in broker connection).
- **trigger**: If `true`, the state topic will not update a state, but trigger a channel instead.
- **step**: For decrease, increase commands the step needs to be known
- **unit**: Unit of measurement (optional). For supported units see [OpenHAB: List of Units](https://www.openhab.org/docs/concepts/units-of-measurement.html#list-of-units). Examples: "°C", "°F"
- **colorMode**: An optional string that defines the color representation: `HSB`, `RGB` or `XYY` (x,y,brightness). Defaults to `HSB` when not specified.
- **on**: An optional string (like "BRIGHT") that is recognized as on state. (ON will always be recognized.)
- **off**: An optional string (like "DARK") that is recognized as off state. (OFF will always be recognized.)
- **onBrightness**: If you connect this channel to a Switch item and turn it on,
color and saturation are preserved from the last state, but
the brightness will be set to this configured initial brightness (default: 10%).
You can connect this channel to a Color, Dimmer and Switch item.
This channel will publish the color as comma separated list to the MQTT broker,
e.g. "112,54,123" for the RGB color mode (0-255 per component), "360,100,100" for the HSB color mode (0-359 for hue and 0-100 for saturation and brightness),
and "0.640074,0.329970,100" for the xyY color mode (0-1 for x and y, and 0-100 for brightness).
The channel expects values on the corresponding MQTT topic to be in this format as well.
### Channel Type "colorRGB", "colorHSB" (Deprecated)
color and saturation are preserved from the last state, but
the brightness will be set to this configured initial brightness (default: 10%).
You can connect this channel to a Color, Dimmer and Switch item.
This channel will publish the color as comma separated list to the MQTT broker,
e.g. "112,54,123" for an RGB channel (0-255 per component) and "360,100,100" for a HSB channel (0-359 for hue and 0-100 for saturation and brightness).
The channel expects values on the corresponding MQTT topic to be in this format as well.
### Channel Type "location"
You can connect this channel to a Location item.
The channel will publish the location as comma separated list to the MQTT broker,
In the first example a secure connection to a broker is defined. It pins the returned certificate and public key. If someone tries a man in the middle attack later on, this broker connection will recognize it and refuse a connection. Be aware that if your brokers certificate changes, you need to remove the connection entry and add it again.
The second connection is a plain, unsecured one. Use this only for local MQTT Brokers.
A third connection uses a username and password for authentication. The credentials are plain values on the wire, therefore you should only use this on a secure connection.
In a fourth connection, the public key pinning is enabled again. This time, a public key hash is provided to pin the connection to a specific server. It follows the form "hashname:hashvalue". Valid hashnames are SHA-1, SHA-224, SHA-256, SHA-384, SHA-512 and all others listed in Java MessageDigest Algorithms.
Type switch : power [ stateTopic="stat/bedroom1-switch/RESULT", transformationPattern="REGEX((.*POWER.*))∩JSONPATH($.POWER)", commandTopic="cmnd/bedroom1-switch/POWER" ]
}
```
The transformation pattern can be chained using the intersection character "∩" as above, or by listing them separately:
Type switch : power [ stateTopic="stat/bedroom1-switch/RESULT", transformationPattern="REGEX((.*POWER.*))","JSONPATH($.POWER)", commandTopic="cmnd/bedroom1-switch/POWER" ]
[Transformations](/docs/configuration/transformations.html) can be applied to:
- Incoming availability payload
- Incoming value
- Outgoing value
Transformations can be chained in the UI by listing each transformation on a separate line, or by separating them with the mathematical intersection character "∩".
Transformations are defined using this syntax: `TYPE(FUNCTION)`, e.g.: `JSONPATH($.path)`.
The syntax: `TYPE:FUNCTION` is still supported, e.g.: `JSONPATH:$.path`.
Please note that the values will be discarded if one of the transformations failed (e.g. REGEX did not match) or returned `null`.
- All uppercase: "%S". Just use the upper case letter for the conversion argument.
- Apply a prefix: "myprefix%s"
- Apply a suffix: "%s suffix"
- Number precision: ".4f" for a 4 digit precision. Use the "+" flag to always add a sign: "+.4f".
- Decimal to Hexadecimal/Octal/Scientific: For example "60" with "%x", "%o", "%e" becomes "3C", "74", "60".
- Date/Time: To reference the item state multiple times, use "%1$". Use the "tX" conversion where "X" can be any of [h,H,m,M,I,k,l,S,p,B,b,A,a,y,Y,d,e].
- For an output of _May 23, 1995_ use "%1$**tb** %1$**te**,%1$**tY**".
- For an output of _23.05.1995_ use "%1$**td**.%1$**tm**.%1$**tY**".
- For an output of _23:15_ use "%1$**tH**:%1$**tM**".
| **number** | BigDecimal | "%f" | The default will remove trailing zeros after the decimal point. |
| **dimmer** | BigDecimal | "%f" | The default will remove trailing zeros after the decimal point. |
| **contact** | String | -- | No pattern supported. Always **on** and **off** strings. |
| **switch** | String | -- | No pattern supported. Always **on** and **off** strings. |
| **colorRGB** | BigDecimal, BigDecimal, BigDecimal | "%1$d,%2$d,%3$d" | Parameters are **red**, **green** and **blue** components. |
| **colorHSB** | BigDecimal, BigDecimal, BigDecimal | "%1$d,%2$d,%3$d" | Parameters are **hue**, **saturation** and **brightness** components. |
| **location** | BigDecimal, BigDecimal | "%2$f,%3$f,%1$f" | Parameters are **altitude**, **latitude** and **longitude**, altitude is only in default pattern, if value is not '0'. |
- If you get the error "No MQTT client": Please update your installation.
- If you use the Mosquitto broker: Please be aware that there is a relatively low setting for retained messages. If at some point messages stop being delivered change the setting.