Hi,
I need help for this: I convert my working Mqtt 1.14.0 binding in 2.5 version, for most of items it work fine, but for one item i have trouble.
In 1.14.0 version
xxx.items was
…
Switch EtatProjo “Etat de projecteur " (Gr_Piscine) {autoupdate=“false”, mqtt=”>[mosquitto:/Piscine/CmdProjo:command:ON:ON],>[mosquitto:/Piscine/CmdProjo:command:OFF:ON],<[mosquitto:/Piscine/Projo:state:ON:M],<[mosquitto:/Piscine/Projo:state:OFF:A]"}
…
The hardware behind is a bistable relais command by “ON” patern and the return information is “A” or “M” (Marche or Arret)
Result:
error message:
2020-01-14 09:13:36.034 [WARN ] [ab.binding.mqtt.generic.ChannelState] - Command ‘A’ not supported by type ‘OnOffValue’:
No enum constant org.eclipse.smarthome.core.library.types.OnOffType.A
For command, it’s OK, for return information how to convert “A” or “M” in OFF or ON ?
I also try to use Paper UI for thin items, but i do not see where i convert “A” or “M” to OFF or ON
You need to introduce transformationPattern to channel configuration which will convert A to OFF and M to ON. see details from mqtt binding documentation. MAP transformation is most probably easiest for this.
Yes i see “Incoming Value Transformation” chapter in documentation, but for me an example is missing.
Can you give me the syntax for on-off.map where on-off.map contain A=OFF B=ON