Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beta #2

Open
wants to merge 70 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
7d60150
Update Dockerfile
Jun 30, 2020
87f8e87
Update Dockerfile.Beta
Jul 2, 2020
dc9d16d
Update Dockerfile.Beta
Jul 10, 2020
a063f63
Update Dockerfile.Beta
Jul 26, 2020
4b2a303
Update Dockerfile.Beta
Jul 30, 2020
0bf1173
Update Dockerfile.Beta
Aug 7, 2020
d6a2e5e
Update Dockerfile.Beta
Aug 11, 2020
a8d8aa6
Update Dockerfile.Beta
Aug 11, 2020
f8f382a
Create runbetaupdate
Aug 11, 2020
fb5f2f4
Update Dockerfile.Beta
Aug 13, 2020
38686ca
Update Dockerfile.Beta
Aug 16, 2020
1dab3a8
Update Dockerfile.Beta
Aug 16, 2020
c37ff20
Update Dockerfile.Beta
Aug 16, 2020
b2d7d10
Update Dockerfile.Beta
Aug 17, 2020
5f0935c
Update Dockerfile.Beta
Aug 17, 2020
e9842bd
Update Dockerfile
Aug 25, 2020
6ba18db
Update Dockerfile.Beta
Aug 25, 2020
c91d8bf
Update Dockerfile.Beta
Sep 30, 2020
f82f0f7
Update Dockerfile.Beta
Sep 30, 2020
447298f
Delete Dockerfile
Oct 1, 2020
7be34ef
Update Dockerfile.Beta
Oct 21, 2020
6ff351d
Update Dockerfile.Beta
Oct 21, 2020
f970b4b
Update Dockerfile.Beta
Nov 8, 2020
e83d58f
Update Dockerfile.Beta
Nov 9, 2020
bb680ba
Create run.sh
Nov 10, 2020
615d311
Update run.sh
Nov 10, 2020
3873027
Update Dockerfile.Beta
Nov 10, 2020
9bc517c
Update Dockerfile.Beta
Nov 10, 2020
3ab1331
Create commons.sh
Nov 11, 2020
40fd034
Update run.sh
Nov 11, 2020
d5d16eb
Update Dockerfile.Beta
Nov 11, 2020
a85f027
Update run.sh
Nov 11, 2020
6433a22
Update Dockerfile.Beta
Nov 11, 2020
7eabfc1
Update Dockerfile.Beta
Nov 11, 2020
c20e3fb
Update run.sh
Nov 12, 2020
a5ab58b
Update Dockerfile.Beta
Nov 12, 2020
4ca0e8a
Update Dockerfile.Beta
Nov 19, 2020
3c9523c
Update Dockerfile.Beta
Dec 3, 2020
2b2adeb
Update README.md
Dec 10, 2020
10c07a8
Update Dockerfile.Beta
Jan 7, 2021
791e7c5
Update Dockerfile.Beta
Jan 14, 2021
aeadb68
Update Dockerfile.Beta
Jan 24, 2021
1d4b46e
Update Dockerfile.Beta
Jan 27, 2021
f38ae2c
Update Dockerfile.Beta
Feb 3, 2021
24de212
Update Dockerfile.Beta
Feb 8, 2021
928034e
Update Dockerfile.Beta
Feb 16, 2021
69f2e0d
Update Dockerfile.Beta
Feb 17, 2021
2b65e75
Update Dockerfile.Beta
Feb 25, 2021
0e82689
Update Dockerfile.Beta
Mar 3, 2021
8c47e2a
Update Dockerfile.Beta
Mar 16, 2021
f4c1a60
Update Dockerfile.Beta
Mar 22, 2021
b9f0dc9
Update Dockerfile.Beta
Apr 8, 2021
524b9c4
Update Dockerfile.Beta
Apr 13, 2021
c199e5a
Update Dockerfile.Beta
Apr 21, 2021
9fcba73
Update Dockerfile.Beta
Apr 28, 2021
d197fae
Update Dockerfile.Beta
Apr 30, 2021
49ef000
Update Dockerfile.Beta
May 3, 2021
98e7181
Update Dockerfile.Beta
May 10, 2021
9e8abf9
Update Dockerfile.Beta
May 18, 2021
7d39256
Update Dockerfile.Beta
May 26, 2021
1ef2977
Update Dockerfile.Beta
Jun 8, 2021
082b422
Update Dockerfile.Beta
Jun 23, 2021
dff1f95
Update Dockerfile.Beta
Jul 25, 2021
04845e6
Update Dockerfile.Beta
Aug 8, 2021
c945c03
Update Dockerfile.Beta
Aug 20, 2021
68ccf17
Update README.md
Feb 3, 2022
317d644
Update Dockerfile.Beta
Feb 3, 2022
a2035e2
Update run.sh
Feb 3, 2022
7e37228
Rename Dockerfile.Beta to Dockerfile
Feb 3, 2022
d1c8731
Update Dockerfile
Feb 3, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 29 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,56 @@ FROM ubuntu:latest

