Code Monkey home page Code Monkey logo

domoticz-docker's Introduction

Domoticz

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

Multi platform: Linux/Windows/Embedded Devices

This system is designed to operate in various operating systems. The user-interface is a scalable HTML5 web frontend, and is automatically adapted for Desktop and Mobile Devices. Compatible with all recent browsers

Some Information

  • Hardware: RFXCOM Transceiver, Zigbee, Z-Wave, P1 Smart Meter, YouLess Meter, Pulse Counters, 1-Wire, Philips Hue and a lot more....
  • Extended logging
  • iPhone / Android / Windows 10 (Phone & Desktop) push notifications
  • Auto learning sensors/switches
  • Manual creation of switch codes
  • Share / Use external devices
  • Designed for simplicity

Support

By default Domoticz is protected by a username (admin) and password (domoticz).

Please either change the password as soon as possible or create a different admin user and remove the default (admin) user.

More information on securing your Domoticz setup can be found in the SECURITY SETUP documentation.

Your first place for support is the Domoticz Forum

The Github issue tracker is NOT for end-user support.

Security issues

See the Security file for more information.

Donations

Donations are more than welcome and will be used to buy new hardware, devices, sensors, hosting and coffee. If you like the product or encourage the development, please use the link:

paypal

More information

Build Status

Status Operating system
Status Linux Linux x86_64
Status Windows Windows

domoticz-docker's People

Contributors

bunny1985 avatar gizmocuz avatar heggink avatar robbitbv avatar sylvainper avatar waltervl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

domoticz-docker's Issues

Domoticz behind NGINX reverse proxy doesn't get Real IP

Hello,
I would like to enable one host for API access under Domoticz (trusted ip). I noticed that I always find only my proxy IP in the Domoticz log. I have taken the time and recreated this, as follows:

docker-compose.yml


version: '3'

services:
  nginx: 
    image: nginx:latest
    container_name: domoticz_nginx
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf
    ports:
      - 80:80
  domoticz:
    image: domoticz/domoticz
    container_name: domoticz
    restart: unless-stopped
    # Pass devices to container
    # devices:
    #   - "/dev/serial/by-id/usb-0658_0200-if00:/dev/ttyACM0"
    ports:
      - "8080:8080"
    volumes:
      - ./config:/opt/domoticz/userdata
    environment:
      - TZ=Europe/Berlin
      #- LOG_PATH=/opt/domoticz/userdata/domoticz.log

https://www.domoticz.com/wiki/WebServer_Proxy
demo nginx.conf according to your wiki:

events {

}

http {
  error_log /etc/nginx/error_log.log warn;
  client_max_body_size 20m;
  
  proxy_cache_path /etc/nginx/cache keys_zone=one:500m max_size=1000m;

server {
       listen 80 default_server;
       #listen [::]:443 ssl default_server;
       server_name localhost;

       #ssl_certificate www.mydomoain.com.crt;
       #ssl_certificate_key www.mydomoain.com.key;

       access_log /var/log/nginx/domoticz-access.log;
       error_log /var/log/nginx/domoticz-error.log;

       location / {
               #rewrite ^/domoticz/?(.*) /$1 break;
               proxy_http_version		1.1;
               proxy_read_timeout		90;
               proxy_set_header        Host $host;
               proxy_set_header        X-Real-IP $remote_addr;
               proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
               proxy_set_header        X-Forwarded-Proto $scheme;
               proxy_set_header		X-Scheme $scheme;
               proxy_set_header		Upgrade $http_upgrade;
               #proxy_set_header		Connection $connection_upgrade;
               add_header				X-Frame-Options SAMEORIGIN;
               proxy_pass http://domoticz:8080;
       }
    }
}

bring it up:
-Desk:~/Apps/domoticz$ docker-compose up

