The bed has a REST API
Who is in bed, which side, and how firm they like it — read from an undocumented cloud API mapped before a line of plugin code was written, plus the presets the bed itself refuses to remember.
Not in the HomeSeer store yet — running here daily, and heading for the store as a beta.
Somewhere along the way beds acquired cloud accounts. Mine reports who is in it, which side, and how firm each half is set — which is genuinely useful, because a bed is the most reliable occupancy sensor in a house. It does not miss you for sitting still, and it does not trigger for the cat.
The API behind it is entirely undocumented and reverse-engineered.
Mapping first, coding second
Before any plugin code existed, I spent a session probing the live account read-only and wrote down what it actually returned — not what a feature list claimed, not what a forum post remembered. That document is now the contract, and anything not observed in it is explicitly marked as a guess.
This is a habit worth more than it costs. When something breaks later, the question "has the API changed?" has an answer instead of an argument.
The most expensive hour
A 403 from this service does not mean the password is wrong. It means the service did not recognise the User-Agent and declined to explain itself. The two are indistinguishable from the status code alone.
That is a fine way to spend an hour re-typing a password that was correct the entire time, becoming steadily more certain the account has been locked.
There are also two sign-in flows — a modern token flow and an older one that puts a key on every request. Only the token flow was needed. The other is untested and labelled as such, because "probably still works" is not a thing to write in a comment and walk away from.
What the bed will not remember for you
The foundation has its own presets, and they were the obvious thing to build on. They turn out to remember position and nothing else.
The actual requirement here is "bedtime sets it to how we sleep, morning puts it flat" — and how we sleep is not merely an angle. It is an angle, at a firmness, with the foot warmer where we like it. A built-in preset restores one of those three and silently leaves the other two wherever the day happened to end.
So the plugin keeps its own named favourites, per side, holding all three together. Which is a small thing that only becomes obvious after the built-in feature has disappointed you a few times at eleven at night.
What it surfaces
Presence per side, sleeper identity, firmness, position, foot warming, and the named favourites. The interesting automation is rarely the bed — it is everything else in the house knowing, reliably and without a motion sensor, that somebody has gone to bed.