No connection with DECONZ possible

Hi folks, I would like to use diyhue in conjunction with my Deconz installation, but unfortunately I can’t get it to work :frowning: I really hope someone can help me here.

I followed the instructions under: https://diyhue.readthedocs.io/en/latest/lights/raspbee.html#deconz-installation

But every time I open http://{hue emulator ip}/deconz I only see this and nothing else happens.:

For background information. Both Deconz and diyhue run as docker container. So I told diyhue the IP of the deconz container using the environment variable.
I can also ping the deconz container from within the diyhue container and vice versa. So both containers should be able to see each other.

This is an extract from my Docker Compose file for the two containers:

deconz:
    image: marthoc/deconz
    container_name: deconz
    networks:
      mynet:
        ipv4_address: 192.168.178.201
    restart: always
    volumes:
      - /srv/dev-disk-by-id-ata-ST32000542AS_5XW2HFG7/data/docker_data/deconz:/root/.local/share/dresden-elektronik/deCONZ
      - /srv/dev-disk-by-id-ata-ST32000542AS_5XW2HFG7/data/docker_data/deconz/otau:/root/otau
    devices:
      - /dev/ttyACM0
    environment:
      - TZ=Europe/Berlin
      - DECONZ_WEB_PORT=8080
      - DECONZ_WS_PORT=8081
      - DECONZ_DEVICE=/dev/ttyACM0
      - DECONZ_VNC_MODE=1
      - DECONZ_VNC_PORT=5900
      - DECONZ_VNC_PASSWORD=xxxxxx
      - DEBUG_INFO=1
      - DEBUG_APS=0
      - DEBUG_ZCL=0
      - DEBUG_ZDP=0
      - DEBUG_OTAU=0
    ports:
      - "8080:8080"
      - "8081:8081"
      - "5900:5900"

diyhue:
    image: diyhue/core:latest
    container_name: diyhue
    depends_on:
      - "deconz"
    networks:
       mynet:
           ipv4_address: 192.168.178.202
    restart: always
    volumes:
       - /srv/dev-disk-by-id-ata-ST32000542AS_5XW2HFG7/data/docker_data/diyhue/export:/opt/hue-emulator/export/
    environment:
       - DECONZ=192.168.178.201

These were the steps I took for the installation:

  • I have started both containers
  • I have connected my Hue app to diyhue (worked)
  • I have activated the connection of further apps in the Phoscon App in the Gateway section
  • I went to the Deconz page in diyhue (there I only see the picture above)

Now I don’t know where we go from here. I can’t find any lamps in the Hue app and the diyhue frontend doesn’t give me any feedback if the connection to deconz worked or what the reason was if not.

Thank you very much in advance

Have you added any lights to Deconz yet? If not, then you won’t see anything change in DIYHue.

Of course. At the moment I have 23 lamps connected in deconz.

Have you either modified the default ports for deconz or modified your diyHue config file?

As you can see in the excerpt of my docker Compose file, I have deconz running on port 8080. I did not manually change the diyhue config.

Thanks for your help.

And you have searched for Lights via the Hue app? Followed the rest of the instructions for installing Deconz in readthedocs? Have you tried pulling the log out for DIYHue?

Yes, I searched for lights in the Hue App.
Sorry, I don’t realy know where to find the logs of diyhue? :neutral_face:
The logs of the container are not realy helpfull. There I just see this:

192.168.178.7 - - [29/Mar/2020 11:03:10] "GET /deconz? HTTP/1.1" 200 -
192.168.178.7 - - [29/Mar/2020 11:03:14] "GET /deconz? HTTP/1.1" 200 -
192.168.178.7 - - [29/Mar/2020 11:03:16] "GET /deconz? HTTP/1.1" 200 -
{"ok"}
{"ok"}
{"ok"}

Set DEBUG env variable to see what is happening during pair process. Try to access just /deconz not /deconz? For most hue app’s is mandatory to set host IP address and host mac address because there the https certificate used for communication is based on mac address. When you made a mistake with the certificate you need to start from scratch and to wipe hue app’s data in order to remove the old cached certificate.

Ok, I started the container again with DEBUG=True as environment variable. I have now also explicitly specified a Mac address and IP address, although this should make no difference, both containers are located in Macvlan and thus act as independent hosts.

Unfortunately the output didn’t become more helpful with this.

192.168.178.5 - - [30/Mar/2020 20:31:33] "GET /deconz HTTP/1.1" 200 -
192.168.178.5 - - [30/Mar/2020 20:31:33] code 404, message not found
192.168.178.5 - - [30/Mar/2020 20:31:33] "GET /favicon.ico HTTP/1.1" 404 -
192.168.178.5 - - [30/Mar/2020 20:31:35] "GET /deconz? HTTP/1.1" 200 -

I now see a 404 notification, but honestly don’t know why, as both containers could definitely see each other as I said. Whether I call the diyhue page with “/deconz” or “/deconz?” makes no difference, it redirects me to “/deconz?” anyway.

Interestingly, I found out that I can also specify an IP address and port via “Import from Bridge”. With that the connection worked immediately :smiley: But I guess this connection method is for original Hue Bridges? So I don’t know if there are any disadvantages in connection with Deconz?

Deconz provide also an websocket where the emulator receive sensors and remotes events. Now you are able to control only the lights. The issue was not with diyhue here, but with Deconz because it must run on port 8080 by default (you can specify the port in diyhue also). Currently Deconz run on port 80 and this allow diyhue to pair with it as a regular hue bridge.

I’m sorry, but you’re completely wrong. Once again: As you can see in the excerpt from my docker Composer yaml, I am definitely running deconz on port 8080 and not port 80.

To have all the functionality I would also like to use the deconz integration instead of the Hue Bridge integration. But how?

I saw you set env variable to run deconz on 8080, but hue bridge pair process is made on port 80. Better enter in diyhue container and execute telnet or curl from there to see if it reach deconz on 80 or 8080

Deconz here definitely runs over port 8080:

I also added it exactly the same as bridge:

457457t

As I said, I only added it as a bridge because the diyhue deconz integration did not work at all. :-/

Add DEBUG env variable to diyhue container and show here the output during pair process.

As you can see here I already did that:

But I will give it another try, when I come home later

Ok, the debug output was unfortunately not more helpful than last time. I simply deleted the complete config.json and did the configuration again.
Now the connection with the Deconz integration has worked right away. :slight_smile: Must have been a misconfiguration in my config, however that happened :face_with_raised_eyebrow:

Hi CM000n,

can you explain how exactly you´ve started your diyHue and deconz Container and how it´s workin together? I´ve got the same problem with my Setup.

Thank you

You have to have the two containers using the same docket network. The easiest way to do it, if port 80 is available on your host, is to run them both in Host network mode. Then they should be able to like up with each othet as long as you run Deconz with the modifications required. However, running Deconz in Docker means you’d also have to link your radio to the container. That always seemed like too much work to me so I always run Deconz natively in the Host OS.