Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
2bd1fc1
Update deCONZ: Ingress, discovery, doc, translations and a few correc…
mattreim Sep 12, 2025
82b4361
Update for coderabbitai
mattreim Sep 12, 2025
484785c
Update for coderabbitai_2
mattreim Sep 12, 2025
c6a5f8f
Update for coderabbitai_3
mattreim Sep 12, 2025
a05711b
Added some suggestions from coderabbitai
mattreim Sep 13, 2025
e49aa55
Update for coderabbitai_4
mattreim Sep 13, 2025
4aea16a
Update for coderabbitai_5
mattreim Sep 13, 2025
4231a4c
Update for coderabbitai_6
mattreim Sep 13, 2025
02f545d
Update for coderabbitai_7
mattreim Sep 13, 2025
c5f61d3
Update for coderabbitai_8
mattreim Sep 13, 2025
40456ff
Update ingress.html
mattreim Sep 13, 2025
acf5175
Update ingress_2
mattreim Sep 13, 2025
f9307a7
Update ingress_3
mattreim Sep 13, 2025
da8231c
Change DOC.md and remove clean cache
mattreim Sep 14, 2025
8a79a26
Revert to device
mattreim Sep 16, 2025
c8776b7
Remove the constants
mattreim Sep 16, 2025
c44828a
Revert to net.wait_for
mattreim Sep 17, 2025
3d86105
Add --focus-color
mattreim Sep 17, 2025
1e687a2
Revert ripple.remove
mattreim Sep 17, 2025
7ce9ca6
Add var(--button-hover-color)
mattreim Sep 18, 2025
9f8abc9
Small correction in the DOC
mattreim Sep 20, 2025
21986c3
Merge branch 'master' into Update-deCONZ
mattreim Sep 22, 2025
49669f1
Spaces removed
mattreim Sep 22, 2025
57a176a
Update for coderabbitai_doc
mattreim Sep 23, 2025
ab9ed31
Bump deCONZ to v2.31.2
mattreim Sep 29, 2025
e139816
Update discovery
mattreim Sep 29, 2025
fb1903c
Revert otau-ledvance script
mattreim Sep 30, 2025
c37b50f
Update CHANGELOG.md
mattreim Sep 30, 2025
5ba2759
Remove German translation file
mattreim Oct 3, 2025
f70c6f9
Small correction in the otau-ledvance script
mattreim Oct 5, 2025
ec4f912
Revert discovery
mattreim Oct 9, 2025
5d77f9c
Update CHANGELOG.md
mattreim Oct 9, 2025
5d8e7ea
Remove deCONZ 2.31.2
mattreim Oct 9, 2025
0100019
Update to TigerVNC link
mattreim Oct 14, 2025
92923f6
Merge branch 'master' into Update-deCONZ
mattreim Oct 14, 2025
4dc5320
Update to version: 8.4.0
mattreim Oct 17, 2025
59dbfdb
Merge branch 'master' into Update-deCONZ
mattreim Oct 23, 2025
71972a0
Update CHANGELOG.md
mattreim Oct 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ systems that have installed Home Assistant.

- **[deCONZ](/deconz/README.md)**

Control a Zigbee network using ConBee or RaspBee hardware by Dresden Elektronik.
Control a Zigbee network using ConBee or RaspBee hardware by dresden elektronik.

- **[DHCP server](/dhcp_server/README.md)**

Expand Down
8 changes: 8 additions & 0 deletions deconz/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 8.3.0

- Ingress entry page revised (for example, light and dark mode)
- Add German translation and expand English translation
- Update DOCS.md and a few corrections
- Use clean cache in Dockerfile
- Discovery script adapted

## 8.2.0

