Page 1 of 1

problem using json in container

Posted: Wednesday 18 February 2026 12:10
by BartSr
Hi! I am facing problems when I try to use json
Domoticz in docker.

Code: Select all

services:
  domoticz:
    image: domoticz/domoticz:stable
    container_name: domoticz
    restart: unless-stopped
    # Pass devices to container
    devices:
      - "/dev/serial/by-id/usb-RFXCOM_RFXtrx433_A1BFAMG-if00-port0:/dev/ttyUSB0"
    ports:
      - "8080:8080"
    volumes:
      - ./config:/opt/domoticz/userdata/
      # regel toegevoegd om extra schermen (custom) te bereiken
      - ./custom:/opt/domoticz/www/custom
    environment:
      - TZ=Europe/Amsterdam
      #- LOG_PATH=/opt/domoticz/userdata/domoticz.log
This does not work (404 error) (input from browser IP# and port are correct)

Code: Select all

http://192.168.2.100:8080/domoticz/json.htm?type=devices
Chatgpt says

Code: Select all

🔹 Important Point

In the Domoticz Docker image domoticz/domoticz:stable from version 2025.2:

The old /json.htm API is not available in this container build.

This image is mainly intended for GUI + plugins.

Any scripts that try to fetch data via /json.htm will always return 404.

So, regardless of roomplan or idx, you cannot use this API.
any idea? chatgpt propose to downgrade to older container which I don't think being a real solution

any suggestions?

Re: problem using json in container

Posted: Wednesday 18 February 2026 12:13
by jvdz
Is localhost and/or. 127.0.0.1 part of the trusted networks in domoticz setup?

Re: problem using json in container

Posted: Wednesday 18 February 2026 12:18
by BartSr
In trusted networks:
192.168.2.*;127.0.0.*

Re: problem using json in container

Posted: Wednesday 18 February 2026 15:30
by RonkA
In my Docker setup inside my nas i can see under network it says bridge.
If i expand this line it reads that the gateway uses 127.17.0.1, so internal this is the first IP-adres used.
The second internal IP-adres is 127.17.0.2 and that is the IP-adres used for Domoticz inside the Docker-container in my setup..
This IP-adres i set into trusted networks and all worked for me..

Re: problem using json in container

Posted: Wednesday 18 February 2026 18:37
by BartSr
RonkA, thanks for your message. Are you using the official domoticz container? Is the bridge something being part of Nas network?

Re: problem using json in container

Posted: Wednesday 18 February 2026 19:14
by waltervl
Chatgpt is partly right, you use an old API call. But the new one will work....
You have to use

Code: Select all

/json.htm?type=command&param=getdevices
See also wiki https://wiki.domoticz.com/Domoticz_API/ ... and_newer)

You probably used an example based on old API calls

Re: problem using json in container

Posted: Wednesday 18 February 2026 19:48
by RonkA
I use the official container docker:latest on my Synology Nas, this is what i see:
docker1.PNG
docker1.PNG (45.55 KiB) Viewed 60 times
so for usage of json in scripts i use for example:

Code: Select all

-- Clear the log of the textdevice
        domoticz.openURL('http://127.17.0.2:80/json.htm?type=command&param=clearlightlog&idx=337')