I have my MQTT things and channels defined in .things files. Ever since I upgraded from OH2, the MQTT binding seems to ignore the on/off overrides on all channels on certain things, but not on others.
I have these two things right next to one another:
Thing mqtt:topic:gate-opener-se (mqtt:broker:27f53c46) @ "MQTT" {
Channels:
Type number : temperature [ stateTopic="gate/opener-061313/temperature" ]
Type number : humidity [ stateTopic="gate/opener-061313/humidity" ]
Type switch : relaych1 [ commandTopic="gate/opener-061313/relaych1", on="1000", off="off" ]
Type switch : relaych2 [ commandTopic="gate/opener-061313/relaych2", on="1000", off="off" ]
Type contact : status1 [ stateTopic="gate/opener-061313/status1", on="0", off="1" ]
Type contact : status2 [ stateTopic="gate/opener-061313/status2", on="0", off="1" ]
}
Thing mqtt:topic:gate-sensor-se (mqtt:broker:27f53c46) @ "MQTT" {
Channels:
Type switch : light [ commandTopic="gate/sensor-0f0c06/light-cmnd", on="1", off="0" ]
Type contact : sensor1 [ stateTopic="gate/sensor-0f0c06/status1", on="0", off="1" ]
Type contact : sensor2 [ stateTopic="gate/sensor-0f0c06/status2", on="no", off="ffo" ]
}
The first one works, the second one doesn’t, which is confirmed by the generated code in the administration web UI. For the first one it says:
UID: mqtt:topic:gate-opener-se
label: Generic MQTT Thing
thingTypeUID: mqtt:topic
configuration: {}
bridgeUID: mqtt:broker:27f53c46
location: MQTT
channels:
- id: temperature
channelTypeUID: mqtt:number
label: Number Value
description: null
configuration:
retained: false
postCommand: false
step: 1
formatBeforePublish: "%s"
stateTopic: gate/opener-061313/temperature
- id: humidity
channelTypeUID: mqtt:number
label: Number Value
description: null
configuration:
retained: false
postCommand: false
step: 1
formatBeforePublish: "%s"
stateTopic: gate/opener-061313/humidity
- id: relaych1
channelTypeUID: mqtt:switch
label: On/Off Switch
description: null
configuration:
commandTopic: gate/opener-061313/relaych1
retained: false
postCommand: false
formatBeforePublish: "%s"
off: off
on: "1000"
- id: relaych2
channelTypeUID: mqtt:switch
label: On/Off Switch
description: null
configuration:
commandTopic: gate/opener-061313/relaych2
retained: false
postCommand: false
formatBeforePublish: "%s"
off: off
on: "1000"
- id: status1
channelTypeUID: mqtt:contact
label: Open/Close Contact
description: null
configuration:
retained: false
postCommand: false
formatBeforePublish: "%s"
stateTopic: gate/opener-061313/status1
off: "1"
on: "0"
- id: status2
channelTypeUID: mqtt:contact
label: Open/Close Contact
description: null
configuration:
retained: false
postCommand: false
formatBeforePublish: "%s"
stateTopic: gate/opener-061313/status2
off: "1"
on: "0"
While the second one looks like this:
UID: mqtt:topic:gate-sensor-se
label: Generic MQTT Thing
thingTypeUID: mqtt:topic
configuration: {}
bridgeUID: mqtt:broker:27f53c46
location: MQTT
channels:
- id: light
channelTypeUID: mqtt:switch
label: On/Off Switch
description: null
configuration:
commandTopic: gate/sensor-0f0c06/light-cmnd
retained: false
postCommand: false
formatBeforePublish: "%s"
- id: sensor1
channelTypeUID: mqtt:contact
label: Open/Close Contact
description: null
configuration:
retained: false
postCommand: false
formatBeforePublish: "%s"
stateTopic: gate/sensor-0f0c06/status1
- id: sensor2
channelTypeUID: mqtt:contact
label: Open/Close Contact
description: null
configuration:
retained: false
postCommand: false
formatBeforePublish: "%s"
stateTopic: gate/sensor-0f0c06/status2
Before upgrading to OH3, on/off overrides worked on all things.
Anyone has any ideas what could have gone wrong here?