Page 11 of 11
Re: Oficial Docker Container
Posted: Monday 04 December 2023 20:28
by JanvdW
I did a fresh install of a RPI4 (64 bit OS Lite), installed the latest Docker container for Domoticz beta and tried to get
Evohome via scripting (web) working, but I do not succeed.
I installed the evohome client and copied my custom config file (evoconfig.py) and py scripts to this folder with the custom startup script for the Docker Domoticz container with the following commands:
Code: Select all
sudo apt-get -y install git python3-simplejson python3-setuptools python3-pip python3-dateutil
sudo pip install requests
git clone https://github.com/watchforstock/evohome-client.git
cd /opt/domoticz/config
sudo pip install ./evohome-client
cp /opt/domoticz/userdata/scripts/python/evohome-client/* /opt/domoticz/evohome-client
Addressing the script from with a Dzvents executeShellCommand (as in my 'non-Docker' implementation) results in an error, so I tried to execute the script from the command line:
Code: Select all
docker exec -it domoticz /opt/domoticz/evohome-client/radiator_temp.py Voorkamer "5"
This results in the following errors:
Code: Select all
/opt/domoticz/evohome-client/radiator_temp.py: line 2: import: command not found
/opt/domoticz/evohome-client/radiator_temp.py: line 3: import: command not found
/opt/domoticz/evohome-client/radiator_temp.py: line 4: import: command not found
/opt/domoticz/evohome-client/radiator_temp.py: line 5: from: command not found
/opt/domoticz/evohome-client/radiator_temp.py: line 6: from: command not found
/opt/domoticz/evohome-client/radiator_temp.py: line 7: import: command not found
/opt/domoticz/evohome-client/radiator_temp.py: line 8: import: command not found
/opt/domoticz/evohome-client/radiator_temp.py: line 11: syntax error near unexpected token `('
/opt/domoticz/evohome-client/radiator_temp.py: line 11: `client = EvohomeClient(evoconfig.usr, evoconfig.pw)'
This is the radiator_temp.py:
Code: Select all
#!/bin/bash
import evoconfig
import sys
import requests
from evohomeclient2 import EvohomeClient
from datetime import datetime
import datetime
import time
# Zet de systeem status op 'Normal' als hij op 'Away' is ingesteld
client = EvohomeClient(evoconfig.usr, evoconfig.pw)
status=client.locations[0].status()
tcs=status['gateways'][0]['temperatureControlSystems'][0]
zones=tcs['zones']
# Wait to avoid that previous script is still running
time.sleep( 10 )
# Set system in the normal mode if that is not the case
currentmode = tcs['systemModeStatus']['mode']
if currentmode == "Away":
client.set_status_normal()
# Wijzigingen doorvoeren tussen 08:00 en 21:00 uur
dt = datetime.datetime.now()
start_time = "08:00"
end_time = "21:00"
if start_time < dt.strftime("%H:%M") < end_time:
# Aanpassen radiator temperatuur
kamer=sys.argv[1]
if kamer != "aanwezig":
temp=sys.argv[2]
zone = client.locations[0]._gateways[0]._control_systems[0].zones[kamer]
zone.set_temperature(temp)
exit()
What's going wrong here?
Re: Oficial Docker Container
Posted: Monday 04 December 2023 21:38
by waltervl
Your python script starts with #!/bin/bash
It should start with
#!/usr/bin/python
Re: Oficial Docker Container
Posted: Monday 04 December 2023 21:45
by JanvdW
When I change the shebang like that I receive this error message:
Code: Select all
OCI runtime exec failed: exec failed: unable to start container process: exec /opt/domoticz/evohome-client/radiator_temp.py: no such file or directory: unknown
Re: Oficial Docker Container
Posted: Monday 04 December 2023 21:48
by waltervl
Is it still executable? A python script needs to be executable (basic Linux, nothing to do with docker)
Re: Oficial Docker Container
Posted: Monday 04 December 2023 21:51
by JanvdW
Sure, I did check that already:
Code: Select all
-rwxr-xr-x 1 root root 1020 Dec 4 21:42 radiator_temp.py
Re: Oficial Docker Container
Posted: Saturday 13 January 2024 20:47
by wizworks
I installed the latest on docker and I get this in the log when I try to add a dummy switch:
2024-01-13 14:34:23.038 Status: Domoticz V2024.1 (build 15838) (c)2012-2024 GizMoCuz
2024-01-13 14:34:23.038 Status: Build Hash: b97eb6256, Date: 2024-01-13 11:19:22
2024-01-13 14:34:23.038 Status: Startup Path: /opt/domoticz/
2024-01-13 14:34:23.056 Status: PluginSystem: Started, Python version '3.9.2', 0 plugin definitions loaded.
2024-01-13 14:34:23.058 Status: WebServer(HTTP) startup failed on address :: with port: 8080: resolve: Host not found (authoritative) [asio.netdb:1 at /usr/local/include/boost/asio/detail/resolver_service.hpp:84 in function 'resolve'], trying ::
2024-01-13 14:34:23.058 Status: WebServer(HTTP) startup failed on address :: with port: 8080: resolve: Host not found (authoritative) [asio.netdb:1 at /usr/local/include/boost/asio/detail/resolver_service.hpp:84 in function 'resolve'], trying 0.0.0.0
2024-01-13 14:34:23.058 Status: WebServer(HTTP) started on address: 0.0.0.0 with port 8080
2024-01-13 14:34:23.061 Status: WebServer(SSL) startup failed on address :: with port: 443: resolve: Host not found (authoritative) [asio.netdb:1 at /usr/local/include/boost/asio/detail/resolver_service.hpp:84 in function 'resolve'], trying ::
2024-01-13 14:34:23.061 Status: WebServer(SSL) startup failed on address :: with port: 443: resolve: Host not found (authoritative) [asio.netdb:1 at /usr/local/include/boost/asio/detail/resolver_service.hpp:84 in function 'resolve'], trying 0.0.0.0
2024-01-13 14:34:23.062 Status: WebServer(SSL) started on address: 0.0.0.0 with port 443
2024-01-13 14:34:23.063 Status: TCPServer: shared server started...
2024-01-13 14:34:23.063 Status: RxQueue: queue worker started...
2024-01-13 14:34:25.064 Status: NotificationSystem: thread started...
2024-01-13 14:34:25.064 Status: EventSystem: reset all events...
2024-01-13 14:34:25.065 Status: EventSystem: reset all device statuses...
2024-01-13 14:34:25.082 Status: Python EventSystem: Initializing event module.
2024-01-13 14:34:25.082 Status: EventSystem: Started
2024-01-13 14:34:25.082 Status: EventSystem: Queue thread started...
2024-01-13 14:35:02.797 Status: User: admin (IP: 10.1.73.111) initiated a switch command (1/TV/On)
2024-01-13 14:35:02.800 Error: Serious database error, problem getting ID from DeviceStatus!
2024-01-13 14:35:53.732 Status: User: admin (IP: 10.1.73.111) initiated a switch command (2/Unknown/Off)
2024-01-13 14:35:53.733 Error: Serious database error, problem getting ID from DeviceStatus!
2024-01-13 14:36:39.576 Error: Serious database error, problem getting ID from DeviceStatus!
Re: Oficial Docker Container
Posted: Sunday 14 January 2024 11:49
by Kedi
Check the write rights to the database.
It looks like the new device is not been created.
Re: Oficial Docker Container
Posted: Wednesday 07 February 2024 19:23
by Varazir
I'm getting this as well
Code: Select all
2024-02-07 20:37:59.293 Status: Domoticz V2024.4 (build 15904) (c)2012-2024 GizMoCuz
2024-02-07 20:37:59.293 Status: Build Hash: ebd7c557d, Date: 2024-02-07 08:48:05
2024-02-07 20:37:59.293 Status: Startup Path: /opt/domoticz/
2024-02-07 20:37:59.387 Status: PluginSystem: Started, Python version '3.9.2', 1 plugin definitions loaded.
2024-02-07 20:37:59.397 Status: WebServer(HTTP) startup failed on address :: with port: 8080: resolve: Host not found (authoritative) [asio.netdb:1 at /usr/local/include/boost/asio/detail/resolver_service.hpp:84 in function 'resolve'], trying ::
2024-02-07 20:37:59.398 Status: WebServer(HTTP) startup failed on address :: with port: 8080: resolve: Host not found (authoritative) [asio.netdb:1 at /usr/local/include/boost/asio/detail/resolver_service.hpp:84 in function 'resolve'], trying 0.0.0.0
2024-02-07 20:37:59.399 Status: WebServer(HTTP) started on address: 0.0.0.0 with port 8080
2024-02-07 20:37:59.413 Status: WebServer(SSL) startup failed on address :: with port: 443: resolve: Host not found (authoritative) [asio.netdb:1 at /usr/local/include/boost/asio/detail/resolver_service.hpp:84 in function 'resolve'], trying ::
2024-02-07 20:37:59.416 Status: WebServer(SSL) startup failed on address :: with port: 443: resolve: Host not found (authoritative) [asio.netdb:1 at /usr/local/include/boost/asio/detail/resolver_service.hpp:84 in function 'resolve'], trying 0.0.0.0
2024-02-07 20:37:59.420 Status: WebServer(SSL) started on address: 0.0.0.0 with port 443
Why ?
docker backup not working ??
Posted: Sunday 21 April 2024 4:24
by PVerburg
Hi when I restore domoticz in my docker enviroment it starts up with no configuration if I restore a manual backup file ie the internal backup and restore that all is fine.
My question is why is the docker restore no working all the data files are there????
this is in the log file
++++++++++++++++++++
2024-04-21 14:20:39.954 Status: Domoticz V2024.4 (build 15937) (c)2012-2024 GizMoCuz
2024-04-21 14:20:39.954 Status: Build Hash: cad975ce1, Date: 2024-04-15 23:03:00
2024-04-21 14:20:39.954 Status: Startup Path: /opt/domoticz/
2024-04-21 14:20:40.737 Active notification Subsystems: fcm, http (2/13)
2024-04-21 14:20:40.942 Starting shared server on: 0.0.0.0:6144
2024-04-21 14:20:40.728 Status: PluginSystem: Started, Python version '3.9.2', 0 plugin definitions loaded.
2024-04-21 14:20:40.825 Status: WebServer(HTTP) startup failed on address :: with port: 8080: resolve: Host not found (authoritative) [asio.netdb:1 at /usr/local/include/boost/asio/detail/resolver_service.hpp:84 in function 'resolve'], trying ::
2024-04-21 14:20:40.825 Status: WebServer(HTTP) startup failed on address :: with port: 8080: resolve: Host not found (authoritative) [asio.netdb:1 at /usr/local/include/boost/asio/detail/resolver_service.hpp:84 in function 'resolve'], trying 0.0.0.0
2024-04-21 14:20:40.832 Status: WebServer(HTTP) started on address: 0.0.0.0 with port 8080
2024-04-21 14:20:40.938 Status: WebServer(SSL) startup failed on address :: with port: 443: resolve: Host not found (authoritative) [asio.netdb:1 at /usr/local/include/boost/asio/detail/resolver_service.hpp:84 in function 'resolve'], trying ::
2024-04-21 14:20:40.940 Status: WebServer(SSL) startup failed on address :: with port: 443: resolve: Host not found (authoritative) [asio.netdb:1 at /usr/local/include/boost/asio/detail/resolver_service.hpp:84 in function 'resolve'], trying 0.0.0.0
2024-04-21 14:20:40.941 Status: WebServer(SSL) started on address: 0.0.0.0 with port 443
2024-04-21 14:20:40.942 Status: TCPServer: shared server started...
2024-04-21 14:20:40.942 Status: RxQueue: queue worker started...
2024-04-21 14:20:40.102 Error: Default admin password has NOT been changed! Change it asap!
2024-04-21 14:20:42.943 Status: NotificationSystem: thread started...
2024-04-21 14:20:42.958 Status: EventSystem: reset all events...
2024-04-21 14:20:42.978 Status: EventSystem: reset all device statuses...
2024-04-21 14:20:42.992 Status: Python EventSystem: Initializing event module.
2024-04-21 14:20:42.993 Status: EventSystem: Queue thread started...
2024-04-21 14:20:42.993 Status: EventSystem: Started
thanks,
Re: Oficial Docker Container
Posted: Sunday 21 April 2024 10:45
by vgerwen
How did you start the container. With which options or how does compose file looks. Did you mount all volumes?
Re: Oficial Docker Container
Posted: Friday 26 April 2024 3:16
by PVerburg
Sorry for the slow reply The problem was me I'm implementing Domoticz inside IOTstack docker solution and had trouble with the inbuilt backup solution but thats because I wasn't using the correct docker-compose file all is better now.
Re: Oficial Docker Container
Posted: Sunday 26 January 2025 20:40
by smatthew
Intro
I've a Raspberry Pi 2b (512Mb) and I'm still using it. Once every few years the SD card dies losing all Domoticz data which has happened to me twice now

.
This time I've decided to better myself and think of a way to survive the inevitable next death of the fresh replacement SD card. Retiring the Pi and replace it with a Zero is yet a bridge too far
Ok, so where does Docker Domoticz come into play?
At work I overheard colleagues mentioning Docker and Kubernetes and I was googling these tools. Docker stuck in my mind as an interesting option and the SD crash prompted me to ask Co-Pilot (AI-tool of MS) for a plan of attack:
- Image the Pi with Raspberry Pi OS Lite.
- Install Docker.
- Configure the userdata folder as a volume in the .yml pointing to a USB stick (I was planning on asking Co-Pilot later on to schedule backups using rsync to another USB stick.)
- Run docker compose up -d.
This didn't work, since apparently there's no Docker image for linux/arm/v6. I expected as much, because some time before, upgrading non Docker Domoticz broke my installation.
Asked Co-Pilot what to do. The answer was to Install QEMU in order to run the Docker linux/amd64 for Domoticz in emulation mode. Did that and added platform: linux/amd64 to the .yml. Retried docker compose up -d and this time it worked! I was able to open the Domoticz dashboard and I started configuring my home devices, such as Honeywell Evohome (API), Netatmo (have a couple of 'Healthy Home Coaches') as well as Buienradar for weather stats of my surroundings.
My .yml:
Code: Select all
services:
domoticz:
image: domoticz/domoticz:stable
# network_mode: host
container_name: domoticz
restart: unless-stopped
ports:
- "7478:7478"
volumes:
- /mnt/usb1/domoticz/userdata:/opt/domoticz/userdata
devices:
- "/dev/ttyUSB0:/dev/ttyUSB0"
environment:
- TZ=Europe/Amsterdam
platform: linux/amd64
command: ["/opt/domoticz/domoticz", "-www 7478", "-wwwbind 0.0.0.0", "-sslwww 7479"]
But unfortunately..
..the hardware devices didn't work including Buienradar. The log is flooded with the following errors:
Code: Select all
2025-01-26 20:03:14.182 Status: Honeywell ViiAgu: Connect to Evohome server
2025-01-26 20:03:58.171 Error: Honeywell ViiAgu: Login failed with message: Timeout was reached
2025-01-26 20:04:07.308 Error: Netatmo ViiAgu: Error connecting to Server...
2025-01-26 20:05:04.396 Error: Netatmo ViiAgu: Error connecting to Server...
2025-01-26 20:05:30.700 Error: Flevopark Temp: Error getting http data! (Check your internet connection!)
I suspected there was no internet connectivity available somehow to Domoticz running in a Docker container. Accessed the shell in the container and did a curl on Google which worked (HTTP 200 OK).
Found out through Co-Pilot that Docker by default runs in bridge mode, which enables you to run multiple instances of the same application simultaneously. Co-Pilot suggested to switch to host mode by adding a configuration line in the .yml. This didn't make a difference however after bringing the container down and back up.
So now what..
Of course I asked Co-Pilot, but the bot ran out of answers and pointed me to you guys
Is there anything I can do to make my..ehm..Co-Pilot's plan work? If not, then I'll be doing what I used to do:
- Install git etc. and compile Domoticz from source.
- Checking back after a couple days by doing a screen -dr and hoping compilation has completed.
- This time I'll make a symbolic link from the userdata folder to the USB stick.
- Re add hardware devices.
- Recreate scripts.
- Hope the SD card won't die that soon.
Re: Oficial Docker Container
Posted: Monday 27 January 2025 9:16
by gizmocuz
Ohhh man, please stop all this nonesence about arm v6, pi zero, qemu, please!
Get yourself a RPI 4 or 5 and be happy!
And yeah, the RPI 1 + 2 are known for SD card issues
If your house will depend on it, spend some money.
Home automation ain't cheap! (avoid cheap sensors/hardware)
Re: Oficial Docker Container
Posted: Thursday 20 February 2025 22:27
by BarryT
Hello everybody, does someone know how to do autossh with sshpass inside docker/customstart script?
I used an autossh with sshpass from local.rc before that made a connection to my remote VPS so i could connect domoticz behind NATs firewalls, but that is not working in my domoticz docker, and is the last thing it doesnt want to run from the customstart.sh script:
it gives an: sshpass no such file or directory (even after succeed install inside container)
Does anybody know how to do this from the customstart.sh script?
Thanks a lot!
Re: Oficial Docker Container
Posted: Sunday 20 April 2025 14:22
by BarryT
Already fixed. Used an external docker with sshpass in it and mount the local to remote port.

It worked.
Anyway, atm im using vpn with WireGuard since i could also connect trough my local dns and do network things from outside.
Re: Oficial Docker Container
Posted: Tuesday 22 April 2025 13:44
by akamming
gizmocuz wrote: ↑Monday 27 January 2025 9:16
Ohhh man, please stop all this nonesence about arm v6, pi zero, qemu, please!
Get yourself a RPI 4 or 5 and be happy!
And yeah, the RPI 1 + 2 are known for SD card issues
If your house will depend on it, spend some money.
Home automation ain't cheap! (avoid cheap sensors/hardware)
I don't know if my n=1 experience is representative, but just want to mention it. I was running domoticz native on pi 4b without any issues. Then i tried running it under docker (i know, "why?!?". the answer is "why not". it is fun playing around

). That went fine for about 2 weeks and then my SD card crashed. Tried on another (new) SD card, and had the same issue one week later.
Now back to a native (non docker) domoticz install and it is running fine again. Since that moment i also run a domoticz docker on another Pi 4, but with a SSD, and that also runs fine... Moral of the story:
In my N=1 experience PI4, SDcards en docker are not a happy combination. If you want it done correctly, even on Pi 4: Move away from SD cards to SSD. Will give you a performance bonus as well, cause the system is much more responsive.
Re: Oficial Docker Container
Posted: Sunday 04 May 2025 9:05
by gizmocuz
No issues with SD cards and docker... very strange. Also make sure you have to correct type of SD card