@Sascha_Billian @alexspitz This configuraion knows when the hardware button or rf button was pressed and change state in basicui.
This is now my working settings
mqtt.things
Bridge mqtt:broker:mosquitto "Mosquitto MQTT Broker" @ "MQTT" [ host="localhost", secure=false, port=1883, clientID="Oh2Mqtt2"]
{
// Main Light
Thing mqtt:topic:SonoffMainLight "Main Light" @ "MQTT" {
Channels:
Type switch : switch "Power Switch" [
stateTopic="tasmota/sonoff-mainlight/POWER",
commandTopic="tasmota/sonoff-mainlight/cmnd/POWER",
on="ON",
off="OFF"
]
Type string : state02 "Switch State 02" [
stateTopic="stat/sonoff-mainlight/POWER",
on="ON",
off="OFF"
]
}
// Bed Light
Thing mqtt:topic:SonoffBedLight "Bed Light" @ "MQTT" {
Channels:
Type switch : switch "Power Switch" [
stateTopic="tasmota/sonoff-bedlight/POWER",
commandTopic="tasmota/sonoff-bedlight/cmnd/POWER",
on="ON",
off="OFF"
]
Type string : state02 "Switch State 02" [
stateTopic="stat/sonoff-bedlight/POWER",
on="ON",
off="OFF"
]
}
// Sonoff Amplifier
Thing mqtt:topic:SonoffAmplifier "Sonoff Amplifier" @ "MQTT" {
Channels:
Type switch : switch "Power Switch" [
stateTopic="tasmota/sonoff-amplifier/POWER",
commandTopic="tasmota/sonoff-amplifier/cmnd/POWER",
on="ON",
off="OFF"
]
Type string : state02 "Switch State 02" [
stateTopic="stat/sonoff-amplifier/POWER",
on="ON",
off="OFF"
]
}
}
sonoff.items
/*
Main Light
*/
Switch SonoffMainLight_Switch "Main Light Switch" <lightbulb> ["Lighting"] { channel="mqtt:topic:SonoffMainLight:switch" }
String SonoffMainLight_State "Main Light State" { channel="mqtt:topic:SonoffMainLight:state02", channel="mqtt:topic:SonoffMainLight:switch" }
/*
Bed Light
*/
Switch SonoffBedLight_Switch "Bed Light Switch" <lightbulb> ["Lighting"] { channel="mqtt:topic:SonoffBedLight:switch" }
String SonoffBedLight_State "Bed Light State" { channel="mqtt:topic:SonoffBedLight:state02", channel="mqtt:topic:SonoffBedLight:switch" }
/*
Amplifier
*/
Switch SonoffAmplifier_Switch "Amplifier Switch" <player> ["Switchable"] { channel="mqtt:topic:SonoffAmplifier:switch" }
String SonoffAmplifier_State "Amplifier State" { channel="mqtt:topic:SonoffAmplifier:state02", channel="mqtt:topic:SonoffAmplifier:switch" }
EDIT (added SONOFF MQTT Config Screen):