Skip to content

fix(tibber): declare the WebSocket host so Core grants the stream (1.1.3) - #282

Merged
frahlg merged 1 commit into
mainfrom
tibber-ws-hosts
Nov 27, 2026
Merged

frahlg merged 1 commit into
mainfrom
tibber-ws-hosts

Conversation

@frahlg

@frahlg frahlg commented Nov 27, 2026

Copy link
Copy Markdown
Member

Problem

A box set up from the UI cannot open Tibber's live stream. After the owner
enters an API key, the driver logs

WARN Tibber WS dial failed: ws: capability not granted

and never reads the meter (user report, 27 November 2026).

Since srcfl/ftw#1822, Core grants a driver's WebSocket only from
DRIVER.ws_hosts, for a config that grants HTTP, or from a
capabilities.websocket entry in the config
(go/internal/drivers/registry.go). The UI writes no such entry, and
tibber.lua 1.1.2 declared only http_hosts. The driver dials
wss://websocket-api.tibber.com/v1-beta/gql/subscriptions.

Change

  • tibber.lua 1.1.3 declares ws_hosts = { "websocket-api.tibber.com" },
    as easee_cloud does for its stream. The HTTP grant the UI already writes
    is now enough. The header comment no longer tells the owner to list the
    host, and says that a Core older than feat(drivers): grant a driver's WebSocket from DRIVER.ws_hosts; 5 s dial ftw#1822 still needs
    capabilities.websocket.
  • Version moved with make bump-driver ID=tibber LEVEL=patch, which also
    rewrote the manifest, index.yaml, devices.yaml and the support status.
  • New drivers/tests/test_ws_hosts.py: every driver that calls
    host.ws_open must list each wss:// host it names in ws_hosts. It
    reads the list the way the signed channel writes the header
    (_lua_top_level_string_list) and the way Core reads a bundled file
    (pickList in catalog.go).
  • test_ws_hosts_reach_the_generated_header now covers tibber as well as
    easee_cloud.

Evidence

Both tibber cases fail against 1.1.2 and pass on this branch:

FAILED drivers/tests/test_ws_hosts.py::test_ws_hosts_cover_every_dialled_host[tibber]
FAILED tests/test_ftw_repository.py::test_ws_hosts_reach_the_generated_header[tibber-websocket-api.tibber.com]
2 failed, 3 passed

On this branch, run locally:

  • make test-driver ID=tibber: 34 passed, 9 skipped
  • make check: 5452 passed, 927 skipped

Not yet run against Tibber's servers or on a box.

Next

After merge, an FTW PR moves drivers/BUNDLED_SOURCE.json to the merge
commit so the next beta bundles 1.1.3.

Refs srcfl/ftw#1822

🤖 Generated with Claude Code

…1.3)

A box set up from the UI could not open Tibber's live stream. After the
owner entered an API key, the driver logged "Tibber WS dial failed: ws:
capability not granted" and never read the meter.

Since srcfl/ftw#1822, Core grants a driver's WebSocket only from
DRIVER.ws_hosts, for a config that grants HTTP, or from a
capabilities.websocket entry in the config. The UI writes no such entry,
and tibber declared only http_hosts. It now declares
ws_hosts = { "websocket-api.tibber.com" }, as easee_cloud does for its
stream. The header comment no longer tells the owner to list the host.

drivers/tests/test_ws_hosts.py fails any driver that opens a WebSocket to
a wss:// host that its ws_hosts leaves out, read both the way the signed
channel writes the header and the way Core reads a bundled file. The
generated-header test now covers tibber as well as easee_cloud. Both
tibber cases fail on 1.1.2.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Fredrik Ahlgren <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-27T09:33:40.350256Z ace7fab PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@frahlg
frahlg merged commit 8aeecee into main Nov 27, 2026
5 checks passed
@frahlg
frahlg deleted the tibber-ws-hosts branch November 27, 2026 09:39
frahlg added a commit to srcfl/ftw that referenced this pull request Nov 27, 2026
Moves the driver pin from srcfl/device-drivers b07a409b to 8aeecee3. Only
tibber and pixii change:

- tibber 1.1.3 (srcfl/device-drivers#282) declares
  ws_hosts = { "websocket-api.tibber.com" }, so a box set up from the UI
  opens the live stream (#1822).
- pixii 2.1.10 (srcfl/device-drivers#228) reports calibration with
  host.set_calibrating (#2017).
- pixii 2.2.0 (srcfl/device-drivers#281) reports max_soc_fract
  (#2083).

Two Core tests ran the bundled Pixii and expected calibration as a device
fault, as pixii 2.1.9 reported it. They now expect Calibrating set, control
off, no fault and the driver still online, which is what 2.1.10 reports on
a Core with host.set_calibrating.

Signed-off-by: Fredrik Ahlgren <[email protected]>
Co-authored-by: Claude Opus 5.5 <[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