Good news, everyone, I now also figured out point (5). Because I am still on the official version 2.2, I had to use org.openhab.binding.velux-2.2.0-SNAPSHOT.jar from https://github.com/gs4711/org.openhab.binding.velux (which I had expected and which I simply copied to OpenHAB’s openhab2-addons directory). It now turns out, however, that the documentation on the mentioned GitHub page is incorrect (w.r.t. the needed options to link to the KLF 200 and some of the syntax of the options—in many cases ALLCAPS are needed) at least for this pre-compiled 2.2.0 snapshot version. The correct configuration is as follows (the Expire binding is needed in addition; example with 2 sets of shutters as defined on the KLF 200, with an open and a close action/scene/program each).
*.things file:
Bridge velux:klf200:home [ bridgeURL="http://192.168.x.y", bridgePassword="velux123", timeoutMsecs=4000, retries=10 ] {
Thing scene RS_Shutters1_Open [ sceneName="RS_Shutters1_Open" ]
Thing scene RS_Shutters1_Close [ sceneName="RS_Shutters1_Close" ]
Thing scene RS_Shutters2_Open [ sceneName="RS_Shutters2_Open" ]
Thing scene RS_Shutters2_Close [ sceneName="RS_Shutters2_Close" ]
}
*.items file:
// Velux KLF 200 bridge channels
String VELUX_BRIDGE_STATUS "Velux Bridge Status" { channel="velux:klf200:home:STATUS" }
String VELUX_BRIDGE_FIRMWARE "Velux Bridge Firmware version" { channel="velux:klf200:home:FIRMWARE" }
String VELUX_BRIDGE_IPADDRESS "Velux Bridge IP Address" { channel="velux:klf200:home:IPADDRESS" }
String VELUX_BRIDGE_SUBNETMASK "Velux Bridge IP Subnet Mask" { channel="velux:klf200:home:SUBNETMASK" }
String VELUX_BRIDGE_DEFAULTGW "Velux Bridge Default Gateway" { channel="velux:klf200:home:DEFAULTGW" }
Switch VELUX_BRIDGE_DHCP "Velux Bridge DHCP Enabled [%s]" { channel="velux:klf200:home:DHCP" }
String VELUX_BRIDGE_WLANSSID "Velux Bridge SSID" { channel="velux:klf200:home:WLANSSID" }
String VELUX_BRIDGE_WLANPASSWD "Velux Bridge WLAN Password" { channel="velux:klf200:home:WLANPASSWORD" }
Switch VELUX_BRIDGE_DO_DETECTION "Velux Bridge Detection mode [%s]" { channel="velux:klf200:home:DETECTION" }
// one group for the actual items that talk to the KLF 200
Group gSomfyActual "Actual Velux/Somfy Action Items"
// one group for the virtual items used for control on the sitemap
Group:Number gSomfyVirtual "Virtual Velux/Somfy Action Items"
// Velux/Somfy scene channels
Switch SomfyRS_Shutters1_Open "Somfy Shutters1 Open" (gSomfyActual) { channel="velux:scene:home:RS_Shutters1_Open:ACTION", expire="1s,command=OFF" }
Switch SomfyRS_Shutters1_Close "Somfy Shutters1 Close" (gSomfyActual) { channel="velux:scene:home:RS_Shutters1_Close:ACTION", expire="1s,command=OFF" }
Switch SomfyRS_Shutters2_Open "Somfy Shutters2 Open" (gSomfyActual) { channel="velux:scene:home:RS_Shutters2_Open:ACTION", expire="1s,command=OFF" }
Switch SomfyRS_Shutters2_Close "Somfy Shutters2 Close" (gSomfyActual) { channel="velux:scene:home:RS_Shutters2_Close:ACTION", expire="1s,command=OFF" }
// Velux/Somfy scene actual controls (virtual)
Number SomfyRS_Shutters1 "Somfy Shutters1" <rollershutter> (gSomfyVirtual) { expire="1s,command=0" }
Number SomfyRS_Shutters2 "Somfy Shutters2" <rollershutter> (gSomfyVirtual) { expire="1s,command=0" }
*.sitemaps excerpt:
Frame label="Rollershutters" {
Switch item=SomfyRS_Shutters1 label="Roller Shutters 1" mappings=[1="▼", 2="▲"]
Switch item=SomfyRS_Shutters2 label="Roller Shutters 2" mappings=[1="▼", 2="▲"]
}
Frame label="Infos/Settings" {
Text item=VELUX_BRIDGE_STATUS
Text item=VELUX_BRIDGE_FIRMWARE
Text item=VELUX_BRIDGE_IPADDRESS
Text item=VELUX_BRIDGE_SUBNETMASK
Text item=VELUX_BRIDGE_DEFAULTGW
Text item=VELUX_BRIDGE_DHCP
Text item=VELUX_BRIDGE_WLANSSID
Text item=VELUX_BRIDGE_WLANPASSWD
Text item=VELUX_BRIDGE_DO_DETECTION
}
*.rules file:
rule "Velux-Somfy Action"
when
Item gSomfyVirtual changed
then
gSomfyVirtual.members.filter( s | (s.state as DecimalType) == 2).forEach[item |
var actionItem = gSomfyActual.members.findFirst[name.equals(item.name.toString + "_Open")]
actionItem.sendCommand(ON)
]
gSomfyVirtual.members.filter( s | (s.state as DecimalType) == 1).forEach[item |
var actionItem = gSomfyActual.members.findFirst[name.equals(item.name.toString + "_Close")]
actionItem.sendCommand(ON)
]
end
Of course, no guarantees, yet things seem to work now for my configuration. There may still be some situations that I need to check, such as what happens when the system start up or reboots, but I hope this helps some of you. So long story short, you can control Somfy io roller shutters from OpenHAB using the Velux KLF 200.
Cheers,
Tobias