HM-SEC-RHS feat. openHAB

Unlike with the windows, simply controlling the roller shutters on the patio doors with an open or closed state, as I was able to do with a magnetic contact for the windows, isn’t sufficient. Since a door that’s pulled shut but unlocked needs to be treated like an open door and keep the roller shutter up, I looked at the Homematic HM-SEC-RHS window handle contacts and integrated them into my home automation system. Unlike a contact with only two states (open/closed), this sensor now recognizes three (open/tilted/closed).
1 HomeMatic radio-controlled window rotary handle sensor HM-SEC-RHS
For my window contacts, I rely on a low-budget solution with magnetic contacts, which gives me the state open (open or tilted) or closed. WWhat the sensors cannot do, however, is the state “locked”. For the shutter control of the patio doors this can be problematic when the sun goes down, which means that the shutters are lowered, but I’m fetching firewood. Nobody then wants to have to wait until dawn on the terrace (if possible in winter) for the shutters to allow access again.
So I need a sensor on the patio doors that tells me the locking status. Here I rely on the HomeMatic HM-SEC-RHS, which is simply inserted under the rotary handle of the window.
In openHAB, this contact can be integrated as usual via UI or text file:
// conf/things/homematic.things
Bridge homematic:bridge:XXX1234567 [ gatewayAddress="?",gatewayType="ccu",callbackHost="?" ]
{
Thing HM-Sec-RHS YYY1234567 "door"
}// conf/items/myitems.items
String Door_State "Door [%s]" {channel="homematic:HM-Sec-RHS:XXX1234567:YYY1234567:1#STATE"}The HomeMatic binding only returns the state for this device as a string. In a provisional arrangement, I had a rule that reacted to changes to the string item and then updated the status of the actual contact item. A bit of a hassle, I think. My current solution does the mapping directly on the item configuration by the “map” transformation extension:
// conf/items/myitems.items
Contact Door_State "Door [MAP(window.map):%s]" {channel="homematic:HM-Sec-RHS:XXX1234567:YYY1234567:1#STATE" [profile="transform:MAP", function="homematic2contact.map"] }// conf/transform/homematic2contact.map
CLOSED=CLOSED
OPEN=OPEN
TILTED=OPEN
=UNDEFBanner image on Pixabay.
