kann man eigentlich if abfragen AND und OR abfragen verbinden bzw gruppieren
also z.b. IF (A AND B == 1) OR (C AND D == 0) then ...
mir war so das das nicht ging.
hintergrund ich würde gerne im folgenden Code nur je einmal publishmqtt haben.
also z.b. IF (A AND B == 1) OR (C AND D == 0) then ...
mir war so das das nicht ging.
hintergrund ich würde gerne im folgenden Code nur je einmal publishmqtt haben.
Code:
if pbutton(ButtonID,PageID)==1 and (TasmotaMqtt^PlugName^Power == $OFF$) then {
publishmqtt(uHandle, $cmnd/^PlugName^/POWER$, 0, 0b01, $ON$, 0u16);
GruppenAdresse == AUS;
} endif
if pbutton(ButtonID,PageID)==1 and (TasmotaMqtt^PlugName^Power == $ON$) then {
publishmqtt(uHandle, $cmnd/^PlugName^/POWER$, 0, 0b01, $OFF$, 0u16);
GruppenAdresse == EIN;
} endif
if eventwrite(GruppenAdresse) and (GruppenAdresse == EIN) then {
publishmqtt(uHandle, $cmnd/^PlugName^/POWER$, 0, 0b01, $ON$, 0u16);
}endif
if eventwrite(GruppenAdresse) and (GruppenAdresse == AUS) then {
publishmqtt(uHandle, $cmnd/^PlugName^/POWER$, 0, 0b01, $OFF$, 0u16);
}endif


Kommentar