Hi
I made a test to switch a Shelly 2 with MQTT.
I managed to configure MQTT Broker, Things and Items automatically. Because I want more control I tried to setup everything manually with things and items files. This works fine too.
For structural reasons, I tried to separate broker and shelly.things file - a separate things file for the broker and a separate for the shellies (ans separate files for other devices which will come later, I’m sure).
Unfortunatelly I didn’t get it to work after separation.
Has anyone manged to do this?
Thanks a lot
Jan
Bridge mqtt:broker:Mqtt_Broker_xxx "MQTT Broker xxx" @ "MQTT" [
host="192.168.1.xxx",
port=1883,
secure="AUTO",
qos=0,
retain=true,
//clientid="xxx",
//certificate="",
//certificatepin=false,
//publickey="",
//publickeypin=false,
keep_alive_time=30000,
reconnect_time=60000,
//lastwill_message="",
//lastwill_qos=1,
//lastwill_topic="",
username="xxx",
password="xxx"
]
// Separate here into 2 separate things files...
{
Thing topic Sh_Sw_Shelly01 "Sh_Sw_Shelly01" @ "MQTT" { // this must be then something like mqtt:topic:Mqtt_Broker_xxx:Sh_Sw_Shelly01
Channels:
Type switch : Schalter "Switch" [ stateTopic="shellies/shellyswitch-xxx/relay/0", commandTopic="shellies/shellyswitch-32BF97/relay/0/command", on="on", off="off" ]
Type number : Power "Power" [ stateTopic="shellies/shellyswitch-xxx/relay/power" ]
} // end of thing
}