So now I would like to have an additional real switch (using installed MDT KNX hardware taster devices) to control this SONOFF. I already searched for topics discussing this, but unfortunately I didn’t found one.
I thought by creating a virtual KNX address for switching and status (done in ETS5 and assigned to the hardware switch on my wall) and then linking the item together in OH, would work.
knx.things
Type switch : eg_treppenlicht "Light" [ ga="11/1/21+<11/4/21"]
rule "Treppenlicht an"
when
Item eg_treppenlicht changed
then
val itemStatus = eg_treppenlicht.state
sendTelegram("bot1", "Status "+ itemStatus)
if(itemStatus == ON)
sonoff_1343.sendCommand(ON)
timer = Timer.createTimer(now.plusSeconds(3) [|
sonoff_1343.sendCommand(OFF)
timer = null
])
if(itemStatus == OFF)
sonoff_1343.sendCommand(OFF)
end
error:
2019-01-13 15:35:36.670 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule ‘Treppenlicht an’: ‘createTimer’ is not a member of ‘java.lang.Class’; line 37, column 12, length 98
So only open is the problem about getting the current status or an status update back to the knx bus.
Because currently the knx status will not being updated.
So i think there should be a way like your first approach. Using a rule for such a task (ON/OFF) is - overkill.
Now i’am moving to the new KNX2 binding and OH 2.4. Therewhile only my KNX devices work. Not to think of rules …
I will post again here, when i the same question as you - or perhaps a solution.
I tried to use the Control Channel Types from KNX Binding documentation, because I thought this will be the right way, but unfortunately I don’t get status ON/OFF on knx bus. So the wall switch lamp didn’t change its status…