Creating domoticz       ... done
Creating domoticz_nginx ... done
Attaching to domoticz_nginx, domoticz
nginx_1     | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
nginx_1     | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
nginx_1     | /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
nginx_1     | 10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
nginx_1     | 10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf
nginx_1     | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
nginx_1     | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
nginx_1     | /docker-entrypoint.sh: Configuration complete; ready for start up
domoticz    | 2022-12-12 18:35:13.256  Status: Domoticz V2022.2 (build 14831) (c)2012-2022 GizMoCuz
domoticz    | 2022-12-12 18:35:13.256  Status: Build Hash: 020481afa, Date: 2022-12-10 21:14:48
domoticz    | 2022-12-12 18:35:13.256  Status: Startup Path: /opt/domoticz/
domoticz    | 2022-12-12 18:35:13.263  Sunrise: 08:21:00 SunSet: 16:33:00
domoticz    | 2022-12-12 18:35:13.263  Day length: 08:11:00 Sun at south: 12:27:00
domoticz    | 2022-12-12 18:35:13.263  Civil twilight start: 07:44:00 Civil twilight end: 17:11:00
domoticz    | 2022-12-12 18:35:13.263  Nautical twilight start: 07:03:00 Nautical twilight end: 17:52:00
domoticz    | 2022-12-12 18:35:13.263  Astronomical twilight start: 06:23:00 Astronomical twilight end: 18:31:00
domoticz    | 2022-12-12 18:35:13.281  Status: PluginSystem: Started, Python version '3.7.3', 0 plugin definitions loaded.
domoticz    | 2022-12-12 18:35:13.283  Active notification Subsystems: (0/13)
domoticz    | 2022-12-12 18:35:13.284  Status: WebServer(HTTP) startup failed on address :: with port: 8080: resolve: Host not found (authoritative), trying ::
domoticz    | 2022-12-12 18:35:13.284  Status: WebServer(HTTP) startup failed on address :: with port: 8080: resolve: Host not found (authoritative), trying 0.0.0.0
domoticz    | 2022-12-12 18:35:13.285  Status: WebServer(HTTP) started on address: 0.0.0.0 with port 8080
domoticz    | 2022-12-12 18:35:13.285  Status: [web:8080] Adding IPv4 network (192.168.10.45) to list of trusted networks.
domoticz    | 2022-12-12 18:35:13.290  Status: WebServer(SSL) startup failed on address :: with port: 443: resolve: Host not found (authoritative), trying ::
domoticz    | 2022-12-12 18:35:13.290  Status: WebServer(SSL) startup failed on address :: with port: 443: resolve: Host not found (authoritative), trying 0.0.0.0
domoticz    | 2022-12-12 18:35:13.291  Status: WebServer(SSL) started on address: 0.0.0.0 with port 443
domoticz    | 2022-12-12 18:35:13.291  Status: [web:443] Adding IPv4 network (192.168.10.45) to list of trusted networks.
domoticz    | 2022-12-12 18:35:13.291  Starting shared server on: 0.0.0.0:6144
domoticz    | 2022-12-12 18:35:13.291  Status: TCPServer: shared server started...
domoticz    | 2022-12-12 18:35:13.292  Status: RxQueue: queue worker started...
domoticz    | 2022-12-12 18:35:15.292  Status: NotificationSystem: thread started...
domoticz    | 2022-12-12 18:35:15.293  Status: EventSystem: reset all events...
domoticz    | 2022-12-12 18:35:15.293  Status: EventSystem: reset all device statuses...
domoticz    | 2022-12-12 18:35:15.301  Status: Python EventSystem: Initializing event module.
domoticz    | 2022-12-12 18:35:15.301  Status: EventSystem: Started
domoticz    | 2022-12-12 18:35:15.301  Status: EventSystem: Queue thread started...
domoticz    | 2022-12-12 18:37:01.923  Status: Login successful from 172.19.0.3 for user 'admin'
domoticz    | 2022-12-12 18:37:01.923  Status: [web:8080] Incoming connection from: 172.19.0.3
domoticz    | 2022-12-12 18:48:56.317  Status: Login successful from 172.19.0.3 for user 'admin'
domoticz    | 2022-12-12 18:48:56.317  Status: [web:8080] Incoming connection from: 172.19.0.3

-Desk:~$ docker ps -a

CONTAINER ID   IMAGE               COMMAND                  CREATED         STATUS         PORTS                                                NAMES
eff9a1860d76   nginx:latest        "/docker-entrypoint.…"   6 minutes ago   Up 6 minutes   0.0.0.0:80->80/tcp, :::80->80/tcp                    domoticz_nginx
e341531ce338   domoticz/domoticz   "docker-entrypoint.s…"   6 minutes ago   Up 6 minutes   443/tcp, 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp   domoticz

