Bluetooth-Devices / bthome-ble

Parser for BTHome BLE devices
https://bthome.io/
MIT License
67 stars 12 forks source link

Add a Raw / Text data type #74

Closed Patrick010 closed 12 months ago

Patrick010 commented 1 year ago

Is your feature request related to a problem? Please describe.

I'm in the process of integrating a SparkFun NanoBeacon IN100 BLE beacon in to Home Assistant. I have a SHT31 sensor connected to the i2c bus for temperature/humidity readings and am now composing the advertising package. This is somewhat challenging because the i2c SHT31 sensor data is raw and needs to be converted in to a temperature and humidity value using a formula. The data consists of 6 bytes; 2 for temperature + 1 CRC, followed by 2 bytes humidity + 1 CRC. This basically means that each measurement type uses 3 bytes . Since BTHome has no data type for raw data transmission, I need use one that comes closest, in this case 'Counter'. However, the Counter type is limited to 1, 2 or 4 bytes, so I have to chop the 6 bytes up in to chunks and put them back together in HA. It would be a whole lot easier if there were a fixed size (10-20 chars) Raw or Text data type available for transmitting untouched data.

Describe the solution you'd like

A data type of a large enough size suitable for Raw data transmission.

Additional context

I'm convinced that this data type will make life a whole lot easier for many of us.

Patrick010 commented 1 year ago

Will this request be honoured?

Ernst79 commented 1 year ago

Yes, it will, but didnt had time to add this yet. Can take a few more weeks before I have time to add this.

Patrick010 commented 1 year ago

Thanks. No rush, was just wondering 👍

Ernst79 commented 12 months ago

The text sensor has been added to BTHome and the BTHome integration in Home Assistant dev. Will be included in the next release.

Patrick010 commented 12 months ago

Thanks Ernst. Going to give it a try as soon as its available :)