Control tvbliz from outside: API, MQTT, webhooks and macros

Updated 16 November 2026

Everything the remote and tvbliz.com can do, you can do from outside too: turn on and off, turn up and down, change page, start the screensaver, open a widget full screen, show a message and read what the TV shows right now. Over the internet with the API, or locally over MQTT. It is all set up under Settings › Integrations.

Getting started

Make an API key under Account › API keys. Send it as a Bearer. A key can do everything you can, so do not share it. AI assistants can also sign in with OAuth (see MCP).

curl https://tvbliz.com/api/v1/tvs \
  -H "Authorization: Bearer hjtv_…"

curl -X POST https://tvbliz.com/api/v1/tvs/<tv>/commands/volume \
  -H "Authorization: Bearer hjtv_…" -H "Content-Type: application/json" \
  -d '{"value": 25}'
→ {"tv": "<tv>", "tvName": "Stue", "name": "volume", "ok": true}

The addresses

GET    /api/v1                                  commands and events
GET    /api/v1/homes                            your homes
GET    /api/v1/homes/<home>                     a home: TVs (live), dashboards, connections
GET    /api/v1/homes/<home>/items?connection=…  a connection's items and values (search, group)
GET    /api/v1/tvs                              every TV, with online, screen, brightness
GET    /api/v1/tvs/<tv>                         one TV and its state right now
GET    /api/v1/tvs/<tv>/dashboard               the dashboard it shows, with every widget
POST   /api/v1/tvs/<tv>/commands                {"name": "…", "args": {…}}
POST   /api/v1/tvs/<tv>/commands/<name>         the args as the body
GET    /api/v1/homes/<home>/macros
PUT    /api/v1/homes/<home>/macros/<name>       {"description", "tv", "steps": […]}
DELETE /api/v1/homes/<home>/macros/<name>
POST   /api/v1/homes/<home>/macros/<name>/run   {"tv": "<tv>"} (optional)
GET    /api/v1/homes/<home>/hooks
POST   /api/v1/homes/<home>/hooks               {"name", "macro", "tv"} → {"url"} (once)
DELETE /api/v1/homes/<home>/hooks/<id>
GET    /api/v1/homes/<home>/webhooks
POST   /api/v1/homes/<home>/webhooks            {"url", "events": […]} → {"secret"} (once)
PATCH  /api/v1/homes/<home>/webhooks/<id>
DELETE /api/v1/homes/<home>/webhooks/<id>
GET    /api/v1/homes/<home>/mqtt
PUT    /api/v1/homes/<home>/mqtt                {"host", "port", "tls", "username", "password", "discovery"}
POST   /api/hooks/<secret>[?tv=<tv>]            runs the hook's macro (no key: the address is the key)

Answers are JSON. Errors come as {"error": "…"} with an HTTP status: 400 bad input, 401 no or invalid key, 403 the key lacks access, 404 not found, 409 the TV could not (why says why), 503 the TV is offline.

The commands

A command goes straight to the TV and answers {ok, why?}. For tvbliz’s home screen (page, open, screensaver …) the home screen is brought to the front first when another app is in front.

key          {"key": "ok"}       up down left right ok back home menu play_pause next prev
                                  vol_up vol_down mute channel_up channel_down 0–9
volume       {"value": 25} | {"step": -2} | {"mute": true | false | "toggle"}
brightness   {"value": 70}       tvbliz's dimming over the picture, 0–100
power        {"on": false}       standby, and on again from standby
app          {"package": "com.netflix.ninja"}
home                             tvbliz's home screen in front
panel                            the tvbliz panel open or closed
page         {"page": 2}
screensaver  {"on": true}
open         {"widget": "<id>"}  a widget on the dashboard full screen (its id: GET …/dashboard or the state)
cameras                          all cameras full screen
close                            whatever is open over the home screen
shortcut     {"action": "camera:next"}   page-next page-prev camera:all camera:next news:open
                                  brightness-up brightness-down panel store:<widget>:<shortcut>
message      {"text": "Der er nogen ved døren", "seconds": 10}   over any app
state                            the TV's state (below)

When it cannot (why)

offline      the TV has no connection to tvbliz (off at the wall, or a standby that stops apps)
unreachable  power on to a TV that cannot be reached: wake it with Wake-on-LAN
timeout      the TV did not answer in time
keys-off     needs «tvbliz-genveje» (the accessibility service) on the TV
no-adb       the TV does not let tvbliz use its network debugging
no-home      tvbliz's home screen did not come to the front
no-page, no-widget, no-full-view, no-cameras, volume-fixed, unknown, failed

The TV’s state

GET /api/v1/tvs/<tv> asks the TV right now. The MAC address is included when the TV can read it (for Wake-on-LAN).

