From 7670b4dbaaf1d632ea9af9c62754bd79290c5d8a Mon Sep 17 00:00:00 2001 From: Richard de Boer Date: Tue, 3 Dec 2024 22:35:31 +0100 Subject: [PATCH] hasensors: Document HA `unique ID` workaround --- apps/hasensors/ChangeLog | 1 + apps/hasensors/README.md | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/apps/hasensors/ChangeLog b/apps/hasensors/ChangeLog index 503fe11bc7..7372b1d124 100644 --- a/apps/hasensors/ChangeLog +++ b/apps/hasensors/ChangeLog @@ -4,3 +4,4 @@ 0.03: Add HRM sensor Add step count sensor Add pressure and temperature sensors + Document Home Assistant `unique ID` workaround diff --git a/apps/hasensors/README.md b/apps/hasensors/README.md index 7988c0d2cc..069122b6cf 100644 --- a/apps/hasensors/README.md +++ b/apps/hasensors/README.md @@ -26,3 +26,25 @@ Currently creates these sensors: * `_steps`: Step Count * `_pressure`: Pressure * `_temperature`: Temperature + +## Home Assistant `unique ID` workaround + +If you try to customize the created entities, Home Assistant will complain that +> This entity ('sensor.…') does not have a unique ID, therefore its settings +> cannot be managed from the UI. + +The problem is that these sensors are created "dynamically", and there is no way +to supply a `unique ID`. +There is a workaround though: +1. Make note of the sensor name you want to customize (e.g. `banglejs_battery_state`). +2. Disconnect your Bangle.js from your phone, so it doesn't send updates. +3. Restart Home Assistant, the sensor is now gone. +4. Create a template sensor: choose "Template a sensor". + - Use the name from step 1 (without `sensor.` prefix). + - Set the state template to `unknown`. +5. Reconnect your Bangle.js: it will now update the new template sensor, which + *does* have a `unique ID`. + +**Warning:** Do not customize the `Entity ID`: the app sends values by sensor +ID, so you end up with both a non-updating template sensor and "dynamic" sensor +without `unique ID`.