In the last part of the switch i received the Telemetrie from the Sonoff and Update / Initialized the Switch automatically after an Openhab restart, because the Sonoff will send the Telemetry Data all few minutes.
rule "Item Schlafzimmer_Beamer_tele changed"
when
Item Schlafzimmer_Beamer_tele changed
then
if (Schlafzimmer_Beamer_tele.state != NULL && !Schlafzimmer_Beamer_tele.state.equals(Schlafzimmer_Beamer.state)) {
Schlafzimmer_Beamer.sendCommand(Schlafzimmer_Beamer_tele.state.toString());
}
end
That may work but these two state topics stat/sonoff_TH/POWER and tele/sonoff_TH/STATE have different transformation paths ($ and $.POWER respectively), so I’m not sure this exact example will work.
Nope that doesn’t work. Each configuration can be applied once only. Two channels is the way to go.
Paper UI will show both channels, yes. But Paper UI is really bad at presenting controls and is really meant to be used for configuration. Use HabPanel or the Android/iOS apps, they base their presentation on Items, which is the right thing to do.
Your solution with the rule is also viable of course. Just be aware that openHAB slows down a bit with every additional (old style) rule.
I ran into nearly the same issue. I found a simple workaround that was suitable for me. I created a rule that sends the “POWER” command without an argument to my Sonoff/Tasmota devices. It looks like this:
rule "Systemstart"
when System started
then logInfo("Haus", "--- SYSTEMSTART ---")
val actions = getActions("mqtt","mqtt:broker:broker")
actions.publishMQTT("cmnd/sonoff-9D7XXX/POWER1","") //Licht GWC
actions.publishMQTT("cmnd/sonoff-9D7XXX/POWER2","") // LĂĽfter GWC
actions.publishMQTT("cmnd/sonoff-740XXX/POWER","") // Licht Hobbykeller
end