Skip to content

Commit 98340a2

Browse files
authored
Updated docker image
- the base image has been replaced - redesigned the startup script - z-way has been updated to version 4.1.3 (latest release will be installed automatically) - Remote access now works inside the docker too - added a special config.json for docker
2 parents 6d09a9e + 3a7adcb commit 98340a2

File tree

6 files changed

+369
-28
lines changed

6 files changed

+369
-28
lines changed

.github/workflows/docker-image.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v4
1717
- name: Build the Docker image
18-
run: docker build . --file Dockerfile --tag my-image-name:$(date +%s)
18+
run: docker build . --file Dockerfile --tag docker-z-way:$(date +%s)

Dockerfile

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
FROM ubuntu:focal
22

3-
RUN apt-get update && \
4-
apt-get install -y wget procps gpg libcurl4 logrotate
3+
WORKDIR /opt/z-way-server
54

6-
ENV branch=ubuntu
7-
ENV distro=focal
5+
ENV DEBIAN_FRONTEND=noninteractive
86

9-
ENV TZ=Europe/Moscow
7+
# Block zbw key request
8+
RUN mkdir -p /etc/zbw/flags && touch /etc/zbw/flags/no_connection
109

11-
WORKDIR /opt
12-
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
10+
RUN apt-get update && \
11+
apt-get install -qqy --no-install-recommends \
12+
ca-certificates curl \
13+
wget procps gpg iproute2 openssh-client openssh-server sudo logrotate
1314

