Home Assistant Control

Let Home Assistant control Piazza HQ

The reverse direction from Piazza HQ's own Home Assistant integration — instead of pulling sensor data in, these let a Home Assistant automation turn a screen's TV/monitor on or off, or switch a display to a saved layout (light/dark theme included).

All three doors below do the exact same two things and talk to the same Piazza HQ device — pick one for a given device, not more than one. Running two at once just means duplicate entities in Home Assistant for the same screen.

What you'll need

  • A Piazza HQ device already set up (Pi, Windows, or Docker)
  • Access to Home Assistant's configuration.yaml — the File Editor or Studio Code Server add-on works if you don't have another way in
  • Five minutes and one restart of Home Assistant
1

Generate an automation token

In Piazza HQ: Settings → Home Assistant Control → Generate Token. This token only ever unlocks two things — turning a screen's TV/monitor on/off, and applying a saved layout to a display. It can't read your calendar, change any other setting, or do anything else.

2

Add a rest_command: block

In Home Assistant's configuration.yaml, replacing <host-pi-ip> with your Piazza HQ device's actual LAN address and YOUR_TOKEN with the token from step 1:

rest_command: piazzahq_screen_off: url: "http://<host-pi-ip>:3000/api/screens/YOUR_DEVICE_ID/tv/power-off" method: POST headers: Authorization: "Bearer YOUR_TOKEN" piazzahq_screen_on: url: "http://<host-pi-ip>:3000/api/screens/YOUR_DEVICE_ID/tv/power-on" method: POST headers: Authorization: "Bearer YOUR_TOKEN"

Find a screen's device id in Piazza HQ under Settings → Multi-Device, or by asking your token to list them (see the FAQ below).

3

Restart Home Assistant, then use it in an automation

Settings → System → Restart — a new rest_command: block doesn't take effect until Home Assistant restarts. From then on, any automation (a person leaving home, a sleep-tracker sensor, a time trigger) can call rest_command.piazzahq_screen_off / _on as its action.

4

Optional: switch layouts and theme too

Same idea, a different endpoint — POST to /api/saved-layouts/<layout-id>/apply with a JSON body of {"display": "<display-slug>"} and the same Authorization header. Applying a saved layout also switches that display's light/dark theme, since each saved layout stores its own. Find a saved layout's id from the Layout tab's Layout Library, and a display's slug from Settings → Multi-Device.

If something goes wrong

My automation isn't triggering the screen

Double-check the device id and IP address in the YAML — a typo there fails silently from Home Assistant's side (it just gets a 404 back). Confirm Home Assistant actually restarted after you added the block; it won't recognize rest_command.piazzahq_screen_off until it does.

Where do I find a screen or saved-layout id without digging through the app?

The same token also unlocks three read-only lookup endpoints, useful if you're scripting this by hand: GET /api/automation/screens, /api/automation/displays, and /api/automation/saved-layouts — each returns the exact ids and names you need, with the same Authorization: Bearer header as above.

Can I test it without building a whole automation first?

Yes — a plain curl with the same URL, method, and header from step 2 works from any machine on your network. If that works but the Home Assistant automation doesn't, the issue is in the automation's trigger/condition, not the connection to Piazza HQ.

Looking for the other direction — Home Assistant sensors and devices showing up on your Piazza HQ display? That's covered in the user guide's Settings section.