I’m configuring MQTT Things using a Things File and have a problem with translations when using a contact type. Both of these below don’t work.
Type contact : Contact5 "My Door" [stateTopic="cmnd/MyDevice/POWER5", open="ON", closed="OFF"] Type contact : Contact5Status "My Door Status" [stateTopic="tele/MyDevice/SENSOR", transformationPattern="JSONPATH:$.Switch5", open="ON", closed="OFF"]
I’ve checked on the broker and I am getting “ON” and “OFF” as messages, and the topics are correct. In the log I get
Command 'OFF' not supported by type 'OpenCloseValue': No enum constant org.eclipse.smarthome.core.library.types.OpenClosedType.OFF
I could just ignore the contact item, rewrite all my contact related rules, and only use switches, but it makes more sense that a door or window is either “open” or “closed” instead of “on” or “off”. The first item did work with a simple MQTT1 map file defined in the items file.