Skip to content

Commit 7d87a68

Browse files
committed
First commit
0 parents  commit 7d87a68

32 files changed

+2067
-0
lines changed

.classpath

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
4+
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
5+
<classpathentry kind="src" path="src/main/java"/>
6+
<classpathentry kind="lib" path="lib/commons-lang3-3.4.jar"/>
7+
<classpathentry kind="output" path="target/classes"/>
8+
</classpath>

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
target/

.project

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>org.openhab.binding.zigbee2mqtt</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.pde.ManifestBuilder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
<buildCommand>
19+
<name>org.eclipse.pde.SchemaBuilder</name>
20+
<arguments>
21+
</arguments>
22+
</buildCommand>
23+
<buildCommand>
24+
<name>org.eclipse.pde.ds.core.builder</name>
25+
<arguments>
26+
</arguments>
27+
</buildCommand>
28+
</buildSpec>
29+
<natures>
30+
<nature>org.eclipse.pde.PluginNature</nature>
31+
<nature>org.eclipse.jdt.core.javanature</nature>
32+
</natures>
33+
</projectDescription>

ESH-INF/binding/binding.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<binding:binding id="zigbee2mqtt" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xmlns:binding="http://eclipse.org/smarthome/schemas/binding/v1.0.0"
4+
xsi:schemaLocation="http://eclipse.org/smarthome/schemas/binding/v1.0.0 http://eclipse.org/smarthome/schemas/binding-1.0.0.xsd">
5+
6+
<name>Zigbee2Mqtt Binding</name>
7+
<description>This is the binding for Zigbee2Mqtt.</description>
8+
<author>Nils</author>
9+
10+
</binding:binding>

ESH-INF/config/bridge-config.xml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<config-description:config-descriptions
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xmlns:config-description="http://eclipse.org/smarthome/schemas/config-description/v1.0.0"
5+
xsi:schemaLocation="http://eclipse.org/smarthome/schemas/config-description/v1.0.0
6+
http://eclipse.org/smarthome/schemas/config-description-1.0.0.xsd">
7+
8+
<config-description uri="binding:zigbee2mqtt:zigbee2mqttServer">
9+
10+
<parameter-group name="zigbee2mqttServer">
11+
<label>Zigbee2Mqtt Server</label>
12+
<description>The Zigbee2Mqtt server represents a bridge with general settings and communication tasks.</description>
13+
</parameter-group>
14+
15+
<parameter-group name="binding">
16+
<label>Options</label>
17+
<description>These settings affect functions of the binding.</description>
18+
</parameter-group>
19+
20+
<parameter name="mqttbrokerIpAddress" groupName="zigbee2mqttServer" type="text">
21+
<label>IP-Address</label>
22+
<description>The IP address or hostname of the MQTT-Broker. If MQTT-Broker and openHAB are running on the same machine, the default value can be used.</description>
23+
<default>localhost</default>
24+
</parameter>
25+
26+
<parameter name="mqttbrokerPort" groupName="zigbee2mqttServer" type="integer" required="false" min="0"
27+
max="65335">
28+
<label>Port</label>
29+
<description>The port of the MQTT-Broker</description>
30+
<default>1883</default>
31+
</parameter>
32+
33+
<parameter name="mqttbrokerClientID" groupName="zigbee2mqttServer" type="text">
34+
<label>Client ID</label>
35+
<description>Client ID for MQTT-Broker.</description>
36+
<default>openHAB.zigbee2mqtt</default>
37+
</parameter>
38+
39+
<parameter name="mqttbrokerUsername" groupName="zigbee2mqttServer" type="text">
40+
<label>Username</label>
41+
<description>Username to access the MQTT-Broker.</description>
42+
<default>admin</default>
43+
</parameter>
44+
45+
<parameter name="mqttbrokerPassword" groupName="zigbee2mqttServer" type="text">
46+
<context>password</context>
47+
<label>Password</label>
48+
<description>Password to access the MQTT-Broker.</description>
49+
</parameter>
50+
51+
<parameter name="mqttbrokerBaseTopic" groupName="zigbee2mqttServer" type="text">
52+
<label>Base topic</label>
53+
<description>Base topic which is used by zigbee2mqtt.</description>
54+
<default>zigbee2mqtt</default>
55+
</parameter>
56+
57+
58+
</config-description>
59+
60+
</config-description:config-descriptions>

