Skip to content

feat(homelink): show remote energy overview - #664

Merged
frahlg merged 1 commit into
masterfrom
agent/home-link-theme-hotfix
Jul 24, 2026
Merged

frahlg merged 1 commit into
masterfrom
agent/home-link-theme-hotfix

Conversation

@frahlg

@frahlg frahlg commented Jul 24, 2026

Copy link
Copy Markdown
Member

Summary

  • replace the raw Home Link JSON screen with a responsive energy overview
  • add one fixed, typed and read-only overview scope for live site power and today totals
  • load the shared theme tokens so light and dark colours remain readable

Checks

  • npm test
  • go test ./...
  • go test -race ./internal/homelink ./internal/homelinkuplink ./cmd/ftw
  • make verify
  • pre-push make verify-all

@frahlg
frahlg merged commit b2993b5 into master Jul 24, 2026
11 checks passed
@frahlg
frahlg deleted the agent/home-link-theme-hotfix branch July 24, 2026 17:33

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 902291a80f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread go/cmd/ftw/home_link.go

if siteMeterDriver == "" {
response.GridAvailable = true
} else if health := tel.DriverHealth(siteMeterDriver); health != nil && health.IsOnline() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use meter-usable health for the overview grid

When the configured site-meter driver is a hybrid inverter that has flagged DeviceFault but is still emitting meter telemetry, IsOnline() is false, so the Home Link overview reports the grid/load as unavailable even though the local status path deliberately treats non-offline site-meter telemetry as usable. This makes homes with a faulted battery/PV on the meter driver lose the whole remote overview; use a meter-specific stale/offline check here instead of the actuator IsOnline() predicate.

Useful? React with 👍 / 👎.

Comment thread go/cmd/ftw/home_link.go
Comment on lines +209 to +212
totals, err := st.DailyEnergy(midnight.UnixMilli(), now.UnixMilli())
if err != nil {
return homelink.OverviewReadResponse{}, err
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep live overview when daily totals fail

If DailyEnergy returns an error (for example SQLite busy/closed during maintenance), this discards the live telemetry snapshot that was already assembled and consumes the one-use Home Link read grant, so the user sees a failed/denied overview rather than current grid/PV/load data. Since today's totals are optional (energy_today is omitted when unavailable), return the live response and omit/log the totals on this error instead of failing the whole overview.

Useful? React with 👍 / 👎.

frahlg added a commit that referenced this pull request Oct 17, 2026
* ci: stop new direct reads of cached telemetry outside the telemetry package

A reading stays in telemetry.Store after its driver goes stale, offline
or faulted. Every direct reader of RawW, SmoothedW, ReadingsByType or
ReadingsByDriver must check driver health itself, and review caught the
missing check in #36, #85, #310, #647, #664 and #740.

The check counts those reads per file outside go/internal/telemetry and
fails when a pull request adds one. Existing reads (147 today) may only
go down. The error names the health-gated accessors to use instead.
On the merged commits of #36, #85, #310 and #647 it fails.

* ci: count telemetry reads across platforms and validate exceptions

Signed-off-by: Fredrik Ahlgren <[email protected]>

---------

Signed-off-by: Fredrik Ahlgren <[email protected]>
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