Skip to content

Commit

Permalink
[velux] Initial contribution (openhab#2531)
Browse files Browse the repository at this point in the history
Initial contribution

Signed-off-by: Guenther Schreiner <guenther.schreiner@smile.de>
  • Loading branch information
gs4711 authored and andrewfg committed Aug 31, 2020
1 parent 20f83b2 commit 7d06999
Show file tree
Hide file tree
Showing 181 changed files with 21,470 additions and 0 deletions.
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@
/bundles/org.openhab.binding.valloxmv/ @bjoernbrings
/bundles/org.openhab.binding.vektiva/ @octa22
/bundles/org.openhab.binding.velbus/ @cedricboon
/bundles/org.openhab.binding.velux/ @gs4711
/bundles/org.openhab.binding.vitotronic/ @steand
/bundles/org.openhab.binding.volvooncall/ @clinique
/bundles/org.openhab.binding.weathercompany/ @mhilbush
Expand Down
5 changes: 5 additions & 0 deletions bom/openhab-addons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,11 @@
<artifactId>org.openhab.binding.velbus</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.velux</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.vitotronic</artifactId>
Expand Down
13 changes: 13 additions & 0 deletions bundles/org.openhab.binding.velux/NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
This content is produced and maintained by the openHAB project.

* Project home: https://www.openhab.org

== Declared Project Licenses

This program and the accompanying materials are made available under the terms
of the Eclipse Public License 2.0 which is available at
https://www.eclipse.org/legal/epl-2.0/.

== Source Code

https://github.com/openhab/openhab2-addons
397 changes: 397 additions & 0 deletions bundles/org.openhab.binding.velux/README.md

Large diffs are not rendered by default.

66 changes: 66 additions & 0 deletions bundles/org.openhab.binding.velux/doc/conf/items/velux.items
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/**
*
* Copyright (c) 2010-2020 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*/

/**
* OpenHAB item defintion for velux binding:
* Velux Bridge and Devices
*
* @author Guenther Schreiner - Initial contribution
*/

// Group for simulating push buttons

Group:Switch:OR(ON, OFF) gV "PushButton"

// Velux Bridge channels

String V_BRIDGE_STATUS "Velux Bridge Status [%s]" { channel="velux:klf200:home:status" }
Switch V_BRIDGE_RELOAD "Velux Bridge Reload" (gV) { channel="velux:klf200:home:reload" }
String V_BRIDGE_TIMESTAMP "Velux Bridge Timestamp [%d]" { channel="velux:klf200:home:timestamp" }

String V_BRIDGE_FIRMWARE "Velux Bridge Firmware version [%s]" { channel="velux:klf200:home:firmware" }
String V_BRIDGE_IPADDRESS "Velux Bridge LAN IP Address" { channel="velux:klf200:home:ipAddress" }
String V_BRIDGE_SUBNETMASK "Velux Bridge LAN IP Subnet Mask" { channel="velux:klf200:home:subnetMask" }
String V_BRIDGE_DEFAULTGW "Velux Bridge LAN Default Gateway" { channel="velux:klf200:home:defaultGW" }
String V_BRIDGE_DHCP "Velux Bridge LAN DHCP Enabled" { channel="velux:klf200:home:DHCP" }
String V_BRIDGE_WLANSSID "Velux Bridge WLAN SSID" { channel="velux:klf200:home:WLANSSID" }
String V_BRIDGE_WLANPASSWD "Velux Bridge WLAN Password" { channel="velux:klf200:home:WLANPassword" }

Switch V_BRIDGE_DETECTION "Velux Bridge Detection mode" (gV) { channel="velux:klf200:home:doDetection" }
String V_BRIDGE_CHECK "Velux Bridge Check" { channel="velux:klf200:home:check" }
String V_BRIDGE_SCENES "Velux Bridge Scenes" { channel="velux:klf200:home:scenes" }
String V_BRIDGE_PRODUCTS "Velux Bridge Products" { channel="velux:klf200:home:products" }

// Velux Scene channels

Switch V_DG_M_W_OPEN "Velux DG Window open" (gV) { channel="velux:scene:home:windowOpened:action" }
Switch V_DG_M_W_UNLOCKED "Velux DG Window a little open" (gV) { channel="velux:scene:home:windowUnlocked:action" }
Switch V_DG_M_W_CLOSED "Velux DG Window closed" (gV) { channel="velux:scene:home:windowClosed:action" }

// Velux Bridge channel

Rollershutter RS2 "Velux Rolladen 2 [%d]" { channel="velux:klf200:home:shutter#0,V_DG_Shutter_Ost_000,100,V_DG_Shutter_Ost_100", channel="knx:device:bridge:control:VeluxFenster" }


// Velux Actuator channels

Rollershutter V_DG_M_W "DG Fenster Bad [%d]" { channel="velux:klf200:home:V_DG_M_W" }
Rollershutter V_DG_M_W2 "DG Fenster Bad [%d]" { channel="velux:klf200:home:V_DG_M_W2" }
Rollershutter V_DG_M_S "DG Bad [%d]" { channel="velux:klf200:home:V_DG_M_S" }
Rollershutter V_DG_W_S "DG West [%d]" { channel="velux:klf200:home:V_DG_W_S" }
Rollershutter V_DG_O_S "DG Ost [%d]" { channel="velux:klf200:home:V_DG_O_S" }

//
// vim: syntax=Xtend vim: noai:ts=4:sw=4
//
// end-of-items/velux.items
//
37 changes: 37 additions & 0 deletions bundles/org.openhab.binding.velux/doc/conf/rules/velux.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/**
*
* Copyright (c) 2010-2020 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*/

/**
* OpenHAB rules for velux binding:
* This rule simulates the push button behaviour.
*
* @author Guenther Schreiner - Initial contribution
*/

rule "PushButton of group gV"
when
Item gV changed
then
// waiting a second.
Thread::sleep(1000)
// Foreach-Switch-is-ON
gV.allMembers.filter( s | s.state == ON).forEach[i|
// switching OFF
i.sendCommand(OFF)
]
end

//
// vim: syntax=Xtend vim: noai:ts=4:sw=4
//
// end-of-rules/velux.rules
//
59 changes: 59 additions & 0 deletions bundles/org.openhab.binding.velux/doc/conf/sitemaps/velux.sitemap
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/**
*
* Copyright (c) 2010-2020 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*/

/**
* OpenHAB sitemap definition for velux binding:
* displays most of the Velux items
*
* @author Guenther Schreiner - Initial contribution
*/

sitemap velux label="Velux Environment"
{
Frame label="Velux Shutter and Window" {

Switch item=V_DG_M_W_OPEN
Switch item=V_DG_M_W_UNLOCKED
Switch item=V_DG_M_W_CLOSED
Slider item=V_DG_M_W
}

Frame label="Velux Bridge Status" {
Text item=V_BRIDGE_STATUS
Text item=V_BRIDGE_TIMESTAMP
Switch item=V_BRIDGE_RELOAD
}

Frame label="Velux Bridge Status" {
Switch item=V_BRIDGE_DETECTION
Text item=V_BRIDGE_CHECK
Text item=V_BRIDGE_SCENES
Text item=V_BRIDGE_PRODUCTS
}

Frame label="Velux Bridge Configuration" {
Text item=V_BRIDGE_FIRMWARE
Text item=V_BRIDGE_IPADDRESS
Text item=V_BRIDGE_SUBNETMASK
Text item=V_BRIDGE_DEFAULTGW
Switch item=V_BRIDGE_DHCP
Text item=V_BRIDGE_WLANSSID
Text item=V_BRIDGE_WLANPASSWD
}

}

//
// vim: syntax=Xtend vim: noai:ts=4:sw=4
//
// end-of-sitemap/velux.sitemap
//
30 changes: 30 additions & 0 deletions bundles/org.openhab.binding.velux/doc/conf/things/velux-001.things
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
*
* Copyright (c) 2010-2020 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*/

/**
* OpenHAB thing definition for velux binding:
* define a Velux device behind the bridge
*
* @author Guenther Schreiner - Initial contribution
*/

//
// Definition of a Velux window behind bridge velux:klf200:gs28
//

Thing velux:window:gs28:window001 (velux:klf200:gs28) [ serial="53:09:40:5A:0C:2A:05:64" ]

//
// vim: syntax=Xtend vim: noai:ts=4:sw=4
//
// end-of-things/velux-bridge.things
//
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
*
* Copyright (c) 2010-2020 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*/

/**
* OpenHAB thing definition for velux binding:
* define basic Velux bridge parameters
*
* @author Guenther Schreiner - Initial contribution
*/

//
// Definition of Velux bridge velux:klf200:home
//

Bridge velux:klf200:gs28 [ ipAddress="192.168.45.1", tcpPort=51200, password="secret", isProtocolTraceEnabled=true ]

//
// vim: syntax=Xtend vim: noai:ts=4:sw=4
//
// end-of-things/velux-bridge.things
//
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/**
*
* Copyright (c) 2010-2020 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*/

/**
* OpenHAB thing definition for velux binding:
* define basic Velux bridge parameters
*
* This is a definition which corresponds to the output of th Bridge
* during startup, i.e.
*
* [INFO ] [x.internal.handler.VeluxBridgeHandler] - Found velux actuators:
* Product "#0" / SLIDER_SHUTTER (bridgeIndex=0,serial=56:32:14:5A:12:1C:05:5F,position=0000)
* Product "#1" / SLIDER_SHUTTER (bridgeIndex=1,serial=53:09:40:5A:0C:23:0A:6E,position=0000)
* Product "DG-M-Window" / SLIDER_WINDOW (bridgeIndex=3,serial=56:23:3E:26:0C:1B:00:10,position=C800)
* Product "#2" / SLIDER_SHUTTER (bridgeIndex=2,serial=53:09:40:5A:0C:2A:05:64,position=0000)
* Product "#4" / SWITCH (bridgeIndex=4,serial=Somfy-Switch,position=C800)
* Product "#5" / SWITCH (bridgeIndex=5,serial=Somfy-Switch,position=C800)
*
* @author Guenther Schreiner - Initial contribution
*/

//
// Definition of Velux bridge velux:klf200:home
//

Bridge velux:klf200:home [ ipAddress="192.168.45.9", tcpPort=51200, password="verySecret" ] {

// Velux scenes

Thing scene windowClosed [ sceneName="V_DG_Window_Mitte_000" ]
Thing scene windowUnlocked [ sceneName="V_DG_Window_Mitte_005" ]
Thing scene windowOpened [ sceneName="V_DG_Window_Mitte_100" ]
Thing scene unknownScene [ sceneName="ThisIsADummySceneName" ]

// Velux IO-homecontrol devices

Thing window V_DG_M_W [ serial="56:23:3E:26:0C:1B:00:10" ]
Thing rollershutter V_DG_M_S [ serial="56:23:3E:26:0C:1B:00:10" ]
Thing rollershutter V_DG_W_S [ serial="53:09:40:5A:0C:2A:05:64" ]
Thing rollershuffer V_DG_O_S [ serial="53:09:40:5A:0C:23:0A:6E" ]
Thing actuator V_SWITCH1 [ name="#4" ]
Thing actuator V_SWITCH2 [ name="#5" ]

// Virtual rollershutter

Thing vshutter V_WINDOW [ sceneLevels="0,V_DG_Window_Mitte_000#5,V_DG_Window_Mitte_005#100,V_DG_Window_Mitte_100" ]
}

//
// vim: syntax=Xtend vim: noai:ts=4:sw=4
//
// end-of-things/velux.things
//
20 changes: 20 additions & 0 deletions bundles/org.openhab.binding.velux/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>2.5.3-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.binding.velux</artifactId>

<name>openHAB Add-ons :: Bundles :: Velux Binding</name>

<description>This binding integrates the Velux devices with help of a gateway, the Velux Bridge KLF200.</description>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<features name="org.openhab.binding.netatmo-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.4.0">
<repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository>

<feature name="openhab-binding-velux" description="Velux Binding" version="${project.version}">
<feature>openhab-runtime-base</feature>
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.velux/${project.version}</bundle>
</feature>
</features>
Loading

0 comments on commit 7d06999

Please sign in to comment.