Closed Patrick010 closed 9 months ago
I propose we use the same variable length as for text sensors, not a fixed 24 char length. by using the first byte to indicate how long the byte string is.
@Ernst79, any idea when the PR will be merged?
I was waiting for a review of bdraco, but I think he missed the request. I’ll ask on discord
Thanks
I see it's merged, but docs need to be updated. Can I use 0x54 followed by a length byte, same as the text data type?
Yep, but it isn't added to Home Assistant yet. This won't be before the November release of HA, as the October release is already in beta (no new features can be added now).
That's unfortunate, I'll have to be patient then. But great that it has been implemented. Thanks once more :)
Docs have been updated now, btw.
Can I manually install this in HA? I tried pip install, but type 0x54 isnt recognised.
Normally, you can copy the homeassistant/components/bthome
folder to /config/custom_components/bthome
, and than modify manifest.json. A custom component with the same name overrules the built in one. After a restart, it should update the requirements from the manifest.json. But it has been a while since I did this.
Tried this, but doesnt work. I've modified the .json and set "requirements": ["bthome-ble==3.2.0"] I also had to set a version since this is mandatory for custom components, so I added "version": "3.2.0", No idea if this correct or if anything else must be done. Even though it is a highly educational exercise for me, I can imagine that you dont feel like solving this. So I'll have to wait for the next HA update ;)
Ah, sorry, you have to add it to sensor.py as well. Add the following to the SEnSOR_DESCRIPTIONS.
# Raw (-)
(BTHomeExtendedSensorDeviceClass.RAW, None): SensorEntityDescription(
key=str(BTHomeExtendedSensorDeviceClass.RAW),
),
I have the PR ready locally, but my development environment is a bit messed up. Have to fix that first
adding the version is ok, that is mandatory, yes. The number doesn’t matter, can be anything
That would explain the Unexpected error updating FF:FF:FF:FF:00:01 data: (<ExtendedSensorDeviceClass.RAW: 'raw'>, None) Added it to sensor.py and yes! it works 👍
The PR to add bthome 3.2.0 for Home Assistant has been merged into development. So, it should be available in HA 2023.11. I'm closing this issue here.
Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
There is no data type available for the relaying of raw BLE data. All data types convert or alter the payload in some way or another. For my use case I need access to the hex payload as sent by the beacon. https://community.home-assistant.io/t/bthome-discussion-topic/504361/35 lead to the conclusion that a raw data type will solve this.
Describe the solution you'd like A clear and concise description of what you want to happen.
Add a RAW data type for the relaying of raw BLE data with a length of, say, 24 characters (BLE payloads can become very long, very easy)
Additional context Add any other context or screenshots about the feature request here.