{
  "screen": true,
  "app": {"package": "com.netflix.ninja", "label": "Netflix"},
  "volume": {"value": 25, "level": 15, "max": 60, "muted": false, "fixed": false},
  "brightness": 100, "panel": false, "keys": true, "adb": true,
  "version": "13.48", "ip": "192.168.1.84", "mac": "aa:bb:cc:dd:ee:ff",
  "home": {
    "front": false, "page": 1, "pages": 2, "screensaver": false,
    "open": {"kind": "widget", "widget": "camera"},
    "widgets": [{"id": "camera", "type": "store:kamera", "page": 1, "x": 0, "y": 0, "w": 6, "h": 5}, …]
  }
}

Macros

A macro is several commands in a row under one name, up to 30 steps. A step can wait first (wait, up to 60 seconds) and have its own TV; otherwise the macro’s TV or all of them. Macros run from the API, a hook address, MQTT (a button in Home Assistant), MCP or Integrations on tvbliz.com.

PUT /api/v1/homes/<home>/macros/Godnat
{
  "description": "Everything off for the night",
  "tv": "all",
  "steps": [
    {"name": "message", "args": {"text": "Godnat", "seconds": 3}},
    {"wait": 3000},
    {"name": "screensaver", "args": {"on": true}},
    {"name": "power", "args": {"on": false}, "tv": "<tv>"}
  ]
}

Hook addresses

A secret address that runs a macro when called with POST or GET, with no key. For systems that can only call a URL (Homey, IFTTT, a button in an app). The address is shown only when it is made; delete it to stop it.

POST https://tvbliz.com/api/hooks/tvbh_…

Webhooks

tvbliz sends what happens on the TVs to your address (https): online, offline, screen (the screen on or off), app (another app in front), page, screensaver and view (something opened or closed full screen). Every call is signed with the webhook’s secret.

POST https://your.server/tvbliz
Content-Type: application/json
X-Tvbliz-Event: screen
X-Tvbliz-Signature: sha256=<HMAC-SHA256 of the body, with the webhook's secret>

{"event": "screen", "at": "2026-11-16T19:07:00Z", "home": "<home>",
 "tv": {"id": "<tv>", "name": "Stue"}, "data": {"on": false}}
// Node.js
const crypto = require('crypto');
const ok = req.headers['x-tvbliz-signature'] ===
  'sha256=' + crypto.createHmac('sha256', SECRET).update(rawBody).digest('hex');

MQTT and Home Assistant

Give your broker under Settings › Integrations. The TVs connect to it on the home network themselves and can be controlled locally, even without internet. With discovery, each TV shows up in Home Assistant as a device with screen, volume, mute, brightness, screensaver, page, full screen, message, the remote’s buttons, a button per macro and the app in front.

tvbliz/<tv>/availability     online | offline (retained)
tvbliz/<tv>/state            the state above, as JSON (retained)
tvbliz/<tv>/event            {"event": "page", "data": {…}}
tvbliz/<tv>/result           the answer to the last command
tvbliz/<tv>/set/power        ON | OFF
tvbliz/<tv>/set/volume       0–100
tvbliz/<tv>/set/mute         ON | OFF
tvbliz/<tv>/set/brightness   0–100
tvbliz/<tv>/set/page         1, 2 …
tvbliz/<tv>/set/screensaver  ON | OFF
tvbliz/<tv>/set/key          ok | back | home | …
tvbliz/<tv>/set/open         <widget id>
tvbliz/<tv>/set/app          <package>
tvbliz/<tv>/set/message      <text>
tvbliz/<tv>/set/shortcut     <action>
tvbliz/<tv>/set/macro        <the macro's name>
tvbliz/<tv>/set/command      {"name": "…", "args": {…}}
# Home Assistant: the doorbell rings → a message and the camera on the TV
automation:
  - alias: Dørklokke på TV'et
    trigger:
      - platform: state
        entity_id: binary_sensor.doorbell
        to: "on"
    action:
      - service: text.set_value
        target: {entity_id: text.stue_tv_besked}
        data: {value: "Der er nogen ved døren"}
      - service: mqtt.publish
        data:
          topic: tvbliz/<tv>/set/open
          payload: camera

On and off

power turns the screen off (standby) and on again, as long as tvbliz runs in standby, which many TVs do. A TV that is fully off can be woken by no app. Turn on “Wake on Wi-Fi” or “Wake on LAN” in the TV’s settings, and send a magic packet from the home network, e.g. from Home Assistant, to the MAC address in the TV’s state.

# Home Assistant (configuration.yaml)
wake_on_lan:

# a script
service: wake_on_lan.send_magic_packet
data: {mac: "aa:bb:cc:dd:ee:ff"}