mirror of
https://github.com/aljazceru/addons.git
synced 2025-12-17 05:04:21 +01:00
deCONZ (#502)
* Migrate deCONZ addon to core repo * Update add-on * Update run.sh * Update Dockerfile * Update Dockerfile * Update Dockerfile * Update Dockerfile * Update Dockerfile * Update Dockerfile * Update build.json * Update Dockerfile * Update Dockerfile * Use our raspbian * Update config.json * Update build.json * Update config.json * Update build.json * Update config.json * Update config.json * Update run.sh * Update config.json * Update config.json * Delete firmware.sh * Update Dockerfile * Update Dockerfile * Update run.sh * Update config.json * Update run.sh * Update Dockerfile * Create ika-otau-dl.sh * Update run.sh * Fix rights * Update ika-otau-dl.sh * Update ika-otau-dl.sh * Update ika-otau-dl.sh * Update ika-otau-dl.sh * Update README.md * Update Dockerfile
This commit is contained in:
5
deconz/CHANGELOG.md
Normal file
5
deconz/CHANGELOG.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# Changelog
|
||||
|
||||
## 1.0
|
||||
- Initial release as Home Assistant core Add-on
|
||||
- Bump deCONZ to 2.05.54
|
||||
47
deconz/Dockerfile
Normal file
47
deconz/Dockerfile
Normal file
@@ -0,0 +1,47 @@
|
||||
ARG BUILD_FROM
|
||||
FROM $BUILD_FROM
|
||||
|
||||
ARG BUILD_ARCH
|
||||
ARG DECONZ_VERSION
|
||||
|
||||
# Install deCONZ dependencies
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y \
|
||||
curl \
|
||||
kmod \
|
||||
lsof \
|
||||
tzdata \
|
||||
libcap2-bin \
|
||||
libqt5core5a \
|
||||
libqt5gui5 \
|
||||
libqt5network5 \
|
||||
libqt5serialport5 \
|
||||
libqt5sql5 \
|
||||
libqt5websockets5 \
|
||||
libqt5widgets5 \
|
||||
sqlite3 \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& if [ "${BUILD_ARCH}" = "armhf" ] || [ "${BUILD_ARCH}" = "aarch64" ]; \
|
||||
then \
|
||||
curl -q -L -o /wiringpi.deb https://unicorn.drogon.net/wiringpi-2.46-1.deb \
|
||||
&& dpkg -i /wiringpi.deb \
|
||||
&& rm -rf /wiringpi.deb; \
|
||||
fi
|
||||
|
||||
# Install deCONZ
|
||||
RUN if [ "${BUILD_ARCH}" = "armhf" ] || [ "${BUILD_ARCH}" = "aarch64" ]; \
|
||||
then \
|
||||
curl -q -L -o /deconz.deb https://www.dresden-elektronik.de/rpi/deconz/beta/deconz-${DECONZ_VERSION}-qt5.deb; \
|
||||
else \
|
||||
curl -q -L -o /deconz.deb https://www.dresden-elektronik.de/deconz/ubuntu/beta/deconz-${DECONZ_VERSION}-qt5.deb; \
|
||||
fi \
|
||||
&& dpkg -i /deconz.deb \
|
||||
&& rm -f /deconz.deb \
|
||||
&& chown root:root /usr/bin/deCONZ* \
|
||||
&& sed -i 's/\/root/\/data/' /etc/passwd
|
||||
|
||||
COPY run.sh /
|
||||
COPY ika-otau-dl.sh /bin/
|
||||
|
||||
CMD ["/run.sh"]
|
||||
30
deconz/README.md
Normal file
30
deconz/README.md
Normal file
@@ -0,0 +1,30 @@
|
||||
# deCONZ
|
||||
|
||||
Add-on to allow Home Assistant to control a ZigBee network with Conbee or RaspBee hardware by Dresden Elektronik.
|
||||
|
||||
## First Steps
|
||||
|
||||
If using RaspBee, you may need to edit `config.txt` on the root of your SD card for your RaspBee to be recognized and assigned a device name. Add folling information to `config.txt`:
|
||||
|
||||
```
|
||||
enable_uart=1
|
||||
dtoverlay=pi3-miniuart-bt
|
||||
```
|
||||
|
||||
Before starting the add-on for the first time after installing, in the add-on config you must specify the device name that has been assigned to your RaspBee/Conbee as the `device`. Replace **null** and specify the device name in quotes (e.g. "/dev/ttyUSB0" or "/dev/ttyAMA0"). The other config options have sensible defaults that should not need to be changed unless you are debugging.
|
||||
|
||||
Use a 2.5A power supply for your Raspberry Pi 3! Strange behaviour with this Add-on may otherwise result.
|
||||
|
||||
## Adding ZigBee Devices
|
||||
|
||||
After installing and starting this addon in Hass.io, access the deCONZ WebUI ("Phoscon") with WebUI button.
|
||||
|
||||
## Configuring the Home Assistant deCONZ Component
|
||||
|
||||
If `discovery:` is enabled in configuration.yaml, navigate to the Configuration - Integrations page after starting this Add-on to configure the deCONZ component.
|
||||
|
||||
If `discovery:` is not enabled, follow these instructions to configure the deCONZ component: https://home-assistant.io/components/deconz/.
|
||||
|
||||
## Migrating to this Add-on
|
||||
|
||||
To migrate deCONZ to Hass.io and this Add-on (or before uninstalling/reinstalling this Add-on), backup your deCONZ config via the Phoscon WebUI, then restore that config after installing/reinstalling. _You must perform these steps or your Light and Group names and other data will be lost!_ (However, your ZigBee devices will remain paired to your Conbee or RaspBee hardware.)
|
||||
10
deconz/build.json
Normal file
10
deconz/build.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"build_from": {
|
||||
"aarch64": "homeassistant/armhf-base-raspbian:stretch",
|
||||
"amd64": "homeassistant/amd64-base-ubuntu:18.04",
|
||||
"armhf": "homeassistant/armhf-base-raspbian:stretch"
|
||||
},
|
||||
"args": {
|
||||
"DECONZ_VERSION": "2.05.54"
|
||||
}
|
||||
}
|
||||
34
deconz/config.json
Normal file
34
deconz/config.json
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"name": "deCONZ",
|
||||
"version": "1.0",
|
||||
"slug": "deconz",
|
||||
"description": "Control a ZigBee network with Conbee or RaspBee by Dresden Elektronik",
|
||||
"arch": ["aarch64","amd64","armhf"],
|
||||
"url": "https://home-assistant.io/addons/deconz",
|
||||
"startup": "system",
|
||||
"boot": "auto",
|
||||
"webui": "http://[HOST]:[PORT:80]",
|
||||
"ports": {
|
||||
"80/tcp": 9880,
|
||||
"8080/tcp": 9881
|
||||
},
|
||||
"kernel_modules": true,
|
||||
"auto_uart": true,
|
||||
"gpio": true,
|
||||
"apparmor": false,
|
||||
"privileged": [
|
||||
"SYS_MODULE",
|
||||
"SYS_RAWIO"
|
||||
],
|
||||
"devices": [
|
||||
"/dev/bus/usb:/dev/bus/usb:rwm",
|
||||
"/dev/mem:/dev/mem:rw"
|
||||
],
|
||||
"options": {
|
||||
"device": null
|
||||
},
|
||||
"schema": {
|
||||
"device": "str"
|
||||
},
|
||||
"image": "homeassistant/{arch}-addon-deconz"
|
||||
}
|
||||
31
deconz/ika-otau-dl.sh
Executable file
31
deconz/ika-otau-dl.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
URL_IKEA="http://fw.ota.homesmart.ikea.net/feed/version_info.json"
|
||||
|
||||
while true; do
|
||||
|
||||
# fetch data
|
||||
if ! IKEA_DATA="$(curl -sL ${URL_IKEA})"; then
|
||||
echo "[Info] Can't fetch data from ikea!"
|
||||
sleep 18000
|
||||
continue
|
||||
fi
|
||||
|
||||
IKEA_DATA_SIZE="$(echo "${IKEA_DATA}" | jq --raw-output '. | length')"
|
||||
for (( i=0; i < "${IKEA_DATA_SIZE}"; i++ )); do
|
||||
OTAU_URL=$(echo "${IKEA_DATA}" | jq --raw-output ".[$i].fw_binary_url // empty")
|
||||
|
||||
if [ -z "${OTAU_URL}" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
OTAU_FILE="/data/otau/${OTAU_URL##*/}"
|
||||
if [ -f "${OTAU_FILE}" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
curl -s -L -o "${OTAU_FILE}" "${OTAU_URL}"
|
||||
done
|
||||
|
||||
sleep 259200
|
||||
done
|
||||
BIN
deconz/logo.png
Normal file
BIN
deconz/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
44
deconz/run.sh
Executable file
44
deconz/run.sh
Executable file
@@ -0,0 +1,44 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
CONFIG_PATH=/data/options.json
|
||||
DECONZ_DEVICE="$(jq --raw-output '.device' $CONFIG_PATH)"
|
||||
WAIT_PIDS=()
|
||||
|
||||
# List all devices
|
||||
GCFFlasher_internal -l
|
||||
|
||||
# Start Gateway
|
||||
deCONZ \
|
||||
-platform minimal \
|
||||
--auto-connect=1 \
|
||||
--dbg-info=1 \
|
||||
--dbg-aps=0 \
|
||||
--dbg-zcl=0 \
|
||||
--dbg-zdp=0 \
|
||||
--dbg-otau=0 \
|
||||
--http-port=80 \
|
||||
--ws-port=8080 \
|
||||
--upnp=0 \
|
||||
--dev="${DECONZ_DEVICE}" &
|
||||
WAIT_PIDS+=($!)
|
||||
|
||||
# Start OTA updates for deCONZ
|
||||
deCONZ-otau-dl.sh &
|
||||
WAIT_PIDS+=($!)
|
||||
|
||||
# Start OTA updates for IKEA
|
||||
ika-otau-dl.sh &
|
||||
WAIT_PIDS+=($!)
|
||||
|
||||
# Register stop
|
||||
function stop_addon() {
|
||||
echo "Kill Processes..."
|
||||
kill -15 "${WAIT_PIDS[@]}"
|
||||
wait "${WAIT_PIDS[@]}"
|
||||
echo "Done."
|
||||
}
|
||||
trap "stop_addon" SIGTERM SIGHUP
|
||||
|
||||
# Wait until all is done
|
||||
wait "${WAIT_PIDS[@]}"
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"build_from": {
|
||||
"armhf": "raspbian/stretch",
|
||||
"armhf": "homeassistant/armhf-base-raspbian:stretch",
|
||||
"amd64": "homeassistant/amd64-base-ubuntu:16.04"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user