# Disable Prompt During Packages Installation
ARG DEBIAN_FRONTEND=noninteractive
# set version label
ARG BUILD_DATE=2020-10-21
ARG VERSION

# Identify the maintainer of an image
LABEL vcs-url="https://github.com/domoticz/domoticz" \
url="https://domoticz.com/" \
name="Domoticz" \
license="GPLv3" \
build-date=2020-06-08 \
build-date=${BUILD_DATE} \
maintainer="[email protected]" \
version="2020.2" \
version="2020.2 ${VERSION}" \
description="This is custom Docker Image for the Domoticz Home Automation Services."

ENV PUID=1000
ENV PGID=1000
ENV TZ=Europe/Stockholm
ENV WEBROOT=domoticz
ENV www=80
ENV sslwww=443
ENV www=8090
ENV sslwww=1443
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
ENV PS1=$(whoami)@$(hostname):$(pwd)\$
ENV HOME=/opt/domoticz
ENV TERM=xterm

#
# Update the image to the latest packages
RUN apt-get update && apt-get upgrade -y
RUN apt-get install -y libudev-dev libusb-0.1-4 libcurl4 libcurl4-gnutls-dev libpython3.8-dev tzdata apt-utils software-properties-common sudo net-tools iproute2 mc htop curl wget bash iputils-ping zip unzip
RUN mkdir /opt/domoticz

# COPY domoticz/ /opt/domoticz/
RUN wget -qO- http://releases.domoticz.com/releases/release/domoticz_linux_x86_64.tgz | tar xz -C /opt/domoticz
WORKDIR /opt/domoticz

RUN chmod +x ./domoticz
# Update the image to the latest packages
RUN apt -y update \
&& DEBIAN_FRONTEND=noninteractive && apt -y --allow-unauthenticated upgrade && apt autoremove && \
apt install -y --allow-unauthenticated \
rsync apt-transport-https git mosquitto-clients libudev-dev libusb-0.1-4 libcurl4 libftdi-dev libusb-dev libconfuse-dev libcurl4-gnutls-dev \
libpython3.8-dev tzdata apt-utils software-properties-common sudo net-tools iproute2 mc htop curl wget bash iputils-ping zip unzip python3-pip usbutils && apt -y autoremove
RUN pip3 install samsungctl vsure websocket-client requests paramiko pycrypto

RUN mkdir -p /opt/domoticz/plugins /tmp/domoticz/plugins
RUN wget -qO- https://releases.domoticz.com/releases/beta/domoticz_linux_x86_64.tgz | tar xz -C $HOME && \
rsync -a $HOME /tmp && \
sed -i '/update2.html/d' $HOME/www/html5.appcache
RUN cd /tmp/domoticz/plugins && git clone https://github.com/d-EScape/Domoticz_iDetect.git iDetect && \
cd $HOME
RUN cd /tmp/domoticz/plugins && git clone https://github.com/enesbcs/Shelly_MQTT.git && git clone https://github.com/iasmanis/Domoticz-Tuya-Thermostat-Plugin && cd Domoticz-Tuya-Thermostat-Plugin && git clone https://github.com/clach04/p
ython-tuya.git && ln -s $HOME/plugins/Domoticz-Tuya-Thermostat-Plugin/python-tuya/pytuya pytuya
RUN cd /tmp/domoticz/plugins && git clone https://github.com/stas-demydiuk/domoticz-zigbee2mqtt-plugin.git zigbee2mqtt

VOLUME /opt/domoticz/db
VOLUME /opt/domoticz/scripts
VOLUME /opt/domoticz/backups
VOLUME /opt/domoticz/plugins
VOLUME /opt/domoticz/www/secpanel

EXPOSE 80 443
EXPOSE $www $sslwww
COPY commons.sh run.sh /
RUN chmod +x /run.sh /commons.sh

ENTRYPOINT ["/opt/domoticz/domoticz", "-dbase", "/opt/domoticz/db/domoticz.db", "-log", "/opt/domoticz/db/domoticz.log"]
CMD ["-www", "80", "-sslwww", "443"]
ENTRYPOINT ["/bin/sh", "-c", "/run.sh"]
47 changes: 0 additions & 47 deletions Dockerfile.Beta

