Skip to content

Adding Devices

dnaidoo621 edited this page Aug 27, 2026 · 1 revision

Adding Devices

Glide's Setup screen adds a TV or other IR-controlled device from the phone — no terminal, no tinytuya wizard, no hand-edited JSON.


Opening Setup

Tap the gear at the end of the device tab strip. When nothing is configured yet it's labelled Add TV.


The five steps

1. Confirm you're in the room

Tap Show code on TV. A six-digit code appears on the TV screen and stays valid for five minutes.

This exists because Glide's normal access model is anyone who can scan the QR can drive the HTPC. That's the right trade-off for a remote, and the wrong one for a screen that displays cloud credentials — so changing device configuration additionally requires being able to see the TV.

2. Enter the code

Type it into the phone. A correct code unlocks a setup session that lasts 15 minutes.

3. Tuya credentials

Pick your data centre and paste the Access ID and Access Secret from your Tuya cloud project. The secret field is masked.

These are used once, to read your device list and keys. After that Glide talks to the hub directly.

The form says so on screen, and it's worth repeating: Glide is served over plain HTTP on your LAN, so these are not encrypted in transit. They're stored on the HTPC readable only by you, and are never sent back to the browser.

4. Find my devices

Glide does two things at once:

  • Scans your LAN for Tuya devices broadcasting on UDP 6666/6667/7000 — this yields the hub's IP, protocol version and device id, so you don't type any of it
  • Queries your Tuya account for the devices and keys on it

You'll see something like "Found 1 hub(s) on the LAN and 2 device(s) on the account."

An IR blaster shows up as two entries: the hub itself, plus a virtual sub-device for each remote you configured in Smart Life. The sub-devices are the ones you pick from.

5. Pick your TV and save

Choose the remote matching your TV, optionally rename the tab, and Save.

The config is written atomically at mode 600 and the registry reloads live — the tab appears immediately, no restart.


If no remotes are listed

You'll see a prompt to add your TV in Smart Life first. That step is what tells the hub which codeset to use; Glide reads that configuration rather than replacing it.

Add the TV in Smart Life, then re-run Setup.


What gets written

~/.config/htpc-remote/devices.json, mode 600, in ~/.config/htpc-remote/ (mode 700). Override the location with the HTPC_REMOTE_DEVICES environment variable.

Validation rejects incomplete entries with a specific message — missing hub_id, no usable transport, an incomplete cloud block, and so on — rather than writing something that won't load.


Re-running Setup

Safe at any time. Re-run it when:

  • You add a second device
  • You re-paired the hub in Smart Life — this changes local_key, and local sends stop working until the config is updated
  • You rotated your Tuya API secret

Security notes

Pairing code Gates who may start setup; expires after 5 minutes
Session token 15 minutes, then re-pair
Secrets in responses Never — /setup/config returns has_local_key: true, not the key
On disk 0600 file inside a 0700 directory
In transit Plain HTTP. Use it on a network you trust

The setup endpoints all reject unauthenticated requests with 401, and a wrong pairing code with 403.


See also

Clone this wiki locally