Hello @ldesgrange,
Yes, you understood correctly: an external integration cannot handle this type of device today, and it won’t be possible in the near future either.
On GATT relayed by the core
This isn’t excluded forever, but it’s not planned. The BLE relay we’re talking about in this topic is only used to listen to announcements, read-only. It’s a deliberate choice. Allowing a one-click installed integration, without re-reading the code, to connect in GATT and write to any Bluetooth device around the house is not the same as listening to announcements in terms of security. There’s also an issue with radio sharing: a GATT connection occupies the adapter. Your device shows this, in fact, as it stops its announcements as soon as a client is connected. The core would need to manage the life of each connection, and this depends a lot on each device.
For PR #2935: it was automatically closed by the bot because it had no more activity. This isn’t a decision to abandon the subject. But we need to be clear: the spec hasn’t been merged and nothing is developed yet, not even the announcement reading part.
In the meantime: yes, a small separate service that publishes in MQTT is the right approach
I advise you to do this:
- A small independent program that connects in GATT to your BSG-001, sends requests, and listens to notifications. In Python,
bleakworks very well for this. - It publishes the measurements on the MQTT broker with the Home Assistant MQTT Discovery format (
homeassistant/sensor/.../config+ a state topic). Gladys’ MQTT integration has supported this format since this summer: the device appears automatically in the MQTT discovery tab, without creating anything manually. - Another solution: create the device manually in the MQTT integration and publish on
gladys/master/device/<external_id>/feature/<feature_external_id>/state.
No need to add an external integration that queries an API: with MQTT, you already have everything you need.
Two remarks:
- If this program runs on the same machine as Gladys and Gladys’ Bluetooth integration is enabled, the two will fight over the adapter. It’s better to disable Gladys’ Bluetooth integration, use a second dongle, or run the program on another device closer to the meter (a Raspberry Pi, for example).
- Gladys doesn’t yet have a “radioactivity” category (µSv/h). With Home Assistant discovery, the measurement will be reported as a generic sensor. If you want a real category, we can discuss it in a separate topic, following our criteria for device categories.