…and that’s what you’ve defined in your Channel stateTopic
and commandTopic
, which is correct.
However, your openHAB Thing is called
ShellyDuoBulb_EntrywayLight
and your openHAB Item should only call on openHAB Things. Your Item should be:
Switch ShellyDuoBulb_EntrywayLight_Power "Entryway Light" {channel="mqtt:topic:Nomads_MQTT_Broker:ShellyDuoBulb_EntrywayLight:power"}
I think the problem you are having is that sometimes small edits to Things files are not being stored properly by openHAB - I’ve just tried to re-create your issue, and I get the same problem (I’m on OH 2.5.9). To fix this, you can either just restart openHAB, or corrupt your Things file and save it so that all your Things are unloaded, then un-corrupt your things file and re-save it. By ‘corrupt’, I meant take out a { or an important word such as Thing
.
I have got it all working with the following setup (adjusted to your original OP):
things
Thing topic ShellyDuoBulb_EntrywayLight "ShellyDuoBulb_EntrywayLight" {
Channels:
Type string:reachable "Reachable" [
stateTopic="shellies/Entryway-Light/online"
]
Type switch:power "Power" [
stateTopic="shellies/Entryway-Light/light/0",
commandTopic="shellies/Entryway-Light/light/0/command",
on="on",
off="off"
]
}
items
Switch ShellyDuoBulb_EntrywayLight_Power "Entryway Light" {alexa="Switchable", channel="mqtt:topic:Nomads_MQTT_Broker:ShellyDuoBulb_EntrywayLight:power"}
String ShellyDuoBulb_EntrywayLight_Reachable "EntrywayLight_Reachable" {channel="mqtt:topic:Nomads_MQTT_Broker:ShellyDuoBulb_EntrywayLight:reachable"}
Sending
on
or
off
to
shellies/Entryway-Light/light/0
Now causes the Item ShellyDuoBulb_EntrywayLight_Power
to switch on or off.
For completeness, my test setup is slightly different, because I use a separate Things file for my MQTT broker definition. I also don’t have Alexa. Here is what I actually used.
bridge.things
Bridge mqtt:broker:MosquittoMqttBroker "Mosquitto MQTT Broker" [
host="192.168.1.92",
secure=false,
port=1883,
clientID="OpenHAB2",
username="",
password=""
]
test.things
Thing mqtt:topic:ShellyDuoBulb_EntrywayLight "ShellyDuoBulb_EntrywayLight" (mqtt:broker:MosquittoMqttBroker) {
Channels:
Type string:reachable "Reachable" [
stateTopic="shellies/Entryway-Light/online"
]
Type switch:power "Power" [
stateTopic="shellies/Entryway-Light/light/0",
commandTopic="shellies/Entryway-Light/light/0/command",
on="on",
off="off"
]
}
test.items
Switch ShellyDuoBulb_EntrywayLight_Power "Entryway Light" {channel="mqtt:topic:ShellyDuoBulb_EntrywayLight:power"}
String ShellyDuoBulb_EntrywayLight_Reachable "EntrywayLight_Reachable" {channel="mqtt:topic:ShellyDuoBulb_EntrywayLight:reachable"}