Skip to content

Commit

Permalink
hasensors: Document HA unique ID workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
rigrig committed Dec 3, 2024
1 parent 6d8b875 commit 7670b4d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions apps/hasensors/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
0.03: Add HRM sensor
Add step count sensor
Add pressure and temperature sensors
Document Home Assistant `unique ID` workaround
22 changes: 22 additions & 0 deletions apps/hasensors/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,25 @@ Currently creates these sensors:
* `<sensor id>_steps`: Step Count
* `<sensor id>_pressure`: Pressure
* `<sensor id>_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. <a href="https://my.home-assistant.io/redirect/config_flow_start?domain=template" target="_blank">Create a template sensor</a>: 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`.

0 comments on commit 7670b4d

Please sign in to comment.