News for hackers. Stuff that matters.
Re:About those lava lamps by javajosh on Monday December 21, 2015 @02:56PM (#10773050)
So what's a good way to build a build lava lamp in 2015? I'm thinking wall adapter that has wifi and offers a simple webserver that switches on and off on POST.
Re:About those lava lamps by lotyrin on Monday December 21, 2015 @03:16PM (#10773205)
Lots of off-the shelf "smart plugs" these days, with varying degrees of open-ness and convenience to their APIs.

Or for DIY, a cheap micro plus a opto-isolated relay board.

Re:About those lava lamps by jakobegger on Monday December 21, 2015 @03:32PM (#10773305)
Something neat that I found out recently is the existence of solid-state-relays. They are basically opto-couplers that can directly switch a load. You can use them instead of normal relays, and drive them directly from a digital io pin. Pretty sweet.

Or just get a particle photon with the relay shield. Extremely easy to set up, and it comes with a REST API.

Re:About those lava lamps by javajosh on Monday December 21, 2015 @04:53PM (#10773801)
>Lots of off-the shelf "smart plugs" these days, with varying degrees of open-ness and convenience to their APIs

What are some good ones?

> Or for DIY, a cheap micro plus a opto-isolated relay board.

What does "micro" mean in this context? Microcontroller?

Re:About those lava lamps by Drdrdrq on Monday December 21, 2015 @07:04PM (#10774560)
To be pedantic: you should use PUT. ;)
Re:About those lava lamps by javajosh on Monday December 21, 2015 @07:59PM (#10774867)
Actually, after thinking about it, I'd use a GET and I'd structure it something like

     http://smartplug?state=on
     http://smartplug?state=off
Then to get the state of the plug:

     http://smartplug?state
In jQuery this would be a easy call

     $.ajax('http://smartplug?state=on')
Of course you'd have to code the plug server to add the appropriate CORS headers but that's true no matter how you structure the API.

You could either replace 'smartplug' with the local ip of the device or alias it in `/etc/hosts`. All pretty standard stuff these days. If you wanted to expose it to the outside world (which actually should be hard to do) you would use DHCP reservation based on it's MAC address and a DynDNS service.

The part that stymies me (and which no-one seems interested in addressing!) is what hardware to get.

Re:About those lava lamps by vsync on Friday December 25, 2015 @12:18AM (#10790499)
> Actually, after thinking about it, I'd use a GET

Why? Using it to change state seems precisely wrong. PUT seems more appropriate.

Re:About those lava lamps by rexfm on Monday December 21, 2015 @11:34PM (#10775843)
as far as hardware for the actual lamp itself, it looks like melting some colored candles and some water in a glass jar over an incandescent bulb should suffice for starters. more advanced "ooze" formula including anti-freeze found here: http://oozinggoo.com/ll-form5.html
Re:About those lava lamps by javajosh on Tuesday December 22, 2015 @01:12AM (#10776156)
Yeah, that's not really the point. I meant something more like this:

    https://hackaday.io/project/6799-smartee-the-smart-plug
I find it pretty incredible something like this doesn't already exist from a major manufacturer! I mean, I understand why Belkin/GE/etc want to lock you into their ecosystem, but it seems not that hard to build an open alternative - and eat their collective lunches.