Skip to content

Commit

Permalink
Software title: Domoticz Home Automation System
Browse files Browse the repository at this point in the history
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
igorpecovnik committed Jan 29, 2025
1 parent 9fd669b commit 54c1050
Show file tree
Hide file tree
Showing 5 changed files with 138 additions and 0 deletions.
Binary file added tools/include/images/DOM002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions tools/include/markdown/DOM001-header.md
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>
33 changes: 33 additions & 0 deletions tools/json/config.software.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,39 @@
"status": "Preview",
"author": "@igorpecovnik",
"condition": "module_haos status"
},
{
"id": "DOM001",
"description": "Domoticz open source home automation",
"about": "This operation will install Domoticz.",
"command": [
"module_domoticz install"
],
"status": "Preview",
"author": "@igorpecovnik",
"condition": "! module_domoticz status"
},
{
"id": "DOM002",
"description": "Domoticz remove",
"about": "This operation will remove Domoticz.",
"command": [
"module_domoticz remove"
],
"status": "Preview",
"author": "@igorpecovnik",
"condition": "module_domoticz status"
},
{
"id": "DOM003",
"description": "Domoticz purge with data folder",
"about": "This operation will purge Domoticz.",
"command": [
"module_domoticz purge"
],
"status": "Preview",
"author": "@igorpecovnik",
"condition": "module_domoticz status"
}
]
},
Expand Down
1 change: 1 addition & 0 deletions tools/modules/runtime/config.runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ update_sub_submenu_data "Software" "Printing" "OCT002" "http://$LOCALIPADD:${mod
# Home automation
update_sub_submenu_data "Software" "HomeAutomation" "HAB002" "http://$LOCALIPADD:${module_options["module_openhab,port"]}"
update_sub_submenu_data "Software" "HomeAutomation" "HAS002" "http://$LOCALIPADD:${module_options["module_haos,port"]}"
update_sub_submenu_data "Software" "HomeAutomation" "DOM002" "http://$LOCALIPADD:${module_options["module_domoticz,port"]}"

# DNS
update_sub_submenu_data "Software" "DNS" "DNS003" "http://$LOCALIPADD:${module_options["module_pi_hole,port"]%% *}" # removing second port from url
Expand Down
87 changes: 87 additions & 0 deletions tools/modules/software/module_domoticz.sh
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
}

0 comments on commit 54c1050

Please sign in to comment.