Skip to content

Commit 1887ffd

Browse files
authored
Merge pull request #766 from Paraphraser/20240423-domoticz-master
2024-04-23 Domoticz - master branch - PR 1 of 2
2 parents eb04c38 + aa41727 commit 1887ffd

File tree

2 files changed

+82
-12
lines changed

2 files changed

+82
-12
lines changed

.templates/domoticz/service.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
domoticz:
22
container_name: domoticz
3-
image: lscr.io/linuxserver/domoticz:latest
3+
image: domoticz/domoticz:stable
4+
restart: unless-stopped
5+
environment:
6+
- TZ=${TZ:-Etc/UTC}
7+
# - LOG_PATH=/opt/domoticz/userdata/domoticz.log
8+
# - EXTRA_CMD_ARG=
49
ports:
510
- "8083:8080"
6-
- "6144:6144"
7-
- "1443:1443"
11+
- "1443:443"
812
volumes:
9-
- ./volumes/domoticz/data:/config
10-
restart: unless-stopped
11-
environment:
12-
- PUID=1000
13-
- PGID=1000
14-
# - TZ=Etc/UTC
15-
# - WEBROOT=domoticz
16-
13+
- ./volumes/domoticz:/opt/domoticz/userdata
14+
x-devices:
15+
- "/dev/serial/by-id/usb-0658_0200-if00-port0:/dev/ttyACM0"

docs/Containers/Domoticz.md

Lines changed: 72 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,81 @@
77
- [User Guide](https://www.domoticz.com/DomoticzManual.pdf) (pdf)
88

99
- [GitHub: domoticz/domoticz](https://github.com/domoticz/domoticz)
10-
- [DockerHub: linuxserver/domoticz](https://hub.docker.com/r/linuxserver/domoticz)
10+
- [DockerHub: domoticz/domoticz](https://hub.docker.com/r/domoticz/domoticz)
1111

1212
## Invitation
1313

1414
There is no IOTstack documentation for Domoticz.
1515

1616
This is a standing invitation to anyone who is familiar with this container to submit a Pull Request to provide some documentation.
17+
18+
## Environment Variables
19+
20+
* `TZ=${TZ:-Etc/UTC}`
21+
22+
If `TZ` is defined in `~/IOTstack/.env` then the value there is applied, otherwise the default of `Etc/UTC` is used. You can initialise `.env` like this:
23+
24+
``` console
25+
$ cd ~/IOTstack
26+
$ [ $(grep -c "^TZ=" .env) -eq 0 ] && echo "TZ=$(cat /etc/timezone)" >>.env
27+
```
28+
29+
* `LOG_PATH=/opt/domoticz/userdata/domoticz.log`
30+
31+
This is disabled by default. If you enable it, Domoticz will write a log to that *internal* path. The path corresponds with the *external* path:
32+
33+
```
34+
~/IOTstack/volumes/domoticz/domoticz.log
35+
```
36+
37+
Note that this log is persistent. In other words, it will survive container restarts. This means you are responsible for pruning it from time to time. The Unix tradition for pruning logs is:
38+
39+
``` console
40+
$ cd ~/IOTstack/volumes/domoticz/
41+
$ cat /dev/null | sudo tee domoticz.log
42+
```
43+
44+
If, instead, you decide to delete the log file, you should stop the container first:
45+
46+
``` console
47+
$ cd ~/IOTstack
48+
$ docker-compose down domoticz
49+
$ sudo rm ./volumes/domoticz/domoticz.log
50+
$ docker-compose up -d domoticz
51+
```
52+
53+
* `EXTRA_CMD_ARG=`
54+
55+
This is disabled by default. It can be enabled and used to override the default parameters and pass [command-line parameters](https://www.domoticz.com/wiki/Command_line_parameters) of your choosing to Domoticz.
56+
57+
## Devices
58+
59+
The service definition includes an `x-devices:` clause. The `x-` prefix has the same effect as commenting-out the entire clause. If you wish to map an external device into the container:
60+
61+
1. Adjust the left-hand-side of the example path to point to the device as it appears on your Raspberry Pi;
62+
2. Remove the `x-` prefix.
63+
3. Recreate the container:
64+
65+
```
66+
$ cd ~/IOTstack
67+
$ docker-compose up -d domoticz
68+
```
69+
70+
## Migration Notes
71+
72+
1. Older IOTstack service definitions for Domoticz used the `lscr.io/linuxserver/domoticz:latest` image. The current service definition uses the `domoticz/domoticz:stable` image.
73+
2. The location of the persistent store has changed, as has its relationship to the internal path:
74+
75+
service definition | persistent store | internal path
76+
-------------------|----------------------------------|--------------
77+
older | ~/IOTstack/volumes/domoticz/data | config
78+
current | ~/IOTstack/volumes/domoticz | /opt/domoticz/userdata
79+
80+
If you have have been using the older service definition and wish to upgrade to the current service definition, you can try migrating like this:
81+
82+
``` console
83+
$ cd ~/IOTstack/volumes
84+
$ sudo mv domoticz domoticz.old
85+
$ sudo cp -a domoticz.old/data domoticz
86+
```
87+

0 commit comments

Comments
 (0)