bthome-writable #8024
Replies: 9 comments 71 replies
Done — spec is at 2.0-draft.4, both sides implemented, 588 tests green.
Counters — mostly already there. The device persists its write counter, and Home Assistant persists its own; a freshly created config entry seeds from the clock, which fixed a nasty one where re-adding a device left every sealed write silently refused. One thing to separate though: skipping persistence is the device's own risk for writes, but the device also seals its advertising and reads, and a counter restarting at zero there reuses a nonce under the same key. Found that in my own firmware last week. Your overflow window is right about wrap-around — one snag: it bounds forward jumps too, and receivers need those. §5.3 asks them to offer a resynchronisation, and mine seeds from wall-clock seconds, well outside LAST+1000. Worth an exception for an explicit resync? On letting the stack split long writes — I'd like that, but the one time I tried a payload above MTU-3 it was refused outright rather than prepared. I'll measure before promising it. Length byte is in if you still want to try it. Your NAS-plus-proxies setup is exactly the second bench this has been missing :-) |
|
Does that mean we can have also actors and not only sensor's. |
|
§5.6 The receiver asks by default, which I had not expected. What it does not close is a device restarting while the receiver keeps running,
I have deliberately implemented neither. Which appeals to you? Separately: an audit against the real |
|
A short summary for anyone arriving here, since the thread has got long.
So a BTHome device can have switches, lights, setpoints, text and buttons Trying it takes about ten minutes and a Puck.js: Protocol: |
|
My setup is: RPI4b with openwrt, latest HA image running on podman, 6 espHome proxies and the local bluez BT. I tested it a bit, it seems to be working fine, both using local BT and the proxies. Something puzzles me though. The BTH writable extension does not get the battery arvertized, I have to use the normal BTH extension to get it. Is this intended? an one more thing that is a bit strange is that every so often, I can see that once I call changed(), the HA connects more than once, 2 or 3 times, it gets the reading on the first try, but connects again. |
Thanks for testing it — and yes to EspruinoDocs. I fixed two things in the
@gfwilliams @enaon :One gap worth naming: both reports so far have been unencrypted, so the Switching an existing device over is two steps:
Nothing else changes: same declaration, same characteristics, same writes — |
|
@gfwilliams — the modules are in, as two pull requests: Separate, because |
Done so far:
|
|
one little thing that I want to verify the behavior of, against your bench, is the following: (not related to latest changes, it was this was from the start) The first command I send over the the lights after a period of inactivity, say 3-5 minutes, takes a lot of time in my case. I tested the hci0 alone, the ESPproxy alone, and both. The first command can take anywhere from 5-10 seconds. The next command is fast in the lasted versions, maybe 1-3 sec. This seems not light/Espruino BT sleep mode related, meaning that if I send one command to one light that takes 5-10 seconds, I can then send a command to a different light and it will arrive fast**. This looks like a HA assistant thing to me, is this the case in your bench too? ** I maybe wrong about this, I will test some more. |

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
bthome-writable initially started in this HA integration topic. Now it has a dedicated topic, to avoid mixing things up.
Please see the GitHub repo at https://github.com/yerpj/bthome-writable for Getting Started info
All reactions