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.
Original prompt
Shared by the source author. See source notes for context.
the lights aren't going back to where they were
Reach people exploring AI agents
See placements →Evidence at a glance
Sourced account- Source author
- peter
- Original account
- Read the source ↗
- Published
- Source link checked
- Reported result
- The author obtained a public token-authenticated URL that flashes office lights red, with a correction to restore the previous color.
- Human involvement
- The author supplied access and tested the lights, then reported incorrect restoration so Claude could fix it.
A linked account supports attribution. It does not mean we independently reproduced its result.
Report an issue with this case
Open correction emailOpens your email app with the case link included. Nothing is sent automatically.
How the agent did it
- Gave Claude Code SSH access to the Pi and droplet.
- Queried light IDs and wrote a flash-and-restore bash script.
- Installed Tailscale and generated SSH keys between the machines.
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
- Created a token-authenticated webhook, Nginx routing, and systemd services.
- 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
Added to Agents In Use
Source checked
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.