-Desk:~$ docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' domoticz_nginx
172.19.0.3

Get the proxy logs:
-Desk:~/Apps/domoticz/config$ docker exec -it domoticz_nginx bash -c "tail -f /var/log/nginx/domoticz-access.log"

172.19.0.1 - - [12/Dec/2022:18:37:03 +0000] "GET /app/DashboardController.js HTTP/1.1" 200 24406 "http://localhost/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"
172.19.0.1 - - [12/Dec/2022:18:37:03 +0000] "GET /json.htm?type=plans HTTP/1.1" 200 41 "http://localhost/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"
172.19.0.1 - - [12/Dec/2022:18:37:03 +0000] "GET /json.htm?type=devices&filter=all&used=true&favorite=1&order=[Order]&plan=0 HTTP/1.1" 200 239 "http://localhost/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"
172.19.0.1 - - [12/Dec/2022:18:37:03 +0000] "GET /json.htm?type=command&param=getSunRiseSet HTTP/1.1" 200 199 "http://localhost/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"

Each access is logged with the proxy ip, there is something missing?!
Can you please help me further?

curl is installed then removed

Hello,
Just wandering why installing curl and ask to remove it few lines after.
I add manually after, could it be kept ?

   && apt-get update \
    && apt-get install --no-install-recommends -y \
        tzdata \
        unzip \
        git \
        libudev-dev \
        libusb-0.1-4 \
        libsqlite3-0 \
        curl libcurl4 libcurl4-gnutls-dev \
        libpython3.7-dev \
        python3 \
        python3-pip \

    && apt-get remove --purge --auto-remove -y curl \

Thanks

domoticz on docker/synology

I'm running domoticz in Docker on my Synology NAS and when hitting the settings button, I'm getting an error saying this has failed. Any thoughts on this?

afbeelding

I'm also looking for a way to run PHP scripts that are on my NAS. I was running my scripts the following way, but I don't think docker is able to get to the script?

script:///usr/local/bin/php73 /path/to/script.php

'outdated' - bullseye-slim - PHP 7.4

Seems bullseye-slim comes by default with PHP 7.4.

I would like to use PHP 8.2 with Domoticz as such I presume default docker needs to be build against Bookworm will this be available soon?

Bring www/templates to userdata.

Currently templates are inside the docker container.
Now I do it with:
volumes: - /var/lib/docker/volumes/domoticz/www/templates:/opt/domoticz/www/templates
Nicer would have been that the templates could be part of the userdata or symlink the templates to userdata.

image 2022.2 changed after-the fact

The image domoticz/domoticz:2022.2 has changed after the fact.
Also artifacts of 2023.1 image exists in this particular image now.
It looks like this happened somewhere in februari.

The original image has id: 3d04cadd68f1.
The current 2022.2 image has an id: 7e966eadcddd

This image also does not start well.
This may lead to very unexpected results. Can something be done about this?

Tags of stable image 2023.2 is wrong

The current stable image should be taged as 2023.2. It currently is tagged as 2023.1 and as stable. This can break setups which want to pin to version 2023.1

No Python support in Docker?

First of all thank you for your great work. I'm testing how it looks like
Hi As far as I can see there is no python3 installed so no plugins will work.
I think it could be changed,
( one line in dockerfile)
For now I will have to build on top of this :)

Reaching domoticz from within the docker container

Thank you for sharing this repository!
I've been able to succesfully host domoticz from the docker container and can run (python) scripts from the /opt/domoticz/userdata/scripts folder.

I would like to request some information from domoticz in my scripts. Hence, I need to reach domoticz from within the docker container. I would have anticipated to be able to call http://127.0.0.1:8080/json.htm, but that times out.
Note that I am able to make those calls from outside of the container using the ip-address of the host-machine. Given that (by default) the portmapping 8080:8080 is used; I don't think I'm using a wrong port; and next to 127.0.0.1 I've also used localhost and 0.0.0.0, but to no avail.
Also using the host's ip address or 172.17.0.1 from within the docker container does not work.

Do you have any ideas / pointers on how to debug/resolve this?

custom tab problem

Hello,

since the latest domoticz-docker i've a problem with zigbee2mqtt plugin and Domoticz Plugins Manager (stas-demydiuk). I no longer see the custom tab.

I can no longer find the option "tab enabled" in the settings

Can you please help me ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.