Oficial Docker Container Topic is solved

Subforum for general discussions. Do not dump your questions/problems here, but try to find the subforum where it belongs!

Moderators: leecollings, remb0

JanvdW
Posts: 118
Joined: Saturday 21 December 2019 8:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Oficial Docker Container

Post 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?
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Oficial Docker Container

Post by waltervl »

Your python script starts with #!/bin/bash
It should start with
#!/usr/bin/python
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
JanvdW
Posts: 118
Joined: Saturday 21 December 2019 8:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Oficial Docker Container

Post 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
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Oficial Docker Container

Post by waltervl »

Is it still executable? A python script needs to be executable (basic Linux, nothing to do with docker)
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
JanvdW
Posts: 118
Joined: Saturday 21 December 2019 8:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Oficial Docker Container

Post 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
wizworks
Posts: 6
Joined: Tuesday 10 March 2020 3:58
Target OS: Linux
Domoticz version:
Contact:

Re: Oficial Docker Container

Post 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!
Kedi
Posts: 536
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: Oficial Docker Container

Post by Kedi »

Check the write rights to the database.
It looks like the new device is not been created.
Logic will get you from A to B. Imagination will take you everywhere.
User avatar
Varazir
Posts: 360
Joined: Friday 20 February 2015 22:23
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Oficial Docker Container

Post 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 ?
Raspberry PI 2 with RaZberry Controller 2016 ZWave+ and CC2531(zigbee)
Several IKEA devices/z-wave devices
PVerburg
Posts: 7
Joined: Sunday 16 July 2017 6:03
Target OS: Windows
Domoticz version:
Contact:

docker backup not working ??

Post 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,
vgerwen
Posts: 4
Joined: Monday 19 May 2014 12:14
Target OS: Linux
Domoticz version: 2024.4
Contact:

Re: Oficial Docker Container

Post by vgerwen »

How did you start the container. With which options or how does compose file looks. Did you mount all volumes?
Running Domoticz 2024.4 on Intel NUC5CPYH Ubuntu Docker
Hardware: RfxComm, Zigbee2MQTT - Conbee, P1 interface usb
PVerburg
Posts: 7
Joined: Sunday 16 July 2017 6:03
Target OS: Windows
Domoticz version:
Contact:

Re: Oficial Docker Container

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest