Here is my question, does the broker connection need to be in the same file as the bridge? I seem to have had some instability moving the broker connection out? Also, does it hurt to have multiple connections to the same mqtt broker?
This is the line in question from below: “mqtt:broker:TreasureBox “TreasureBox (Mosquitto)” [ host=“192.168.1.200”,secure=false, username=“user”, password=“pass” ]” Can it be in a separate file? I was trying to group my sonoff things together.
mqtt:broker:TreasureBox "TreasureBox (Mosquitto)" [ host="192.168.1.200",secure=false, username="user", password="pass" ]
Bridge mqtt:broker:TreasureBox
{
Thing topic HolidaySwitch1 "Holiday Switch 1(Sonoff Basic)" {
Channels:
Type switch : Power "Holiday Switch 1 Power" [ stateTopic="stat/sonoff/holidayswitch1/POWER", commandTopic="cmnd/sonoff/holidayswitch1/POWER" ]
//Type switch : fancylamp "Fancy Lamp" [ stateTopic="fancy/lamp/state", commandTopic="fancy/lamp/command", on="i-am-on", off="i-am-off" ]
//Type string : alarmpanel "Alarm system" [ stateTopic="alarm/panel/state", commandTopic="alarm/panel/set", allowedStates="ARMED_HOME,ARMED_AWAY,UNARMED" ]
//Type color : lampcolor "Kitchen Lamp color" [ stateTopic="lamp/color", commandTopic="lamp/color/set", rgb=true ]
//Type dimmer : blind "Blind" [ stateTopic="blind/state", commandTopic="blind/set", min=0, max=5, step=1 ]
}
Thing topic AutoPlug "AutoPlug" {
Channels:
Type switch : Power "AutoPlug Power" [ stateTopic="stat/sonoff/autoplug/POWER", commandTopic="cmnd/sonoff/autoplug/POWER" ]
//Type switch : fancylamp "Fancy Lamp" [ stateTopic="fancy/lamp/state", commandTopic="fancy/lamp/command", on="i-am-on", off="i-am-off" ]
//Type string : alarmpanel "Alarm system" [ stateTopic="alarm/panel/state", commandTopic="alarm/panel/set", allowedStates="ARMED_HOME,ARMED_AWAY,UNARMED" ]
//Type color : lampcolor "Kitchen Lamp color" [ stateTopic="lamp/color", commandTopic="lamp/color/set", rgb=true ]
//Type dimmer : blind "Blind" [ stateTopic="blind/state", commandTopic="blind/set", min=0, max=5, step=1 ]
}
}