ESH-INF/config/device-config.xml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<config-description:config-descriptions
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xmlns:config-description="http://eclipse.org/smarthome/schemas/config-description/v1.0.0"
5+
xsi:schemaLocation="http://eclipse.org/smarthome/schemas/config-description/v1.0.0
6+
http://eclipse.org/smarthome/schemas/config-description-1.0.0.xsd">
7+
8+
<config-description uri="binding:zigbee2mqtt:zigbee2mqttDevice">
9+
10+
<parameter-group name="zigbee2mqttDevice">
11+
<label>Zigbee2Mqtt Device</label>
12+
<description>The Zigbee2Mqtt Device represents a device with general settings and communication tasks.</description>
13+
</parameter-group>
14+
15+
<parameter-group name="binding">
16+
<label>Options</label>
17+
<description>These settings affect functions of the binding.</description>
18+
</parameter-group>
19+
20+
<parameter name="ieeeAddr" type="text" required="true">
21+
<label>ieeeAddr</label>
22+
<description>ieeeAddr of the Zigbee2Mqtt device</description>
23+
</parameter>
24+
25+
</config-description>
26+
27+
</config-description:config-descriptions>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# FIXME: please substitute the xx_XX with a proper locale, ie. de_DE
2+
# FIXME: please do not add the file to the repo if you add or change no content
3+
# binding
4+
binding.zigbee2mqtt.name = <Your localized Binding name>
5+
binding.zigbee2mqtt.description = <Your localized Binding description>
6+
7+
# thing types
8+
thing-type.zigbee2mqtt.sample.label = <Your localized Thing label>
9+
thing-type.zigbee2mqtt.sample.description = <Your localized Thing description>
10+
11+
# channel types
12+
channel-type.zigbee2mqtt.sample-channel.label = <Your localized Channel label>
13+
channel-type.zigbee2mqtt.sample-channel.description = <Your localized Channel description>

ESH-INF/thing/bridge.xml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<thing:thing-descriptions bindingId="zigbee2mqtt"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0"
5+
xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd">
6+
7+
<bridge-type id="zigbee2mqttServer">
8+
<label>Zigbee2Mqtt Server</label>
9+
<description>
10+
<![CDATA[
11+
The Zigbee2Mqtt server represents a bridge with general settings and communication tasks.
12+
]]>
13+
</description>
14+
15+
<channels>
16+
<channel id="permitJoin" typeId="permitJoin" />
17+
<channel id="logLevel" typeId="logLevel" />
18+
</channels>
19+
20+
<config-description-ref uri="binding:zigbee2mqtt:zigbee2mqttServer" />
21+
22+
</bridge-type>
23+
24+
<channel-type id="permitJoin">
25+
<item-type>Switch</item-type>
26+
<label>PermitJoin</label>
27+
<description>PermitJoin</description>
28+
</channel-type>
29+
<channel-type id="logLevel">
30+
<item-type>String</item-type>
31+
<label>LogLevel</label>
32+
<description>Log Level</description>
33+
<state>
34+
<options>
35+
<option value="debug">Debug</option>
36+
<option value="info">Info</option>
37+
<option value="warn">Warn</option>
38+
<option value="error">Error</option>
39+
</options>
40+
</state>
41+
</channel-type>
42+
43+
44+
</thing:thing-descriptions>

