Page 1 of 1

[FIXED] Domoticz on Docker (non-root user): Serial devices not showing in "hardware" form

Posted: Saturday 04 November 2023 17:42
by Pepsi92
Hello everyone,

I'm using Domoticz for 7 years and I'm taking the opportunity of the migration to zwave-js-ui to reinstall everything from scratch with a completely new architecture (docker, mqtt, zwave-j-ui,...). As I'm also discovering Docker and MQTT it is not as easy as I thought to have everything working :lol:

As a matter of principle, I try to have all the components running as non-root users. It works ok with mosquitto and zwave-js-ui but I'm stuck with Domoticz. It seems to work correctly, except that I cannot see the serial devices when trying to add new hardware (Teleinfo EDF and RFXtrx433 USB devices).

The devices are correctly mapped in the container but Domoticz does not detect them and does not propose them in the dropdown list in the hardware tab (list is empty) :cry:

Domoticz hardware form
Domoticz hardware form
Capture 2023-11-04 à 17.30.15.png (218.43 KiB) Viewed 4126 times

... whereas the devices exist in the container (/dev/linky and /dev/RFXtrx433)

Existing devices in the container
Existing devices in the container
Capture 2023-11-04 à 17.34.05.png (176.32 KiB) Viewed 4126 times

I use the following docker compose file to create the container (part of a Portainer stack) :

Code: Select all

version: "3.8"
services:
  domoticz:
    image: domoticz/domoticz:beta
    container_name: domoticz
    restart: unless-stopped
    user: 5000:20
    environment:
      - WWW_PORT=8080
      - SSL_PORT=8443
      - TZ=Europe/Paris  
    ports:
      - 8080:8080
      - 8443:8443
    networks:
      - domo-net
    volumes:
      - /home/domoticz/data:/opt/domoticz/userdata
    devices:
      - '/dev/serial/by-id/usb-Cartelectronic_Interface_USB_1_TIC_DA1U76CP-if00-port0:/dev/linky'
      - '/dev/serial/by-id/usb-RFXCOM_RFXtrx433_A13UIUO-if00-port0:/dev/RFXtrx433'

<...>

networks:
  domo-net:
UID 5000 (domoticz) is the UID of the domoticz user on the raspberry and GID 20 (dialout) id the GID allowing access to the /dev/USB* devices.

Any idea why these devices are not showing in Domoticz?

Thanks a lot for your help

Edit: same issue when Domoticz is running as root :(

Re: Domoticz on Docker (non-root user): Serial devices not showing in "hardware" form

Posted: Sunday 05 November 2023 11:25
by Pepsi92
FIXED !

Domoticz seems to only support /dev/ttyUSB* or /dev/ttyACM* serial port names.

Replacing /dev/linky by /dev/ttyUSB0 and /dev/RFXtrx433 by /dev/ttyUSB1 fixed the problem.

Re: [FIXED] Domoticz on Docker (non-root user): Serial devices not showing in "hardware" form

Posted: Thursday 30 November 2023 18:30
by D3ni3d
What the hell !!!!!
2 weeks I'm looking to find "why my fu****g ttyAMA0 is not available in Domoticz ?"

And you save my life !!!
I've the same config, same starting point : reinstall everything from scratch with a completely new architecture (docker, mqtt, zigbee2mqtt). I'm also discovering Docker ... :D

But the real question : why does serial ports are filtered in domoticz's IHM ?

Bref, maintenant, tout est retombé en marche grâce à toi : merci !!!

Re: [FIXED] Domoticz on Docker (non-root user): Serial devices not showing in "hardware" form

Posted: Saturday 06 January 2024 8:06
by gizmocuz
Well yes it does make sense... If you type

ls /dev

you will see many devices... How would one know which one is a serial port?

Domoticz lists all devices starting with /dev/ttyUSB*, and /dev/serial/by-id

You could also mount to the same mount point like:

- '/dev/serial/by-id/usb-Cartelectronic_Interface_USB_1_TIC_DA1U76CP-if00-port0:/dev/serial/by-id/usb-Cartelectronic_Interface_USB_1_TIC_DA1U76CP-if00-port0

Re: [FIXED] Domoticz on Docker (non-root user): Serial devices not showing in "hardware" form

Posted: Saturday 30 November 2024 19:01
by solarboy
gizmocuz wrote: Saturday 06 January 2024 8:06

You could also mount to the same mount point like:

- '/dev/serial/by-id/usb-Cartelectronic_Interface_USB_1_TIC_DA1U76CP-if00-port0:/dev/serial/by-id/usb-Cartelectronic_Interface_USB_1_TIC_DA1U76CP-if00-port0
I just tried that with
devices:
- "/dev/serial/by-id/usb-0658_0200-if00:/dev/serial/by-id/usb-0658_0200-if00"
- "/dev/serial/by-id//usb-1a86_USB2.0-Ser_-if00-port0:/dev/serial/by-id//usb-1a86_USB2.0-Ser_-if00-port0"
and still got the blank form.

Re: [FIXED] Domoticz on Docker (non-root user): Serial devices not showing in "hardware" form

Posted: Saturday 07 December 2024 8:17
by gizmocuz
How about you try

- "/dev/serial/by-id/usb-0658_0200-if00-port0:/dev/ttyUSB0"

And for sure you need to replace 'usb-0658_0200-if00-port0' with your real serial device that you should be able to find with

ls /dev/serial-by-id

Re: [FIXED] Domoticz on Docker (non-root user): Serial devices not showing in "hardware" form

Posted: Monday 13 January 2025 9:17
by tulips
I can't mange to get it work. Only by usb0 and usb1 and so. No solution to link it to Id?

Use unraid

Re: [FIXED] Domoticz on Docker (non-root user): Serial devices not showing in "hardware" form

Posted: Monday 13 January 2025 9:36
by waltervl
tulips wrote: Monday 13 January 2025 9:17 I can't mange to get it work. Only by usb0 and usb1 and so. No solution to link it to Id?

Use unraid
What are you not getting to work? Connect a USB device to the docker environnment?
Give your Docker-compose.xml file please.