Install phoscon in docker on Raspberry Pi

To connect the Conbee II to a Raspberry Pi we need to install the deCONZ phoscon gateway web UI to connect to zigbee devices.

After installing Docker on Raspberry Pi and installing Home Bridge in Docker, we can configure phoscon.

Grant the proper permissions to the pi user

sudo usermod -a -G dialout $USER

Create directory for the docker configuration

mkdir /home/pi/deconz
mkdir /home/pi/deconz/opt

Create the docker-compose yaml file /home/pi/deconz/docker-compose.yml with the following contents

version: "2"
services:
  deconz:
    image: marthoc/deconz
    container_name: deconz
    network_mode: host
    restart: always
    volumes:
      - /opt/deconz:/root/.local/share/dresden-elektronik/deCONZ
    devices:
      - /dev/ttyACM0
    environment:
      - DECONZ_WEB_PORT=8080
      - DECONZ_WS_PORT=8443
      - DEBUG_INFO=1
      - DEBUG_APS=0
      - DEBUG_ZCL=0
      - DEBUG_ZDP=0
      - DEBUG_OTAU=0

The device path above is for the Conbee II, the original Conbee (/dev/ttyUSB0) and the Raspbee (/dev/ttyAMA0)use different paths.

Plug in the Conbee II to a USB extension then into the Raspberry Pi.

Start docker by running

cd /home/pi/deconz
docker-compose up -d

You can now access phoscon at http://raspberrypi.local:8080

Skip the option to create a new lamp and to create a first group.

Change timezone under Settings > Gateway > Advanced

Add new devices under devices (Light, Switch, Sensor) and click the Add new button

Connect phoscon to homebridge

In homebridge, add new plugin homebridge-hue

Under settings, add the new bridge at localhost:8080

Under Resource Types, select the types of devices you want to show in Home Kit (lights, switches, sensors, etc)

Save these settings

Set the homebridge-hue plugin to start as a child bridge. This will consume a little more memory, but will isolate this plugin from other homebridge plugins.

Select the wrench icon, then Bridge Settings, and enable as child bridge

Restart homebridge to apply the new plugin and settings.

As homebridge is restarting, you will see a message that a new user was created

"platforms": [
    {
      "platform": "Hue",
      "users": {
        "0000000000000000": "0000000000"
      }

Copy this user and add to the bottom of the json config of the homebridge-hue plugin

You should now see your devices in Home Bridge.

To add the homebridge-hue plugin to Home Kit, select the wrench icon > Bridge Settings > use this QR code to add the bridge in the Home app on your phone.