ESH-INF/thing/channels.xml

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<thing:thing-descriptions bindingId="zigbee2mqtt"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0"
5+
xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd">
6+
7+
<channel-type id="temperature">
8+
<item-type>Number</item-type>
9+
<label>Temperature</label>
10+
<category>Temperature</category>
11+
<state readOnly="true" pattern="%.2f °C" />
12+
</channel-type>
13+
14+
<channel-type id="illuminance">
15+
<item-type>Number</item-type>
16+
<label>Illuminance</label>
17+
<category>Light</category>
18+
<state readOnly="true" />
19+
</channel-type>
20+
21+
<channel-type id="occupancy">
22+
<item-type>Number</item-type>
23+
<label>Occupancy</label>
24+
<category>Light</category>
25+
<state readOnly="true" />
26+
</channel-type>
27+
28+
<channel-type id="humidity">
29+
<item-type>Number</item-type>
30+
<label>Humidity</label>
31+
<category>Humidity</category>
32+
<state readOnly="true" pattern="%.2f %%" />
33+
</channel-type>
34+
35+
<channel-type id="pressure">
36+
<item-type>Number</item-type>
37+
<label>Pressure</label>
38+
<category>Pressure</category>
39+
<state readOnly="true" />
40+
</channel-type>
41+
42+
<channel-type id="contact">
43+
<item-type>Contact</item-type>
44+
<label>DoorWindow</label>
45+
<category>Contact</category>
46+
<state readOnly="true" />
47+
</channel-type>
48+
49+
<channel-type id="click">
50+
<kind>trigger</kind>
51+
<label>Click Event</label>
52+
<description>Fires when the button is pressed, double, triple, quad pressed</description>
53+
<event>
54+
<options>
55+
<option value="PRESSED_SINGLE">single</option>
56+
<option value="PRESSED_DOUBLE">double</option>
57+
<option value="PRESSED_TRIPLE">triple</option>
58+
<option value="PRESSED_QUADRUPLE">quadruple</option>
59+
</options>
60+
</event>
61+
</channel-type>
62+
63+
<channel-type id="action">
64+
<kind>trigger</kind>
65+
<label>Click Event</label>
66+
<description>Fires when the cube is rotate, flip,fall</description>
67+
<event>
68+
<options>
69+
<option value="ACTION_FALL">fall</option>
70+
<option value="ACTIONFLIP90">flip90</option>
71+
<option value="ACTION_FLIP180">flip180</option>
72+
<option value="ACTIO_ROTATE_RIGHT">rotate_right</option>
73+
<option value="ACTIO_ROTATE_LEFT">rotate_left</option>
74+
</options>
75+
</event>
76+
</channel-type>
77+
78+
<channel-type id="water_leak">
79+
<item-type>Switch</item-type>
80+
<label>Flood</label>
81+
<category>Water</category>
82+
<state readOnly="true" />
83+
</channel-type>
84+
85+
<!-- Channel types without further information -->
86+
87+
<channel-type id="battery">
88+
<item-type>Number</item-type>
89+
<label>Battery</label>
90+
<category>Battery</category>
91+
<state readOnly="true" pattern="%.2f %%" />
92+
</channel-type>
93+
94+
<channel-type id="voltage">
95+
<item-type>Number</item-type>
96+
<label>Voltage</label>
97+
<category>Voltage</category>
98+
<state readOnly="true" />
99+
</channel-type>
100+
101+
<channel-type id="linkquality">
102+
<item-type>Number</item-type>
103+
<label>Linkquality</label>
104+
<category>linkquality</category>
105+
<state readOnly="true" />
106+
</channel-type>
107+
108+
109+
110+
111+
<!-- Special channel types -->
112+
113+
114+
115+
</thing:thing-descriptions>

ESH-INF/thing/device.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<thing:thing-descriptions bindingId="zigbee2mqtt" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0"
4+
xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd">
5+
6+
<thing-type id="zigbee2mqttDevice">
7+
<supported-bridge-type-refs>
8+
<bridge-type-ref id="zigbee2mqttServer" />
9+
</supported-bridge-type-refs>
10+
11+
<label>Zigbee2Mqtt Device</label>
12+
<description>
13+
<![CDATA[
14+
A Zigbee2Mqtt device -each device function will be mapped to
15+
a separate channel. The bridge is necessary as an intermediary between openHAB thing
16+
and Zigbee2Mqtt device.
17+
]]>
18+
</description>
19+
<config-description-ref uri="binding:zigbee2mqtt:zigbee2mqttDevice" />
20+
</thing-type>
21+
</thing:thing-descriptions>

0 commit comments

Comments
 (0)