14-
# Add Z-Wave.Me repository
15-
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 5b2f88a91611e683 && \
16-
echo "deb https://repo.z-wave.me/z-way/$branch $distro main" > /etc/apt/sources.list.d/z-wave-me.list
15+
# Install z-way-server
16+
RUN wget -q -O - https://storage.z-wave.me/Z-Way-Install | bash
17+
RUN rm -f /opt/z-way-server/automation/storage/*
1718

18-
# Update packages list
19-
RUN apt-get update && \
20-
apt-get install -y z-way-server zbw
19+
# Unblock zbw
20+
RUN rm /etc/zbw/flags/no_connection
21+
RUN echo "zbox" > /etc/z-way/box_type
2122

22-
ENV LD_LIBRARY_PATH=/opt/z-way-server/libs
23-
ENV PATH=/opt/z-way-server:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
23+
COPY rootfs/ /
2424

25-
VOLUME ["/opt/z-way-server/config/zddx"]
26-
VOLUME ["/opt/z-way-server/automation/storage"]
25+
# Add the initialization script
26+
RUN chmod +x /opt/z-way-server/run.sh
2727

2828
EXPOSE 8083
2929

30-
CMD /etc/init.d/z-way-server start && /bin/bash
30+
CMD /opt/z-way-server/run.sh

README.md

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,39 @@
1-
# Z-Way server docker image.
1+
## Getting Started
22

3-
## Build
4-
```sh
5-
docker build -t zway .
6-
```
3+
1. Clone this repository to your local machine:
74

8-
## Run
9-
```sh
10-
docker container run --rm -it -p 8083:8083 --device=/dev/ttyACM0 zway
11-
```
5+
```sh
6+
git clone https://github.com/Z-Wave-Me/docker-z-way.git
7+
cd docker-z-way
8+
```
129

10+
2. Check which ports your Z-Wave and Zigbee interfaces are on:
11+
12+
- **Linux**:
13+
14+
```sh
15+
ls /dev/tty*
16+
```
17+
18+
- **Windows** (using PowerShell):
19+
20+
```powershell
21+
Get-WmiObject Win32_SerialPort
22+
```
23+
24+
- **macOS**:
25+
26+
```sh
27+
ls /dev/cua*
28+
```
29+
30+
3. Update the `docker-compose.yml` file with the correct device paths if necessary.
31+
32+
4. Build and start the container:
33+
34+
```sh
35+
docker compose build
36+
docker compose up
37+
```
38+
39+
This server works only with controllers from Z-Wave.Me, such as RaZberry 2/5/7/Pro, mPCIe module, UZB, and Z-Station.

docker-compose.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
services:
2+
z-way-server:
3+
build:
4+
context: .
5+
container_name: z-way-container
6+
devices:
7+
- /dev/ttyUSB0:/dev/ttyUSB0 # For Z-Wave UZB Stick or Z-Station
8+
# - /dev/ttyUSB1:/dev/ttyUSB1 # For additional interface like a Z-Station or ZigBee stick
9+
ports:
10+
- "8083:8083"
11+
volumes:
12+
- ./data:/data
13+
restart: unless-stopped
Lines changed: 253 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,253 @@
1+
{
2+
"controller": {
3+
"initial": true
4+
},
5+
"vdevInfo": {},
6+
"locations": [{
7+
"id": 0,
8+
"title": "globalRoom",
9+
"user_img": "",
10+
"default_img": "",
11+
"img_type": ""
12+
}],
13+
"profiles": [{
14+
"id": 1,
15+
"role": 1,
16+
"login": "admin",
17+
"password": "admin",
18+
"name": "Administrator",
19+
"lang": "en",
20+
"dashboard": [],
21+
"interval": 2000,
22+
"devices": [],
23+
"rooms": [0],
24+
"expert_view": true,
25+
"hide_all_device_events": false,
26+
"hide_system_events": false,
27+
"hide_single_device_events": [],
28+
"email": "",
29+
"skin": "",
30+
"night_mode": false,
31+
"beta": false
32+
}, {
33+
"id": 2,
34+
"role": 3,
35+
"login": "local",
36+
"password": "local",
37+
"name": "Local User",
38+
"lang": "en",
39+
"dashboard": [],
40+
"interval": 2000,
41+
"devices": [],
42+
"rooms": [0],
43+
"expert_view": true,
44+
"hide_all_device_events": false,
45+
"hide_system_events": false,
46+
"hide_single_device_events": [],
47+
"email": "",
48+
"skin": "",
49+
"night_mode": false,
50+
"beta": false
51+
}],
52+
"instances": [{
53+
"id": 1,
54+
"moduleId": "ZWave",
55+
"params": {
56+
"name": "zway",
57+
"port": "/dev/ttyUSB0",
58+
"speed": 115200,
59+
"enableAPI": true,
60+
"publicAPI": false,
61+
"createVDev": true,
62+
"enablePacketLog": "enable",
63+
"config": "configs/config",
64+
"translations": "translations",
65+
"ZDDX": "ZDDX"
66+
},
67+
"active": true,
68+
"title": "Z-Wave Network Access",
69+
"description": "Allows accessing Z-Wave devices from attached Z-Wave transceiver.\n(Added by default)"
70+
}, {
71+
"id": 2,
72+
"moduleId": "Zigbee",
73+
"active": false,
74+
"title": "Zigbee Network Access",
75+
"params": {
76+
"name": "zbee",
77+
"port": "/dev/ttyUSB1",
78+
"speed": 115200,
79+
"enableAPI": true,
80+
"publicAPI": false,
81+
"createVDev": true,
82+
"config": "configs/config",
83+
"translations": "translations",
84+
"ZDDX": "ZDDX"
85+
},
86+
"description": "Allows accessing ZigBee devices from attached ZigBee coordinator.\n(Added by default)"
87+
}, {
88+
"id": 3,
89+
"moduleId": "Cron",
90+
"params": {},
91+
"active": true,
92+
"title": "System Clock (CRON)",
93+
"description": "Scheduler used by other modules\n(Added by default)"
94+
}, {
95+
"id": 4,
96+
"moduleId": "InbandNotifications",
97+
"params": {},
98+
"active": true,
99+
"title": "Inband Notifier",
100+
"description": "Creates and records the presentation of events in the event list (Eventlog).\n(Added by default)"
101+
}, {
102+
"id": 5,
103+
"moduleId": "RemoteAccess",
104+
"active": true,
105+
"title": "Remote Access",
106+
"description": "Is necessary to configure remote access in SmartHome UI.\n(Added by default)",
107+
"params": {
108+
"path": "",
109+
"userId": "",
110+
"actStatus": true,
111+
"sshStatus": false,
112+
"zbwStatus": true,
113+
"pass": "",
114+
"lastChange": {}
115+
}
116+
}, {
117+
"id": 6,
118+
"moduleId": "InfoWidget",
119+
"active": true,
120+
"title": "Dear Expert User",
121+
"description": "Dieses Modul erzeugt ein Informations Widget.",
122+
"params": {
123+
"widgets": [],
124+
"internationalize": true,
125+
"widgetsInt": [{
126+
"lang": "en",
127+
"headline": "Dear Expert User",
128+
"text": "<center>If you still want to use ExpertUI please go, after you are successfully logged in, to <br><strong> Menu > Devices > Manage with ExpertUI </strong> <br> or call <br><strong> http://MYRASP:8083/expert </strong><br> in your browser. <br> <br>You could hide or remove this widget in menu <br><strong>Apps > Active Tab</strong>. </center>",
129+
"imgURI": "app/img/logo-z-wave-z-only.png"
130+
}, {
131+
"lang": "de",
132+
"headline": "Lieber Expert User",
133+
"text": "<center>Wenn Sie weiterhin die ExpertUI nutzen möchten, dann klicken Sie bitte, nachdem Sie sich erfolgreich angemeldet haben, auf <br><strong> Menü > Geräte > Verwaltung mit ExpertUI </strong> <br> oder rufen Sie <br><strong> http://MYRASP:8083/expert </strong><br> in Ihrem Browser auf. <br> <br>Sie können dieses Element im Menü <br><strong>Anwendungen > Aktiv</strong><br> auschalten oder entfernen.</center>",
134+
"imgURI": "app/img/logo-z-wave-z-only.png"
135+
}]
136+
}
137+
}, {
138+
"id": 7,
139+
"moduleId": "SensorsPolling",
140+
"active": false,
141+
"title": "Periodical Sensor Polling",
142+
"description": "Queries in an adjustable interval all measurement sensors. It can be entered a list of sensors, which should not be queried.\n(Added by default)",
143+
"params": {
144+
"pollDevsWithBatteries": false,
145+
"devices": [],
146+
"devicesWithBattery": [],
147+
"period": "10"
148+
}
149+
}, {
150+
"id": 8,
151+
"moduleId": "BatteryPolling",
152+
"active": true,
153+
"title": "Battery Polling",
154+
"description": "Set up an interval that regularly polls the battery status of a battery devices.\n(Added by default)",
155+
"params": {
156+
"launchWeekDay": 0,
157+
"warningLevel": "20"
158+
}
159+
}, {
160+
"id": 9,
161+
"moduleId": "SwitchControlGenerator",
162+
"active": true,
163+
"title": "Trap events from Remotes and Sensors",
164+
"description": "",
165+
"params": {
166+
"trapNew": true,
167+
"banned": [],
168+
"generated": []
169+
}
170+
}, {
171+
"id": 10,
172+
"moduleId": "CloudBackup",
173+
"active": true,
174+
"title": "CloudBackup",
175+
"description": "Gives possibility to upload and store your backups on the remote server.\n(Added by default)",
176+
"params": {
177+
"api": "/CloudBackupAPI/Backup",
178+
"user_active": false,
179+
"email": "",
180+
"email_log": "0",
181+
"remoteid": null,
182+
"days": "28",
183+
"weekDays": null,
184+
"hours": "23",
185+
"minutes": "59",
186+
"scheduler": "3"
187+
}
188+
}, {
189+
"id": 11,
190+
"moduleId": "InfoWidget",
191+
"active": true,
192+
"title": "Cloud Backup Instructions",
193+
"description": "This module creates an information widget.\n(Added by default)",
194+
"params": {
195+
"widgets": [],
196+
"internationalize": true,
197+
"widgetsInt": [{
198+
"lang": "en",
199+
"headline": "Cloud Backup Instructions",
200+
"text": "<center>Cloud backup is conveniently saving up to 3 backup files on our server (using SSL encryption).<br>By default, an automatic backup is created every month on 28 at 23:59.<br>If you don’t like to see your backup file on our server, just deactivate this service or change the interval.</br>To change the settings, please click on<br><strong>Menu > Management > Backup & Restore.</strong><br><br>You could hide or remove this widget in<br><strong>Menu >Apps > Active Tab</strong>.</center>",
201+
"imgURI": "app/img/icon_cloudbackup.png"
202+
}, {
203+
"lang": "de",
204+
"headline": "Cloud Backup Anleitung",
205+
"text": "<center>Cloud Backup sichert bis zu 3 Kopien Ihrer Daten automatisch auf unserem Server (mittels SSL Verschlüsselung).<br>Standard mäßig wird jeden Monat am 28 um 23:59 ein automatisches Backup erstellt.<br>Sollten Sie das nicht wünschen dann ändern Sie den Interval oder deaktivieren Sie diese Funktion.<br>Zum ändern der Einstellungen klicken Sie bitte auf <br><strong>Menü > Management > Datensicherung & Wiederherstellung.</strong><br><br>Sie können dieses Element im<br><strong> Menü Anwendungen > Aktiv<strong><br> auschalten oder entfernen.</center>",
206+
"imgURI": "app/img/icon_cloudbackup.png"
207+
}]
208+
}
209+
}, {
210+
"id" : 12,
211+
"moduleId" : "MobileAppSupport",
212+
"active" : true,
213+
"title" : "Mobile App Support",
214+
"description": "This module is required by the mobile phone app (Android, iOS). State updates of all devices and events are send at runtime to the mobile phone. Additional notifications can be configured that will be send in background. Currently event forwarding is supported (the same logic as for pushbullet module).\n(Added by default)",
215+
"params" : {
216+
"apps" : []
217+
}
218+
}, {
219+
"id": 13,
220+
"moduleId": "HomeKitGate",
221+
"active": false,
222+
"title": "Apple HomeKit Gate",
223+
"params": {
224+
"name": "Z-Wave.Me",
225+
"skippedDevices": [],
226+
"idMapping": {}
227+
}
228+
}, {
229+
"id": 14,
230+
"moduleId": "NotificationFiltering",
231+
"active": true,
232+
"title": "Notification Filtering",
233+
"params": {
234+
"rules": [{
235+
"recipient_type": "user",
236+
"user": 1,
237+
"logLevel": "errors,warnings",
238+
"devices": []
239+
}],
240+
"autogenOnDeviceListUpdate": true,
241+
"normalizeRules": true
242+
}
243+
}, {
244+
"id": 15,
245+
"moduleId": "NotificationChannelEmail",
246+
"active": true,
247+
"title": "Notifications by E-mail",
248+
"params": {
249+
"subject": "Z-Way Notification",
250+
"channels": []
251+
}
252+
}]
253+
}

0 commit comments

Comments
 (0)