This file was deleted.

53 changes: 29 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Fixdata
# Fixdata - DOckerMOTICZ
Domoticz is a Home Automation System that lets you monitor and configure various devices like: Lights, Switches, various sensors/meters like Temperature, Rain, Wind, UV, Electra, Gas, Water and much more. Notifications/Alerts can be sent to any mobile device.

# Supported Architectures
The images support architecture x86-64.

Simply pulling fixdata/dockermoticz:stable and you get an ubuntu 20.04 dist with Domoticz latest stable release.
or fixdata/dockermoticz:latest for the nightly build beta
Simply pulling fixdata/dockermoticz:latest and you get an ubuntu 20.04 dist with Domoticz latest stable release.
or fixdata/dockermoticz:beta for the nightly build beta

The architectures supported by this image are:

Expand All @@ -20,8 +20,18 @@ The architectures supported by this image are:

| Tag | Description |
| ------------- | ----------- |
| beta | Current latest head from development at https://releases.domoticz.com/releases/beta/domoticz_linux_x86_64.tgz.|
| latest | Latest stable version at http://releases.domoticz.com/releases/release/domoticz_linux_x86_64.tgz.|
| beta | Current latest head from development at https://releases.domoticz.com/releases/beta/domoticz_linux_x86_64.tgz. |
| latest | Latest stable version at http://releases.domoticz.com/releases/release/domoticz_linux_x86_64.tgz. |

| Bundled plugins | Tag | Info |
| ------------- | ----------- | ----------- |
| Tuya Thermostat Plugin. | beta | https://github.com/iasmanis/Domoticz-Tuya-Thermostat-Plugin |
| Zigbee2Mqtt Plugin. | beta | https://github.com/stas-demydiuk/domoticz-zigbee2mqtt-plugin |
| ShellyCloudPlugin. | beta | https://github.com/mario-peters/ShellyCloudPlugin|
| ShellyMQTT. | beta | https://github.com/enesbcs/Shelly_MQTT |
| Presence detection from wireless router. | latest/beta | |
| Verisure | latest/beta | |
| SamsungTV | latest/beta | |

