<commit_before>Lua-Builder-for-LIFX-Ruby-HTTP-API
==================================

This is a Lua script generator for managing LIFX bulbs via Vera Scenes, making use of the unofficial LIFX Ruby HTTP API, https://github.com/chendo/lifx-http


1. Get A Raspberry Pi (or other *nix computer that you're happy with keeping on all the time)

2. Ensure it has a static IP on your local network - otherwise if the IP keeps changing, this won't work too well. For mine, the IP is 192.168.1.221

3. Ruby v2.0 (Raspbian has an older version, so I had to follow these instructions to get 2.0 installed: (http://jam.im/blog/2013/03/03/installing-ruby-2-and-rvm-on-a-raspberry-pi/) (this took forever to finsih!!)
- sudo aptitude update
- sudo aptitude install git-core
- curl -L https://get.rvm.io | bash -s stable --ruby
- pi@raspberrypi ~ $ source /home/pi/.rvm/scripts/rvm

4. Make sure root can see the new file by changing the /bin/ruby binary to point to the new ruby that is placed somewhere obscure in your own folder. For me, it: /home/cdrum/.rvm/rubies/ruby-2.1.3/bin/ruby
- sudo ln -s ruby /home/cdrum/.rvm/rubies/ruby-2.1.3/bin/ruby

5. The (unofficial) Ruby HTTP API for controlling LIFX bulbs: https://github.com/chendo/lifx-http (and follow those instructions on getting it installed), but the long and the short of it is:
- rvmsudo gem install lifx-http
- Note here i'm using rvmsudo - this was key to ensure that the gems are installed systemwide, and that root, during the installation, gets my new ruby 2.1.x environment (otherwise you'll get complaints that LIFX requires >= Ruby 2.0.

Then all you do is run this command an copy and paste the output in the Luup Lua scene settings. <commit_msg>fixed style and added blog url<commit_after>Lua-Builder-for-LIFX-Ruby-HTTP-API
==================================

This is a Lua script generator for managing LIFX bulbs via Vera Scenes, making use of the unofficial LIFX Ruby HTTP API, https://github.com/chendo/lifx-http


1. Get A Raspberry Pi (or other *nix computer that you're happy with keeping on all the time)
2. Ensure it has a static IP on your local network - otherwise if the IP keeps changing, this won't work too well. For mine, the IP is 192.168.1.221
3. Ruby v2.0 (Raspbian has an older version, so I had to follow these instructions to get 2.0 installed: (http://jam.im/blog/2013/03/03/installing-ruby-2-and-rvm-on-a-raspberry-pi/) (this took forever to finsih!!)
4. Make sure root can see the new file by changing the /bin/ruby binary to point to the new ruby that is placed somewhere obscure in your own folder. For me, it: /home/cdrum/.rvm/rubies/ruby-2.1.3/bin/ruby
5. The (unofficial) Ruby HTTP API for controlling LIFX bulbs: https://github.com/chendo/lifx-http (and follow those instructions on getting it installed).

Then all you do is run this command an copy and paste the output in the Luup Lua scene settings. 

See this blog post for some details on installing the above: http://www.cdrum.com/2014/10/connecting-lifx-bulbs-with-vera-z-wave.html
{'fraction_non_alphanumeric': 0.10755526228967338, 'fraction_numerical': 0.024744308808973936, 'mean_word_length': 3.7974683544303796, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 5, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6450942', 'n_tokens_mistral': 1010, 'n_tokens_neox': 910, 'n_words': 423}