Skip to content

Listener and HTTP

WBEVAN edited this page Oct 18, 2026 · 1 revision

Listener & HTTP

The listener is the long-lived process that owns the switch TCP (or serial) session and serves HTTP for UIs and integrations.

Start

tesmartctl listen --http --panel
# tesmartctl listen --http --panel --host 0.0.0.0 --port 8765

Line-protocol mode (no HTTP) is also available for raw clients; see Docs/listener.md.

Useful URLs

Base: http://127.0.0.1:8765 (or your bind host/port)

Path Role
GET /status Connection + active input
GET / POST /input Query or select input
POST /banner Show / dismiss / clear banners
GET /events Server-Sent Events (input / names / banner push)
GET /api/events Same stream for kit / panel (--panel)
GET /kit Floating kit UI
GET /panel Full panel UI
Static under /static/… Kit and panel assets

Exact query/body shapes live in the repo listener doc — prefer that as the source of truth when wiring Stream Deck, Companion, or custom scripts.

Push vs poll

Client How it stays in sync
Kit / panel GET /api/events (SSE) + fallback /api/state poll
Hubitat Outbound POST to registered /callbacks URLs (+ its own poll)
Stream Deck / Companion / curl Usually one-shot HTTP; optional curl -N /events to watch

SSE event names: hello, input_changed, names_changed, banner. Same JSON shape as Hubitat callback bodies.

Who uses it

  • Floating kit and control panel
  • Hubitat controller / Manager
  • tesmartctl banner … (POSTs to the listener; kit/panel see it over SSE)
  • One-shot CLI still can open its own short TCP session to the switch when no listener is required

Deeper detail

Docs/listener.md (includes the SSE section)

Clone this wiki locally