Tag Archives: milight

Wireless MiLight automation with Raspberry Pi + IFTTT + Evernote + Geeknote

MiLights have this good platform that is simple to use but no IFTTT integration. Looking through the web didn’t provide any easy solutions either. These are just my notes:


MiLight interface <– Python Milight (Raspberry Pi)

Basic command structure: milight (channel) (on/off/B/C) (value) where channel 0 is all, B is brightness (0-19) and C is colour (0-255). Config points to wireless bridge, segregate program in separate directories for controller isolation.

milight 0 on

milight 1 B 10

milight 1 C 190


IFTTT (f*&^king inflexible heap of crap asdjkahsd!!!1)

Recipe bullshit here for lights out just before midnight: When Date Time channel hits 11:45, post note to Evernote with linux commands.

echo “Date Time Lights out IFTTT” `date` >> /home/pi/HA/lights.log && milight 0 off

Log event on RPi then command milight to turn off all LEDs.

IFTTT Recipe: MiLight control, lights out. connects date-time to evernote


Geeknote hack:

I’ll be going to hell for this insecure scripting but hey ho, one day I’ll fix it.

Install Geeknote and register with Evernote (magic happens clearly because the documentation for both does not point you to the API key page, click the green button top right on page)

The hack is simple, change the default note editor to /bin/sh so that whatever is in the body of the note IFTTT posts to Evernote will be run like a script‘ish.

geeknet settings –editor /bin/sh

The way I’m parsing the notes is simple, the header/title/whatever contains the device needing to be controlled, in this case Lights. Get geeknote to search the Evernote account for this title and post the content of the message to /bin/sh where it will be executed. (Security…blah blah blah)


Setup a read, command and destroy script: lights.sh

#! /bin/sh

export PATH=/usr/bin:/bin:/usr/local/bin

/usr/local/bin/geeknote edit –note Lights

/usr/local/bin/geeknote remove Lights  –force


Crontab entry (did it with Webmin because it just works plus it will be executed by user pi not root) calls the script every 6 minutes 24/7.

0,6,12,18,24,30,36,42,48,54 * * * * /home/pi/HA/lights.sh #Scan IFTTT for MiLight notes

Install Postfix mail server to catch CRONTAB errors


It’s worth watching the Evenote page to see what’s being sent before the script destroys the entry.

Screen Shot 2015-03-10 at 13.36.25