Agents In Use
What’s new todayLast update
499 additions

How to use Claude to flash office lights from a URL

The author obtained a public token-authenticated URL that flashes office lights red, with a correction to restore the previous color.

Added dev.toAgent: Claudevia Claude Code
TRY A BOUNDED VERSION

Prompt to try

Editorial adaptation, not the source author’s exact prompt. Replace bracketed inputs and review tool permissions first.

the lights aren't going back to where they were

What happened

The author obtained a public token-authenticated URL that flashes office lights red, with a correction to restore the previous color.

Reported by peter on dev.to

How the agent did it

  1. Gave Claude Code SSH access to the Pi and droplet.
  2. Queried light IDs and wrote a flash-and-restore bash script.
  3. Installed Tailscale and generated SSH keys between the machines.

Where a person stepped in

The author supplied access and tested the lights, then reported incorrect restoration so Claude could fix it.

A person set the goal and reviewed the result.

The author already ran Home Assistant on a Raspberry Pi and had created a DigitalOcean droplet for ntfy notifications. They realized the public droplet could also provide an endpoint for triggering devices at home without directly exposing Home Assistant. The resulting URL lets someone with a token flash the author's office lights red.

They gave Claude Code SSH access to both machines and described the desired setup. Claude queried Home Assistant for light entity IDs, wrote a flashing script, installed Tailscale on the Pi and droplet, and generated SSH keys for remote commands. It then created a token-authenticated Flask webhook, configured Nginx routing, and installed systemd services to survive reboots.

Requests pass through the public droplet and Tailscale to the Pi, where SSH invokes the script and the Home Assistant API controls the lights. Restoration required a correction: the first version saved brightness but did not return the lights to their previous color. After the author reported that behavior, Claude added xy_color handling. The author estimates the setup took about twenty minutes, mostly waiting for package installation. Rate limiting and logging were listed as future work.

Who it's for: Home Assistant users who can provide server access and test physical device behavior.

Prompt
Original prompt

Source: dev.to · peter

Frequently asked questions

How did the droplet reach the Raspberry Pi?

Both machines used Tailscale. The droplet ran the Pi’s flash script over SSH through the private mesh network.

What needed fixing after the first version?

The script initially saved brightness only. After the author reported failed restoration, Claude added handling for the previous xy_color.

More details

Remaining steps

  1. Created a token-authenticated webhook, Nginx routing, and systemd services.
  2. Reported failed color restoration and had Claude add xy_color handling.

About this account

Claude Code configured both machines through SSH and implemented the script, webhook, routing, and services.

Platform: dev.to. Attribution: https://dev.to/peter/setting-up-a-public-url-that-flashes-my-office-lights-218i. Prompt: Original (quoted from source). Sourced by the Agents In Use pipeline.

Credit: peter on dev.to

Source published 5 Jan 2026

Source checked 14 Oct 2026

Tools and topics

Claude Code · Home Assistant · Raspberry Pi · DigitalOcean · Tailscale · Flask · Nginx · systemd

Home Assistant · Lighting · Webhooks

Editorial completeness: 100/100. Measures documented fields, not agent performance or verified outcomes.