I want to define a contact item for every door/window.
I don’t get the state directly though, I use Nikobus and I get a switch command (to ON via binding) when the door is opened and another switch command (to ON via binding) when door is closed.
My current config works but I define 2 switches and 1 contact and 2 rules to basically define one door/window contact
I’m wondering, is there a smarter way to define the contact, for example by directly linking the Nikobus binding to the contact (similar as the usual MQTT binding links with contact)
This is my current configuration
items:
Switch BI_1_Close_DeurKeuken {nikobus="#N2792A6"}
Switch BI_1_Open_DeurKeuken {nikobus="#N6792A6"}
Contact ContactDeurKeuken "Deur keuken"
Rule:
rule "Keuken deur dicht" when Item BI_1_Close_DeurKeuken received update ON then postUpdate(ContactDeurKeuken,CLOSED) end
rule "Keuken deur open" when Item BI_1_Open_DeurKeuken received update ON then postUpdate(ContactDeurKeuken, OPEN) end
I just would like to make my code a bit more elegant