Skip to content

Fix emitter by not considering NaN/no state as a reason to split packet - #14

Open
haroal wants to merge 1 commit into
dz0ny:mainfrom
haroal:fix-nan-values-order
Open

Fix emitter by not considering NaN/no state as a reason to split packet#14
haroal wants to merge 1 commit into
dz0ny:mainfrom
haroal:fix-nan-values-order

Conversation

@haroal

@haroal haroal commented May 30, 2026

Copy link
Copy Markdown

Current implementation has a bug that makes the system send multiple packets when some data are NaN/no state, considering we have too much data to send for 1 advertisement and so using the feature to split the payload in multiple advertisements. In this case, the ordering index is messed up and sends data in an unwanted order.

This fix updates the BTHome emitter code to distinguish cases when we indeed have an overflow (and so another advertisement will need to be sent with remaining data) VS when some values are NaN/no state and so should just be ignored.

This is particularly important when using HomeAssistant BTHome integration as the receiver because it expects measurements order to be consistent to know to which "entity" each measurement refers (especially when you have multiple measurements sharing the same "object id" from HA point of view).

With this fix, my HA integration reliably assigns my sensor values to the right entity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant