Skip to content

Commit

Permalink
Merge pull request gcgarner#48 from DIYtechie/deconz
Browse files Browse the repository at this point in the history
added deconz device config menu and amended wiki accordingly
  • Loading branch information
Slyke committed May 10, 2020
2 parents 153543e + a483b43 commit bbb5766
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 42 deletions.
29 changes: 29 additions & 0 deletions .templates/deconz/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

#deCONZ device configuration

device_selection=$(whiptail --radiolist --title "deCONZ device configuration" --notags \
"Use the [SPACEBAR] to select your Zigbee device from the list below and make sure it is plugged in (if not, press [ESC])." 20 78 12 \
"ConBeeII" "ConBee II " "ON" \
"ConBee" "ConBee " "OFF" \
"RaspBee" "RaspBee " "OFF" \
3>&1 1>&2 2>&3)

case $device_selection in

"ConBeeII")
echo "...copied ConBee II config from template"
echo "" >>docker-compose.yml
cat .templates/deconz/service_conbee_II.yml >>docker-compose.yml
;;
"ConBee")
echo "...copied ConBee config from template"
echo "" >>docker-compose.yml
cat .templates/deconz/service_conbee.yml >>docker-compose.yml
;;
"RaspBee")
echo "...copied RaspBee config from template"
echo "" >>docker-compose.yml
cat .templates/deconz/service_raspbee.yml >>docker-compose.yml
;;
esac
27 changes: 1 addition & 26 deletions .templates/deconz/service.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1 @@
deconz:
image: marthoc/deconz
container_name: deconz
restart: unless-stopped
network_mode: bridge
ports:
- '8090:80'
- '4439:443'
- '5901:5900'
volumes:
- ./volumes/deconz/:/root/.local/share/dresden-elektronik/deCONZ
#devices:
#ConBee II uncomment next line
#- /dev/ttyACM0
#ConBee uncomment next line
#- /dev/ttyUSB0
#RaspBee uncomment next line
#- /dev/ttyAMA0 or /dev/ttyS0
environment:
- DECONZ_VNC_MODE=1
- DECONZ_VNC_PASSWORD=changeme
- DEBUG_INFO=1
- DEBUG_APS=0
- DEBUG_ZCL=0
- DEBUG_ZDP=0
- DEBUG_OTAU=0

21 changes: 21 additions & 0 deletions .templates/deconz/service_conbee.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
deconz:
image: marthoc/deconz
container_name: deconz
restart: unless-stopped
ports:
- '8090:80'
- '443:443'
- '5901:5900'
volumes:
- ./volumes/deconz/:/root/.local/share/dresden-elektronik/deCONZ
devices:
#ConBee:
- /dev/ttyUSB0
environment:
- DECONZ_VNC_MODE=1
- DECONZ_VNC_PASSWORD=changeme
- DEBUG_INFO=1
- DEBUG_APS=0
- DEBUG_ZCL=0
- DEBUG_ZDP=0
- DEBUG_OTAU=0
21 changes: 21 additions & 0 deletions .templates/deconz/service_conbee_II.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
deconz:
image: marthoc/deconz
container_name: deconz
restart: unless-stopped
ports:
- '8090:80'
- '443:443'
- '5901:5900'
volumes:
- ./volumes/deconz/:/root/.local/share/dresden-elektronik/deCONZ
devices:
#ConBee II:
- /dev/ttyACM0
environment:
- DECONZ_VNC_MODE=1
- DECONZ_VNC_PASSWORD=changeme
- DEBUG_INFO=1
- DEBUG_APS=0
- DEBUG_ZCL=0
- DEBUG_ZDP=0
- DEBUG_OTAU=0
22 changes: 22 additions & 0 deletions .templates/deconz/service_raspbee.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
deconz:
image: marthoc/deconz
container_name: deconz
restart: unless-stopped
ports:
- '8090:80'
- '443:443'
- '5901:5900'
volumes:
- ./volumes/deconz/:/root/.local/share/dresden-elektronik/deCONZ
devices:
#RaspBee:
- /dev/ttyAMA0
#alternatively - /dev/ttyS0
environment:
- DECONZ_VNC_MODE=1
- DECONZ_VNC_PASSWORD=changeme
- DEBUG_INFO=1
- DEBUG_APS=0
- DEBUG_ZCL=0
- DEBUG_ZDP=0
- DEBUG_OTAU=0
23 changes: 7 additions & 16 deletions docs/deconz.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,18 @@
- [Docker](https://hub.docker.com/r/marthoc/deconz)
- [Website](https://github.com/dresden-elektronik/deconz-rest-plugin/blob/master/README.md)

## Installing deCONZ
1) Plug in you ConBee II, ConBee or Raspbee (if no device is plugged in, deCONZ will not be properly installed)
2) Add deCONZ to your stack using `cd ~/IOTstack && bash ./menu.sh`and select deCONZ
3) Edit the deconz service.yml using `sudo nano ~/IOTstack/services/deconz/service.yml` - activate your device by removing the "#" in front of "devices" and the "#" in front of your specific device. Save the changes using "ctrl+x", "y" and "enter".
4) Build the stack again using `cd ~/IOTstack && bash ./menu.sh` to apply the changes and select "Do not overwrite".
5) Run `docker-compose up -d` to build the deCONZ container.
## Pre-installation
Before running the command that creates the deconz Docker container (`docker-compose up -d`), you may need to add your Linux user to the dialout group, which allows the user access to serial devices (i.e. Conbee/Conbee II/RaspBee):

These steps are also shown in the gif below:
`sudo usermod -a -G dialout pi` (pi user being used as an example)

![installing deCONZ](https://github.com/DIYtechie/resources/blob/master/images/installing%20deconz%20-%20short%20version.gif?raw=true)

deCONZ should now be available at http://ip.address.of.your.IOTstack.pc.here:8090/
## Accessing the Phoscon UI
The Phoscon UI is available using port 8090 (http://your.local.ip.address:8090/)

## Viewing the deCONZ Zigbee mesh
The Zigbee mesh can be viewed using VNC (port 5901). The default VNC password is "changeme".

## Connecting deCONZ and Node-RED
1) Install [node-red-contrib-deconz](https://flows.nodered.org/node/node-red-contrib-deconz) via the manage palette menu (if not already pre-installed with Node-RED)
2) Open a deCONZ in node, select "Add new deconz-server" and type in the IP-address of your IOTstack pc (Rpi) and type in port 8090 (not websocket port)
3) Open deCONZ (http://ip.address.of.your.IOTstack.pc.here:8090/) and open settings>gateway>advanced. Click "Authenticate app".
4) Go back to your Node-RED instance and click the magick:get setting button in the server node. The API and websocket port will be automatically inserted. Click "Add" and you are good to go.
Install [node-red-contrib-deconz](https://flows.nodered.org/node/node-red-contrib-deconz) via the "Manage palette" menu in Node-RED (if it is not already pre-installed) and follow the 2 simple steps in the video below:

![installing deCONZ](https://github.com/DIYtechie/resources/blob/master/images/deconz%20authenticate.png?raw=true)
![installing deCONZ](https://github.com/DIYtechie/resources/blob/master/images/deconz%20node%20red%20config.png?raw=true)
![installing deCONZ](https://github.com/DIYtechie/resources/blob/master/images/Setup%20deCONZ%20in%20Node-RED.gif?raw=true)

0 comments on commit bbb5766

Please sign in to comment.