Skip to content

Commit 236f1ed

Browse files
authored
[dahuadoor] Initial contribution (openhab#20172)
* Initial commit Signed-off-by: Sven Schad <svnsssd@gmail.com>
1 parent 8f44fcc commit 236f1ed

21 files changed

Lines changed: 2255 additions & 0 deletions

File tree

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
/bundles/org.openhab.binding.cm11a/ @BobRak
7777
/bundles/org.openhab.binding.comfoair/ @boehan
7878
/bundles/org.openhab.binding.coolmasternet/ @projectgus
79+
/bundles/org.openhab.binding.dahuadoor/ @svnsssd
7980
/bundles/org.openhab.binding.daikin/ @caffineehacker
8081
/bundles/org.openhab.binding.dali/ @rs22
8182
/bundles/org.openhab.binding.danfossairunit/ @pravussum

bom/openhab-addons/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,11 @@
366366
<artifactId>org.openhab.binding.coolmasternet</artifactId>
367367
<version>${project.version}</version>
368368
</dependency>
369+
<dependency>
370+
<groupId>org.openhab.addons.bundles</groupId>
371+
<artifactId>org.openhab.binding.dahuadoor</artifactId>
372+
<version>${project.version}</version>
373+
</dependency>
369374
<dependency>
370375
<groupId>org.openhab.addons.bundles</groupId>
371376
<artifactId>org.openhab.binding.daikin</artifactId>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
This content is produced and maintained by the openHAB project.
2+
3+
* Project home: https://www.openhab.org
4+
5+
== Declared Project Licenses
6+
7+
This program and the accompanying materials are made available under the terms
8+
of the Eclipse Public License 2.0 which is available at
9+
https://www.eclipse.org/legal/epl-2.0/.
10+
11+
== Source Code
12+
13+
https://github.com/openhab/openhab-addons
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# DahuaDoor Binding
2+
3+
This binding integrates Dahua VTO Villastation door controllers with openHAB, enabling doorbell notifications, camera snapshots, and remote door control.
4+
5+
## Supported Things
6+
7+
| Thing Type | Thing ID | Description |
8+
| ---------- | --------- | ------------------------------------------------ |
9+
| VTO2202 | `vto2202` | Dahua VTO2202 outdoor station with single button |
10+
| VTO3211 | `vto3211` | Dahua VTO3211 outdoor station with dual buttons |
11+
12+
## Discovery
13+
14+
Automatic discovery is not supported.
15+
Things must be manually configured.
16+
17+
## Thing Configuration
18+
19+
### VTO2202/VTO3211 Device
20+
21+
Single-button outdoor station.
22+
23+
| Parameter | Type | Required | Description |
24+
| ------------ | ---- | -------- | ---------------------------------------------------------------------------- |
25+
| hostname | text | Yes | Hostname or IP address of the device (e.g., 192.168.1.100) |
26+
| username | text | Yes | Username to access the device |
27+
| password | text | Yes | Password to access the device |
28+
| snapshotPath | text | Yes | Linux path where image files are stored (e.g., /var/lib/openhab/door-images) |
29+
30+
**Note:** Windows paths are not currently supported.
31+
32+
## Channels
33+
34+
### VTO2202 Channels (Single Button)
35+
36+
| Channel ID | Type | Read/Write | Description |
37+
| ----------- | ------- | ---------- | --------------------------------------------------------- |
38+
| bell-button | Trigger | Read | Triggers when doorbell button is pressed (event: PRESSED) |
39+
| door-image | Image | Read | Camera snapshot taken when doorbell is pressed |
40+
| open-door-1 | Switch | Write | Command to open door relay 1 |
41+
| open-door-2 | Switch | Write | Command to open door relay 2 |
42+
43+
### VTO3211 Channels (Dual Button)
44+
45+
| Channel ID | Type | Read/Write | Description |
46+
| ------------- | ------- | ---------- | -------------------------------------------------- |
47+
| bell-button-1 | Trigger | Read | Triggers when button 1 is pressed (event: PRESSED) |
48+
| bell-button-2 | Trigger | Read | Triggers when button 2 is pressed (event: PRESSED) |
49+
| door-image-1 | Image | Read | Camera snapshot when button 1 is pressed |
50+
| door-image-2 | Image | Read | Camera snapshot when button 2 is pressed |
51+
| open-door-1 | Switch | Write | Command to open door relay 1 |
52+
| open-door-2 | Switch | Write | Command to open door relay 2 |
53+
54+
## Full Example
55+
56+
### VTO2202 Example (Single Button)
57+
58+
#### Thing Configuration
59+
60+
```java
61+
Thing dahuadoor:vto2202:frontdoor "Front Door Station" @ "Entrance" [
62+
hostname="192.168.1.100",
63+
username="admin",
64+
password="password123",
65+
snapshotPath="/var/lib/openhab/door-images"
66+
]
67+
```
68+
69+
#### Item Configuration
70+
71+
```java
72+
Switch OpenFrontDoor "Open Front Door" <door> { channel="dahuadoor:vto2202:frontdoor:open-door-1" }
73+
Image FrontDoorImage "Front Door Camera" <camera> { channel="dahuadoor:vto2202:frontdoor:door-image" }
74+
```
75+
76+
#### Rule Configuration
77+
78+
Send smartphone notification with camera image when doorbell is pressed (requires openHAB Cloud Connector):
79+
80+
```java
81+
rule "Doorbell Notification"
82+
when
83+
Channel "dahuadoor:vto2202:frontdoor:bell-button" triggered PRESSED
84+
then
85+
sendBroadcastNotification("Visitor at the door", "door",
86+
"entrance", "Entrance", "door-notifications", null,
87+
"item:FrontDoorImage",
88+
"Open Door=command:OpenFrontDoor:ON", null)
89+
end
90+
```
91+
92+
### VTO3211 Example (Dual Button)
93+
94+
#### Thing Configuration
95+
96+
```java
97+
Thing dahuadoor:vto3211:entrance "Entrance Station" @ "Entrance" [
98+
hostname="192.168.1.101",
99+
username="admin",
100+
password="password123",
101+
snapshotPath="/var/lib/openhab/door-images"
102+
]
103+
```
104+
105+
#### Item Configuration
106+
107+
```java
108+
Switch OpenApartment1 "Open Apartment 1" <door> { channel="dahuadoor:vto3211:entrance:open-door-1" }
109+
Switch OpenApartment2 "Open Apartment 2" <door> { channel="dahuadoor:vto3211:entrance:open-door-2" }
110+
Image Apartment1Image "Apartment 1 Camera" <camera> { channel="dahuadoor:vto3211:entrance:door-image-1" }
111+
Image Apartment2Image "Apartment 2 Camera" <camera> { channel="dahuadoor:vto3211:entrance:door-image-2" }
112+
```
113+
114+
#### Rule Configuration
115+
116+
Send notifications for both buttons:
117+
118+
```java
119+
rule "Apartment 1 Doorbell"
120+
when
121+
Channel "dahuadoor:vto3211:entrance:bell-button-1" triggered PRESSED
122+
then
123+
sendBroadcastNotification("Visitor at Apartment 1", "door",
124+
"entrance", "Entrance", "door-notifications", null,
125+
"item:Apartment1Image",
126+
"Open Door=command:OpenApartment1:ON", null)
127+
end
128+
129+
rule "Apartment 2 Doorbell"
130+
when
131+
Channel "dahuadoor:vto3211:entrance:bell-button-2" triggered PRESSED
132+
then
133+
sendBroadcastNotification("Visitor at Apartment 2", "door",
134+
"entrance", "Entrance", "door-notifications", null,
135+
"item:Apartment2Image",
136+
"Open Door=command:OpenApartment2:ON", null)
137+
end
138+
```
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<parent>
8+
<groupId>org.openhab.addons.bundles</groupId>
9+
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
10+
<version>5.2.0-SNAPSHOT</version>
11+
</parent>
12+
13+
<artifactId>org.openhab.binding.dahuadoor</artifactId>
14+
15+
<name>openHAB Add-ons :: Bundles :: DahuaDoor Binding</name>
16+
17+
</project>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<features name="org.openhab.binding.dahuadoor-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.4.0">
3+
<repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository>
4+
5+
<feature name="openhab-binding-dahuadoor" description="DahuaDoor Binding" version="${project.version}">
6+
<feature>openhab-runtime-base</feature>
7+
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.dahuadoor/${project.version}</bundle>
8+
</feature>
9+
</features>

0 commit comments

Comments
 (0)