January 10, 2013 at 22:33 #3874
Thanks for the new forum, this seems like the right place to mention my ruby gem, use it and abuse it to a) talk to the wifi link from the command line, or b) incorporate it in your own code. I’m keen to receive any feedback or pull requests.
I’m using it right now to automate my own home using a google calendar for the timer settings. I don’t have my central heating automated yet but when I do this is going to be great. No more fiddling about with an unfriendly timer interface in the cupboard, instead just set repeating events on a familiar interface. It’s already working nicely for the lights and switches, turn off lights and devices at bed time and so on.January 18, 2013 at 01:07 #4148velkrosmaakParticipant
Google calendar! That’s genius! I’ve been using Eventghost to trigger a python script that sends a UDP string.January 29, 2013 at 22:49 #4420
Thanks, been live for a few weeks now and working nicely! Some more updates to the gem now too, it annotates a log file as it turns devices on and off so I can see how the different events affect power usage on a graph, see attached… all the source code is there https://github.com/pauly/lightwaverf
Attachments:You must be logged in to view attached files.January 30, 2013 at 16:22 #4482stephenmelodyParticipant
This is awesome, I’d love to do something similar on my raspberry pi.
Is there some brief instructions you could give on how to get this installed and working / what’s required?
Cheers.January 30, 2013 at 22:57 #4492
This is awesome, I’d love to do something similar on my raspberry pi. Is there some brief instructions you could give on how to get this installed and working / what’s required? Cheers.
I’ll try and write it up properly tomorrow, as I have to do a completely fresh install anyway – just fritzed my raspberry pi somehow while trying to install some webcam software on it. A complete aside but a friend at work has just set up a “cat cam” motion detector on an old pc and I’m going to do the same on my pi. Here are some instructions that I don’t have time to finish!
# open a terminal on the pi and install ruby and git
sudo apt-get install git-core ruby
# then install my gem
sudo gem install lightwaverf
# then try and run it once, this will create the config file
lightwaverf lounge light on
# that will probably fail, then edit your config file
# you need the ip address of your wifi link in there http://amzn.to/V7yPPK
# then pair the pi with one of your devices,
# so hold down your light switches until they flash and power on with
lightwaverf lounge light on
# if that worked you are mostly there…
# next you need your energy monitor in place
# then make a calendar at google.com/calendar find the “share” option and get the address of it
# i’ll post some screen grabs of this later
# then add some events where the title is just “room device”, for example “lounge light”
# then set up a cron job on the pi that calls this command every 5 mins, so
# that will put you into the editor, save the file with this line at the bottom
*/5 * * * * lightwaverf energy 5 > /tmp/lightwaverf.out 2> /tmp/lightwaverf.err
# actually there is more to this than I realised, I will have to come back to this! If you can pick the rest up from https://github.com/pauly/lightwaverf then please let me know how you get on. If not I’ll be adding a proper installation guide there and will post it back here too.January 31, 2013 at 08:49 #4493
Yes no problem. It’ll force me to simplify the process too and split it out into chunks. First need to recover my bricked raspberry pi!
Hey it’s pay day, time to buy more STUFF! Next stop for me is some relays so I can control the kitchen downlighters without having to replace them with dimmables…February 1, 2013 at 10:34 #4515stephenmelodyParticipant
I’m fairly new to linux and I’m definitely not a programmer! I’m looking forward to your full guide… then I’ll start 😉February 9, 2013 at 00:56 #4697ian.pParticipant
great work on the ruby gem. I’ve been able to get it working on a Raspberry Pi via a plugin in SiriProxy (http://www.hometoys.com/emagazine/2013/02/siri-home-automation-integration-from-start-to-finish-brpart-2–raspberry-pi-installation/2090), your notes above and this YouTube video (http://www.youtube.com/watch?v=cTuhjTvg_pw)
one thing I haven’t been able to get working is the dimmer settings. From the source, it looks like it is supported by get_state, however “lightwaverf lounge light 75” simply returns the message “did not recognise state, got 75”. Am I doing something wrong, or is this one of the things on your todo list?
keep up the great work
IanFebruary 9, 2013 at 16:18 #4701foggyParticipant
I have SiriProxy working on my phone and have been trying to get Pauly’s Gem to work for ages, but without success.
I’m guessing you have created a specific plugin. Could you share it? and also how you installed it?
James.February 10, 2013 at 16:48 #4715ian.pParticipant
I’ve pushed the SiriProxy plugin to GitHub and quickly put together some accompanying notes (from memory) of the steps I followed to get things working. You can find it here – https://github.com/ianperrin/siriproxy-lwrf
Do bear in mind that I’m new to Github, Ruby and SiriProxy so hopefully I’ve done things correctly!
If you do try to follow the notes in order to get things working in your environment, I’d welcome any thoughts on how you get on.
IanFebruary 10, 2013 at 20:21 #4718
one thing I haven’t been able to get working is the dimmer settings. From the source, it looks like it is supported by get_state, however “lightwaverf lounge light 75″ simply returns the message “did not recognise state, got 75″. Am I doing something wrong, or is this one of the things on your todo list? keep up the great work Ian
Yep just my slack code, I don’t dim much so I have not got round to fixing it. I’ll try and sort that later today and will reply here when I publish an update. It’s down to the param always being a string I think and I’m only checking for a number.
Really pleased to hear people are using the code I wrote!February 10, 2013 at 22:08 #4720
I fixed the dimmer support (and added tests for it), so update your gem!
gem install lightwaverf
gem update lightwaverf
lightwaverf lounge light 25
lightwaverf lounge light 50
lightwaverf lounge light 90
etcFebruary 10, 2013 at 22:08 #4721simonrgParticipant
Pauly and Ian thanks to your work I now am able to turn my lights on and off using Siri plus a Raspberry Pi. Plus obviously the author of SiriProxy.
Please keep up the great work.
Being new to Ruby and gem, I had been trying with the original SiriProxy image from Sourceforge, but had ended up with at least two Ruby installations and several versions of everthying in different rvm / gem areas. I did succeed in turning lights on by putting out lightwaverf command line commands from SiriProxy, but it is far neater to have it all within Ruby and somehow I had created a new version of SiriProxy too.
What’s the best way to learn Ruby? More precisely where I need to go to get the understanding of what Gem and RVM are doing that results in me having multiple copies of everything, presumabely I am doing something wrong.
My next puzzle is to work out how SiriProxy (or Ruby) deals with capitalisation or more sensibly reading in the lightwaverf configuration file and doing case insensitive matching. I have a “centre light” in one room and this is “Centre light” for SiriProxy.
You must be logged in to reply to this topic.