# Usage
Here are some example to help you get started creating a container.
Expand All @@ -37,13 +47,14 @@ docker create \
-p 8008:80 \
-p 6144:6144 \
-p 1443:443 \
-v /etc/localtime:/etc/localtime \
-v path to db:/opt/domoticz/db \
-v path to scripts:/opt/domoticz/scripts \
-v path to backups:/opt/domoticz/backups \
-v path to plugins:/opt/domoticz/plugins \
--device path to device:path to device \
--restart unless-stopped \
fixdata/domoticz
fixdata/dockermoticz
```
## Passing Through USB Devices
To get full use of Domoticz, you probably have a USB device you want to pass through. To figure out which device to pass through, you have to connect the device and look in dmesg for the device node created. Issue the command 'dmesg | tail' after you connected your device and you should see something like below.
Expand All @@ -62,17 +73,18 @@ Compatible with docker-compose v2 schemas.
version: "2"
services:
domoticz:
image: linuxserver/domoticz
image: fixdata/dockermoticz
container_name: domoticz
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/Stockholm
- WEBROOT=domoticz #optional
volumes:
- path to db:/opt/domoticz/db \
- path to scripts:/opt/domoticz/scripts \
- path to backups:/opt/domoticz/backups \
- /etc/localtime:/etc/localtime:ro
- path to db:/opt/domoticz/db
- path to scripts:/opt/domoticz/scripts
- path to backups:/opt/domoticz/backups
- path to plugins:/opt/domoticz/plugins
ports:
- 8008:80
Expand All @@ -87,28 +99,20 @@ Container images are configured using parameters passed at runtime (such as thos

|Parameter|Function|
|---|---|
|-p 8008|WebUI|
|-p 8008|Web-GUI|
|-p 6144|Domoticz communication port.|
|-p 1443|Domoticz communication port.|
|-e PUID=1000|for UserID - see below for explanation|
|-e PGID=1000|for GroupID - see below for explanation|
|-e TZ=Europe/Stckholm|Specify a timezone to use EG Europe/London.|
|-e WEBROOT=domoticz|Sets webroot to domoticz for usage with subfolder reverse proxy. Not needed unless reverse proxying.|
|-v /etc/localtime|Local time.|
|-v /opt/domoticz/db|Where Domoticz stores config files and data.|
|/opt/domoticz/scripts|Where Domoticz stores config script files.|
|/opt/domoticz/backups|Where Domoticz stores backup files.|
|/opt/domoticz/plugins|Where Domoticz stores plugin files.|
|-v /opt/domoticz/scripts|Where Domoticz stores config script files.|
|-v /opt/domoticz/backups|Where Domoticz stores backup files.|
|-v /opt/domoticz/plugins|Where Domoticz stores plugin files.|
|--device <path to device>|For passing through USB devices. One or more|

# Environment variables from files (Docker secrets)
You can set any environment variable from a file by using a special prepend FILE__.

As an example:
```
-e FILE__PASSWORD=/run/secrets/mysecretpassword
```
Will set the environment variable PASSWORD based on the contents of the /run/secrets/mysecretpassword file.

# User / Group Identifiers
When using volumes (-v flags) permissions issues can arise between the host OS and the container, we avoid this issue by allowing you to specify the user PUID and group PGID.

Expand All @@ -125,7 +129,7 @@ To configure Domoticz, go to the IP of your docker host on the port you configur

# Updating Info
## Via Docker Run/Create
Update the image: docker pull linuxserver/domoticz
Update the image: docker pull fixdata/dockermoticz
Stop the running container: docker stop domoticz
Delete the container: docker rm domoticz
Recreate a new container with the same docker create parameters as instructed above (if mapped correctly to a host folder, your /config folder and settings will be preserved)
Expand All @@ -144,5 +148,6 @@ You can also remove the old dangling images: docker image prune
# Versions
|Versions|Comment|
|--------|-------|
|02.03.22|New plugins.|
|06.09.20| Update README.|
|06.08.20| Initial Release.|
47 changes: 47 additions & 0 deletions commons.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/sh

reset=""
yellow=""
yellow_bold=""
red=""
orange=""

# Returns 0 if the specified string contains the specified substring, otherwise returns 1.
# This exercise it required because we are using the sh-compatible interpretation instead
# of bash.
contains() {
string="$1"
substring="$2"
if test "${string#*$substring}" != "$string"
then
return 0 # $substring is in $string
else
return 1 # $substring is not in $string
fi
}

if test -t 1; then
# Quick and dirty test for color support
if contains "$TERM" "256" || contains "$COLORTERM" "256" || contains "$COLORTERM" "color" || contains "$COLORTERM" "24bit"; then
reset="\033[0m"
green="\033[38;5;46m"
yellow="\033[38;5;178m"
red="\033[91m"
orange="\033[38;5;208m"

emphasis="\033[38;5;226m"
elif contains "$TERM" "xterm"; then
reset="\033[0m"
green="\033[32m"
yellow="\033[33m"
red="\033[31;1m"
orange="\033[31m"

emphasis="\033[33;1m"
fi
fi

info="${green}INFO:${reset}"
notice="${yellow}NOTE:${reset}"
warn="${orange}WARN:${reset}"
error="${red}ERROR:${reset}"
30 changes: 30 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/sh
echo "*******************************"
echo "**** DOMOTICZ STARTING UP *****"
echo "*******************************"

. /commons.sh

# Check if we need to configure the container timezone
if [ ! -z "$TZ" ]; then
TZ_FILE="/usr/share/zoneinfo/$TZ"
if [ -f "$TZ_FILE" ]; then
echo "$notice Setting container timezone to: ${emphasis}$TZ${reset}"
ln -snf "$TZ_FILE" /etc/localtime
echo "$TZ" > /etc/timezone
else
echo "$warn Cannot set timezone to: ${emphasis}$TZ${reset} -- this timezone does not exist."
fi
else
echo "$info Not setting any timezone for the container"
fi

rsync -a --remove-source-files /tmp/domoticz/plugins $HOME
rsync -a --remove-source-files /tmp/domoticz/scripts $HOME
rsync -a --remove-source-files /tmp/domoticz/www/secpanel $HOME/www

curl --create-dirs https://raw.githubusercontent.com/mario-peters/ShellyCloudPlugin/master/plugin.py --output /opt/domoticz/plugins/ShellyCloudPlugin/plugin.py

cd $HOME
chmod +x $HOME/domoticz
$HOME/domoticz -dbase $HOME/db/domoticz.db -log $HOME/db/domoticz.log -www $www -sslwww $sslwww
3 changes: 3 additions & 0 deletions runbetaupdate
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#! /bin/bash
cd /opt/domoticz
/opt/domoticz/updatebeta