DEV Community

Cover image for Setting up a public URL that flashes my office lights

Setting up a public URL that flashes my office lights

Peter Kim Frank on January 05, 2026

I've been running Home Assistant on a Raspberry Pi for over two years. It controls my Hue lights, Zigbee devices, the usual stuff. It's always been...
Collapse
 
ben profile image
Ben Halpern

This is really fun.

Something I was going to ask privately but might as well here since you posted it:

Is there a reason that making it a GET request is better (very well could be due to simplicity of how some of the short cuts might work) — but I'd think this type of thing would typically want to be a POST or PUT request. These methods designed for submitting data (or submitting a state change in this case).

There may be a hack of sorts that makes GET simpler for all intents and purposes, but if you're not aware of reasons why it needs to be built this way, pivoting to POST could help avoid accidental "reads" turning into "writes" — i.e. you share the URL via Slack and the slackbot crawls the URL to check for a title/open graph image and submits the state change.

If it's a POST request (which could come with an accompanying GET URL which contains a button to trigger the POST submission.

Just my $.02 if not already considered.

Collapse
 
peter profile image
Peter Kim Frank

Good call.

TLDR, no good reason to use GET instead of POST or PUT. It was honestly just Claude Code taking the path of least resistance. (There's a good lesson in here for me and whoever else is reading this).

The scenario of the Slack unfurler flickering my lights is definitely something I want to avoid (annoyance, flaky confidence in the system, etc).

Luckily it was a quick fix. I actually just screenshott'd your comment, gave it to Claude, and now the system requires a POST with the auth token ✨️

Thanks for the catch and guidance.

Collapse
 
ben profile image
Ben Halpern

Yeah, one way another this is not a "read" request so GET will always be vulnerable to inadvertent triggers more-so compared to a submit-type request. It could be a necessary hack for some reason, but it should be re-visited at least to know why it's done that way.

Collapse
 
moopet profile image
Ben Sinclair

Nice!

I did something similar with my teasmade back in the day, except I made a service on the pi that started an ssh tunnel on boot.

Collapse
 
peter profile image
Peter Kim Frank

teasmade

Wow, TIL about Teasmade

Was the Teasmade natively IoT or did you use like a smart plug?

Collapse
 
moopet profile image
Ben Sinclair

Oh it was an ancient 1980s model :)

We put a pi in it connected to the power switch with a relay so it could turn the kettle part on and off, and you could tweet "make tea" at it and it'd turn on. It didn't entirely work and never turned off though.

The good bit was the radio - I used an old mouse, with the rubber wheel against the tuning control, and the buttons wired to the teasmade controls, so you could hit play and the pi would see it as a mouse click, and tuning back and forward would be seen as a scroll event. Tuning switched playlists of mp3s, and while the scrolling was going on it played a file of FM static noises.

Thread Thread
 
peter profile image
Peter Kim Frank

Love it. Embarking into clever DIY hack-y hardware land is the next frontier for me.

Collapse
 
madza profile image
Madza

Great work on this, nothing beats fun passion projects with practical application for personal use!

Collapse
 
maame-codes profile image
Maame Afua A. P. Fordjour • Edited

the jump from a simple notification service to an IRL ping system is exactly why building in public is so cool.

Collapse
 
aniruddhaadak profile image
ANIRUDDHA ADAK

Cool

Collapse
 
munyoki_kilyungi profile image
munyoki_kilyungi

That's dope. Nice ideas! I'm personally looking at figuring out how to use auto-ssh to connect all my home devices to my cheap VPS. The general idea being that I can offload serious compute to my home devices for some things :)

Collapse
 
cyber8080 profile image
Cyber Safety Zone

This is a really clever project — I love the idea of turning a push notification into an IRL alert! The Tailscale + VPS approach makes a lot of sense to securely bridge the public endpoint and your Home Assistant Pi without exposing your local network. Using token-based auth on the Flask webhook also feels like a good balance of simplicity and security.

Collapse
 
atinfosec profile image
Ashutosh Verma

This is the beauty of understanding the concepts. Once you have grip over them you can mould things as per your requirement.