Don't switch on the off lights inside a group; compact the Status section - #4
Merged
Conversation
… off A light group reports "on" as soon as any one member is on, so Sundial saw a partly-lit group as a light it should adapt. Turning a group on lights every member, so the write switched on the lights that were deliberately left off — reported as fixtures coming on for no logged reason, and as the group flipping state behind them. _write_targets now reads the group's members and addresses only the ones already lit, falling back to the entity itself when there is nothing to narrow. As a side effect those members change under our own context, so they can no longer be mistaken for someone adjusting the light by hand. Only groups that publish a member list can be recognised. Zigbee groups are a radio-level construct with no members to read and a groupcast that necessarily lights everything, so they are indistinguishable from an ordinary light here and cannot be narrowed; the status payload reports them as such rather than guessing from the entity registry. Groups we can see carry a note that adding the individual lights is the better arrangement. The Status section is cut from around twenty rows to five or six. What survives is what a diagnosis actually turns on: whether Sundial is in control and why not, the target against what the light reports, what the last run did, and when the next one is. Static configuration was already visible in the sheet above it, and several rows restated their neighbours — the light's on/off state now shows in place of its reported values, and the outcome carries its own timestamp. Outcomes read as "<what happened> — <why>" so a run that did nothing says which of the several reasons applied. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XdpAyEvqgNcBstA75dQ5wr
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XdpAyEvqgNcBstA75dQ5wr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bumps the manifest to
2.2.1.Adapting a group no longer turns on its dark members
A light group reports
onas soon as any member is on, so a partly-lit group passed Sundial'sis_oncheck and got adapted. Turning a group on lights every member, so that write switched on the lights that had deliberately been left off. Symptom: fixtures coming on with nothing in the logbook to explain them, and the group flipping state behind them._write_targetsnow reads the group's members and addresses only the ones already lit, falling back to the entity itself when there's nothing to narrow (all members on, or not an introspectable group):Side benefit: those members now change under Sundial's own context, so they can't be mistaken for someone adjusting the light by hand.
What this does not fix
Only groups that publish a member list can be recognised. Zigbee groups can't be — they're a radio-level construct with no members to read, and turning one on is a groupcast that necessarily lights everything in it. They're indistinguishable from an ordinary light from the integration's side.
I initially guessed at them via "no backing device in the entity registry", but that also catches helper entities, so it's out. The payload reports what it can prove rather than guessing. For Zigbee groups the only remedy is adding the individual lights instead — and groups we can see now carry a note saying exactly that.
Status section cut to five or six rows
From ~20 rows down to what a diagnosis actually turns on: whether Sundial is in control and why not, the target against what the light reports, what the last run did, and when the next one is.
* conditional
Removed rows were either static configuration already visible in the sheet above, or restated a neighbour. Merged: the light's on/off state now shows in place of its reported values, sunrise and sunset share one row, and the outcome carries its own timestamp.
Outcomes read as
<what happened> — <why>, so a run that did nothing says which of the several reasons applied:Verification
ruff check .clean,python -m pytest33 passed,npm run buildclean with the bundle committed.Group — 3 lights · 1 onand the note, an ordinary light shows neither, and every sheet renders in 5–6 rows.Worth knowing
_already_at_targetstill reads the group's aggregate attributes when deciding whether a write is needed. For a partly-lit group those are an average across the lit members, so it can decide a write is warranted slightly more often than strictly necessary. It no longer turns anything on, so the effect is cosmetic — but it's why a group row may report "Updated because of schedule" more often than a plain fixture.🤖 Generated with Claude Code
https://claude.ai/code/session_01XdpAyEvqgNcBstA75dQ5wr
Generated by Claude Code