Hacker News new | ask | show | jobs
by peteforde 3127 days ago
I really enjoyed reading this, but it wasn't entirely clear to me what the author planned to reprogram the unit to actually do. So from my perspective, the article ended abruptly when the author declared success even though I was looking forward to a description of the conclusion.

The story is important and often overlooked in these moments. It's what justifies spending a hundred hours and $200 to achieve something you could probably just buy for $50.

2 comments

In my case, I simply wanted a plug where I could know what code runs on it. I love everything Sonoff makes for that exact reason, I've bought a lot of their stuff (including their wifi light switches).

The switches are especially handy because you can program them to do anything, not just switch lights on and off. For example, you can program your bedroom switch to turn off all lights with a long press. Theoretically, anyway, as I haven't yet gotten mine so I haven't tried it with that particular model in practice.

If you read the entire article it's clear why he's reprogramming them. You have to fully read the first two paragraphs.

But essentially, he reprograms the smart plugs to respond to a simple HTTP GET request to turn the lights on, and then turn the lights off after 11 seconds, and the 11 second countdown can be reset by hitting that HTTP endpoint again.

He has a "sensor" board that has a light sensor, and when he turns his regular light switch on, that sensor board detects the light in the room, and hits all the smart plugs endpoints to turn them on. As long as that sensor board detects light, it will keep hitting the "lights on" endpoints of the smart plugs.

When he turns his regular light switch off, the sensor board stops hitting the "lights on" endpoints, and the lights automatically turn off after 11 seconds.

I did, for the record, read the whole article. Perhaps you were more willing to assume that his stated goal was the same as his initial hack solution. Seems you were likely correct.

Question: once you turn the lights on, how would you turn them off given that there's still light in the room?