todbot / blink1

Official software for blink(1) USB RGB LED by ThingM
https://blink1.thingm.com/
Other
954 stars 237 forks source link

Daemon mode with support for IFTTT #313

Closed mhalano closed 6 years ago

mhalano commented 7 years ago

The idea here is quite simple and very useful: has a daemon running which can receive commands from IFTTT like Blink1Control2 do. The idea is keep the Blink1 on my Raspberry Pi and blink the light if some online event occurs. I know there's a lot of ways to achieve this, like APIs, connecting remotely, but none of this methods support IFTTT.

todbot commented 7 years ago

There is a very basic Python script https://github.com/todbot/blink1/blob/master/python/blink1-ifttt-simple.py that does some of what you're asking but it's not very userfriendly.

Are you running standard Raspbian on your Pi?

mhalano commented 7 years ago

I'm running Ubuntu Server, so no GUI.

todbot commented 7 years ago

Ubuntu Server on a Raspberry Pi? Interesting. Didn't know they supported that. The script referenced above should still work. But I agree, a proper daemon for IFTTT->blink(1) is warranted.

mhalano commented 7 years ago

There's no officially support. I needed a little voodoo. I want to use Ubuntu Snappy Core, but I would need to build Snaps for a lot of things.

mhalano commented 7 years ago

May be we could handle this on blink1-tiny-server?

todbot commented 7 years ago

blink1-tiny-server is meant to be a minimal-dependency server for micro-Linuxes (like routers and such) but still also work for modern Linux, Windows, macOS. So it needs to be in C and small and cross-platform. Just getting the mongoose http framework working everywhere for it is a pain, let alone a JSON parser, or OAuth2 client (which we'll need when IFTTT finally updates our API to them)

If we can assume a full Linux, then this IFTTT->blink(1) thing could be written in a much faster-to-write in language like Python or Node.

UNIVAC-Colonel-Panic commented 6 years ago

Is Blink1Control GUI the only way to generate the IFTTT blink id needed for https://github.com/todbot/blink1/blob/master/python/blink1-ifttt-simple.py?

todbot commented 6 years ago

Hi @taa1, it's the preferred way, but you can use the blink(1) serial number doubled (e.g. if the serial number is 2345ABCD then you can use 2345ABCD2345ABCD.