- Bump deCONZ to 2.30.2 [[CHANGELOG](https://github.com/dresden-elektronik/deconz-rest-plugin/releases/tag/v2.30.2)]
Expand Down
36 changes: 17 additions & 19 deletions deconz/DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,20 @@ The add-on needs to know where your ConBee/RaspBee can be found, and therefore,
you'll need to configure the add-on to point to the right device.

If you're using Home Assistant you may find the correct value for this on the
`Settings -> System -> Hardware` page. It is recommended
**Settings** -> **System** -> **Hardware** -> **All hardware** page. It is recommended
to use a "by-id" path to the device if one exists, as it is not subject to
change if other devices are added to the system.

1. Replace `null` in the `device` option in the add-on configuration and specify
the device name in quotes: e.g. something like
the device name in quotes: e.g. something like <br>
`"/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_XXXXXXXX-if00"`,
`"/dev/ttyUSB0"`, `"/dev/ttyAMA0"`, or `"/dev/ttyACM0"`.
`"/dev/ttyUSB0"`, `"/dev/ttyAMA0"` or `"/dev/ttyACM0"`.
2. Click on "SAVE" to save the add-on configuration.
3. Toggle the "Show in sidebar" to add it to your Home Assistant side bar.
4. Start the add-on.

After installing and starting this add-on, access the deCONZ WebUI ("Phoscon")
with "WEB UI" button.
After installing and starting this add-on, select **deCONZ** to access the deCONZ GUI via VNC,
or select **Phoscon** to configure settings in the Phoscon App.

## Configuring the Home Assistant deCONZ integration

Expand All @@ -58,8 +58,8 @@ follow these instructions to configure the deCONZ integration:

## Migrating to this Add-on

To migrate deCONZ to Home Assistant and this add-on, backup your deCONZ config via the
Phoscon WebUI, then restore that config after installing/reinstalling.
To migrate deCONZ to Home Assistant and this add-on, back up your configuration via
the Phoscon App and restore it after installation/reinstallation.

**_You must perform these steps or your Light, Group names and other data will be lost!_**

Expand Down Expand Up @@ -89,10 +89,9 @@ settings.

## Upgrading RaspBee and ConBee firmware

This add-on allows you to upgrade your firmware straight from the Phoscon
web interface with ease.
This add-on allows you to upgrade your firmware straight from the Phoscon App with ease.

Go to "Settings -> Gateway" and click the upgrade button.
In the Phoscon App, go to **Settings** -> **Gateway**, then select the upgrade button.

However, some USB sticks (like the Aeotec Z-Wave sticks), can interfere with
the upgrade process, causing the firmware upgrade to fail silently. If you end
Expand All @@ -107,8 +106,7 @@ Some add-ons are capable of consuming the deCONZ API directly. Node-RED is
one of those applications, that is available as an add-on, that can
consume the deCONZ API using the `node-red-contrib-deconz` node.

**WARNING** Do not use the following settings to set up a integration manually
from within Home Assistant!
**WARNING:** Do not use these settings to set up an integration in Home Assistant.

To allow these add-ons to connect to deCONZ, use the following settings:

Expand Down Expand Up @@ -149,18 +147,19 @@ Add-on configuration:
device: /dev/ttyAMA0
```

### Option: `device` (required)
### Option: `devices` (required)

The device address of your ConBee/RaspBee.

If you're using Home Assistant you may find the correct value for this on the
`Supervisor -> System -> Host system -> Hardware` page. It is recommended
**Settings** -> **System** -> **Hardware** -> **All hardware** page. It is recommended
to use a "by-id" path to the device if one exists, as it is not subject to
change if other devices are added to the system.

In most cases this looks like one of the following:

- `"/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_XXXXXXXX-if00"` (and similar for RaspBee and the original ConBee, replace `XXXXXXXX` with the value you see in your above mentioned hardware page)
- `"/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_XXXXXXXX-if00"` <br>
(and similar for RaspBee and the original ConBee, replace `XXXXXXXX` with the value you see in your above mentioned hardware page)
- `"/dev/ttyUSB0"`
- `"/dev/ttyAMA0"`
- `"/dev/ttyACM0"`
Expand All @@ -179,15 +178,14 @@ fails to communicate new settings to Home Assistant.

This can be solved by the following steps:

1. Backup your deCONZ data, by going into the Web UI, from the menu choose:
**Settings** -> **Gateway** -> **Backup Option** button, next create
1. Backup your deCONZ/Phoscon data, by going into the Phoscon App, from the menu choose:
**Settings** -> **Gateway** -> **Backup options**, then create
a new backup and download it onto your computer.
2. Uninstall the add-on.
3. In Home Assistant, remove the current integration you have for deCONZ.
4. Restart Home Assistant.
5. Install the deCONZ add-on again, and configure it again according to the [instructions](#configure-the-add-on).
6. Restore the backup you created at the first step at the same location
in the Web UI as before.
6. Restore the backup you created at the first step at the same location in the Phoscon App as before.
7. Restart the add-on and next, restart Home Assistant once more.
8. Follow the instructions on [setting up the deCONZ integration](#configuring-the-home-assistant-deconz-integration).

Expand Down
1 change: 1 addition & 0 deletions deconz/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ RUN \
wget \
xfonts-base \
xfonts-scalable \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Install deCONZ
Expand Down
2 changes: 1 addition & 1 deletion deconz/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

![Supports aarch64 Architecture][aarch64-shield] ![Supports amd64 Architecture][amd64-shield] ![Supports armhf Architecture][armhf-shield] ![Supports armv7 Architecture][armv7-shield] ![Supports i386 Architecture][i386-shield]

Control a Zigbee network using ConBee or RaspBee hardware by Dresden Elektronik.
Control a Zigbee network using ConBee or RaspBee hardware by dresden elektronik.

[aarch64-shield]: https://img.shields.io/badge/aarch64-yes-green.svg
[amd64-shield]: https://img.shields.io/badge/amd64-yes-green.svg
Expand Down
8 changes: 4 additions & 4 deletions deconz/config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
version: 8.2.0
version: 8.3.0
slug: deconz
name: deCONZ
description: >-
Control a Zigbee network with ConBee or RaspBee by Dresden Elektronik
Control a Zigbee network with ConBee or RaspBee by dresden elektronik
url: https://github.com/home-assistant/addons/tree/master/deconz
apparmor: false
arch:
Expand All @@ -25,7 +25,7 @@ ingress_entry: ingress.html
init: false
kernel_modules: true
options:
device: null
devices: null
panel_icon: mdi:zigbee
ports:
40850/tcp: null
Expand All @@ -34,7 +34,7 @@ ports:
privileged:
- SYS_RAWIO
schema:
device: device(subsystem=tty)
devices: device(subsystem=tty)
dbg_aps: int?
dbg_info: int?
dbg_otau: int?
Expand Down
122 changes: 90 additions & 32 deletions deconz/rootfs/etc/services.d/deconz/discovery
Original file line number Diff line number Diff line change
Expand Up @@ -4,69 +4,127 @@
# ==============================================================================
# Send deCONZ discovery information to Home Assistant
# ==============================================================================
readonly DATA_STORE="/data/.local/share/dresden-elektronik/deCONZ/zll.db"
declare api_key
declare config
declare query
declare retries
declare serial

# Wait for deCONZ to start before continuing
bashio::net.wait_for 40850
bashio::log.info "Starting discovery script ..."

# Remove old discovery data storage (cleanup)
# We now query the deCONZ database for it directly.
if bashio::fs.file_exists /data/hassio.json; then
rm /data/hassio.json
fi

# Try to get API key from deCONZ database
query='SELECT apikey FROM auth WHERE devicetype="Home Assistant" ORDER BY createdate DESC LIMIT 1'
api_key=$(sqlite3 "${DATA_STORE}" "${query}" .exit)
if ! bashio::var.has_value "${api_key}"; then
# Register an API key for Home Assistant
if ! result="$(curl --silent --show-error --request POST -d '{"devicetype": "Home Assistant"}' "http://127.0.0.1:40850/api")";
then
bashio::log.debug "${result}"
bashio::exit.nok "Can't get API key from deCONZ gateway"
TARGET_IP="127.0.0.1"
API_PORT="40850"

# Wait until deCONZ API is reachable
bashio::log.info "Waiting for deCONZ API to be available..."
for i in $(seq 1 30); do
if curl -fsS --connect-timeout 1 --max-time 2 -o /dev/null \
"http://${TARGET_IP}:${API_PORT}/api"; then
bashio::log.info "deCONZ API is reachable."
break
fi
api_key="$(bashio::jq "${result}" '.[0].success.username')"
sleep 1
done

if [ "$i" -eq 30 ]; then
bashio::log.error "deCONZ API is not reachable after 30 seconds – stopping discovery."
exit 0
fi

# Try to get the bridge ID/serial, try to avoid using 0000000000000000
retries=25
serial="0000000000000000"
while [[ "${serial}" = "0000000000000000" ]]; do
bashio::log.debug "Waiting for bridge ID..."
sleep 10
# Locate database
DATA_STORE="/data/.local/share/deCONZ/zll.db"
if [ ! -f "$DATA_STORE" ]; then
bashio::log.warning "Database not found at $DATA_STORE, trying alternative path..."
DATA_STORE="/data/.local/share/dresden-elektronik/deCONZ/zll.db"
if [ ! -f "$DATA_STORE" ]; then
bashio::log.error "No database found in either path! Proceeding without serial."
DATA_STORE=""
fi
fi

# Read API key from database
if [ -n "$DATA_STORE" ]; then
api_key=$(sqlite3 "${DATA_STORE}" \
'SELECT apikey FROM auth WHERE devicetype="Home Assistant" ORDER BY createdate DESC LIMIT 1' 2>/dev/null)
fi

# If we tried 25 times, just abort.
if [[ "${retries}" -eq 0 ]]; then
bashio::exit.nok "Failed to get a valid bridge ID. Discovery aborted."
# Test API key immediately, if available
if [ -n "$api_key" ]; then
if result="$(curl -sS --connect-timeout 2 --max-time 5 \
"http://${TARGET_IP}:${API_PORT}/api/${api_key}/config")"; then
candidate="$(bashio::jq "${result}" '.bridgeid')"
if [[ "$candidate" =~ ^[0-9A-Fa-f]{16}$ ]]; then
bashio::log.info "Existing API key is valid."
else
bashio::log.warning "Existing API key appears invalid; will try to create a new one..."
api_key=""
fi
else
bashio::log.warning "Failed to validate existing API key (HTTP error); will try to create a new one..."
api_key=""
fi
fi

# Get bridge ID from API
if ! result="$(curl --silent --show-error --request GET "http://127.0.0.1:40850/api/${api_key}/config")";
then
bashio::log.debug "${result}"
bashio::exit.nok "Can't get data from deCONZ gateway"
# Try to create API key if none exists
if ! bashio::var.has_value "${api_key}"; then
bashio::log.warning "No API key found – trying to create a new one..."
for i in $(seq 1 60); do
if result="$(curl --silent --show-error --connect-timeout 2 --max-time 5 \
-H 'Content-Type: application/json' --request POST \
-d '{"devicetype": "Home Assistant"}' \
"http://${TARGET_IP}:${API_PORT}/api")"; then
api_key="$(bashio::jq "${result}" '.[0].success.username')"
if bashio::var.has_value "${api_key}"; then
bashio::log.info "API key successfully created after ${i} seconds."
break
fi
fi
sleep 1
done
if ! bashio::var.has_value "${api_key}"; then
bashio::log.error "Failed to get an API key from deCONZ – continuing without discovery."
exit 0
fi
serial="$(bashio::jq "${result}" '.bridgeid')"
fi

# Get serial/bridge ID
retries=25
serial="0000000000000000"
while [[ "${serial}" = "0000000000000000" && "${retries}" -gt 0 ]]; do
sleep 5
if result="$(curl --silent --show-error --connect-timeout 2 --max-time 5 \
--request GET "http://${TARGET_IP}:${API_PORT}/api/${api_key}/config")"; then
candidate="$(bashio::jq "${result}" '.bridgeid')"
if [[ "$candidate" =~ ^[0-9A-Fa-f]{16}$ ]]; then
serial="$candidate"
else
serial="0000000000000000"
fi
fi
((retries--))
done

if [[ "${serial}" = "0000000000000000" ]]; then
bashio::log.error "Failed to get a valid bridge ID – continuing without discovery."
exit 0
fi

# Create config payload for Home Assistant
config=$(bashio::var.json \
host "$(hostname)" \
port "^40850" \
port "^${API_PORT}" \
api_key "${api_key}" \
serial "${serial}" \
)

# Send discovery info
if bashio::discovery "deconz" "${config}" > /dev/null; then
bashio::log.info "Successfully send discovery information to Home Assistant."
bashio::log.info "Successfully sent discovery information to Home Assistant."
else
bashio::log.error "Discovery message to Home Assistant failed!"
bashio::log.error "Failed to send discovery message to Home Assistant!"
fi
2 changes: 1 addition & 1 deletion deconz/rootfs/etc/services.d/otau-ikea/run
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ mkdir -p "/data/otau"
bashio::log.info "Running the IKEA OTA updater..."

if ! IKEA_DATA="$(curl -sL ${URL_IKEA})"; then
bashio::log.info "Can't fetch data from ikea!"
bashio::log.info "Can't fetch data from IKEA!"
exec sleep 18000
fi

Expand Down
Loading