-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Software title: Domoticz Home Automation System
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.
- Loading branch information
1 parent
9fd669b
commit 54c1050
Showing
5 changed files
with
138 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Domoticz is an open-source home automation platform that allows you to control and monitor smart devices in your home. It supports a wide range of devices, including lights, sensors, thermostats, and cameras. Through its web interface or mobile app, you can set up automation rules and schedules, providing greater convenience and energy efficiency. It’s customizable, flexible, and can be run on a variety of hardware platforms supported by Armbian. | ||
|
||
=== "Access to the web interface" | ||
|
||
The web interface is accessible via port **8080**: | ||
|
||
- URL: `https://<your.IP>:8080` | ||
- Username/Password: admin / domoticz | ||
|
||
=== "Directories" | ||
|
||
- Config directory: `/armbian/domoticz` | ||
|
||
=== "Advanced setup" | ||
|
||
- Primary USB device passing through (`/dev/ttyUSB0`) to Docker container is enabled by default | ||
- For more complex setup, please follow this comprehensive guide: <https://wiki.domoticz.com/Main_Page> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
module_options+=( | ||
["module_domoticz,author"]="@armbian" | ||
["module_domoticz,maintainer"]="@igorpecovnik" | ||
["module_domoticz,feature"]="module_domoticz" | ||
["module_domoticz,example"]="install remove purge status help" | ||
["module_domoticz,desc"]="Install domoticz container" | ||
["module_domoticz,status"]="Active" | ||
["module_domoticz,doc_link"]="https://domoticz.com/docs/" | ||
["module_domoticz,group"]="Monitoring" | ||
["module_domoticz,port"]="8080" | ||
["module_domoticz,arch"]="x86-64 arm64" | ||
) | ||
# | ||
# Module domoticz | ||
# | ||
function module_domoticz () { | ||
local title="domoticz" | ||
local condition=$(which "$title" 2>/dev/null) | ||
|
||
if pkg_installed docker-ce; then | ||
local container=$(docker container ls -a | mawk '/domoticz?( |$)/{print $1}') | ||
local image=$(docker image ls -a | mawk '/domoticz?( |$)/{print $3}') | ||
fi | ||
|
||
local commands | ||
IFS=' ' read -r -a commands <<< "${module_options["module_domoticz,example"]}" | ||
|
||
DOMOTICZ_BASE="${SOFTWARE_FOLDER}/domoticz" | ||
|
||
case "$1" in | ||
"${commands[0]}") | ||
pkg_installed docker-ce || module_docker install | ||
[[ -d "$DOMOTICZ_BASE" ]] || mkdir -p "$DOMOTICZ_BASE" || { echo "Couldn't create storage directory: $DOMOTICZ_BASE"; exit 1; } | ||
docker run -d \ | ||
--name=domoticz \ | ||
--pid=host \ | ||
--net=lsio \ | ||
--device /dev/ttyUSB0:/dev/ttyUSB0 \ | ||
-e PUID=1000 \ | ||
-e PGID=1000 \ | ||
-e TZ="$(cat /etc/timezone)" \ | ||
-p 8080:8080 \ | ||
-p 8443:443 \ | ||
-v "${DOMOTICZ_BASE}:/opt/domoticz/userdata" \ | ||
--restart unless-stopped \ | ||
domoticz/domoticz:stable | ||
for i in $(seq 1 20); do | ||
if docker inspect -f '{{ index .Config.Labels "build_version" }}' domoticz >/dev/null 2>&1 ; then | ||
break | ||
else | ||
sleep 3 | ||
fi | ||
if [ $i -eq 20 ] ; then | ||
echo -e "\nTimed out waiting for ${title} to start, consult your container logs for more info (\`docker logs domoticz\`)" | ||
exit 1 | ||
fi | ||
done | ||
;; | ||
"${commands[1]}") | ||
[[ "${container}" ]] && docker container rm -f "$container" >/dev/null | ||
[[ "${image}" ]] && docker image rm "$image" >/dev/null | ||
;; | ||
"${commands[2]}") | ||
${module_options["module_domoticz,feature"]} ${commands[1]} | ||
[[ -n "${DOMOTICZ_BASE}" && "${DOMOTICZ_BASE}" != "/" ]] && rm -rf "${DOMOTICZ_BASE}" | ||
;; | ||
"${commands[3]}") | ||
if [[ "${container}" && "${image}" ]]; then | ||
return 0 | ||
else | ||
return 1 | ||
fi | ||
;; | ||
"${commands[4]}") | ||
echo -e "\nUsage: ${module_options["module_domoticz,feature"]} <command>" | ||
echo -e "Commands: ${module_options["module_domoticz,example"]}" | ||
echo "Available commands:" | ||
echo -e "\tinstall\t- Install $title." | ||
echo -e "\tstatus\t- Installation status $title." | ||
echo -e "\tremove\t- Remove $title." | ||
echo | ||
;; | ||
*) | ||
${module_options["module_domoticz,feature"]} ${commands[4]} | ||
;; | ||
esac | ||
} |