zachfeldman / alexa-home Goto Github PK
View Code? Open in Web Editor NEWUsing Amazon Echo to control the home!
Home Page: https://www.youtube.com/watch?v=9AmxiGVBekE
License: Other
Using Amazon Echo to control the home!
Home Page: https://www.youtube.com/watch?v=9AmxiGVBekE
License: Other
Hi Zach! Just putting what I posted on your blog on Github.
Some questions...
I got everything to run, but I get some weird things on Raspberry Pi when I run the startupScript.sh:
$ /home/pi/.rvm/gems/ruby-2.2.0/gems/hue-0.1.3/lib/hue/client.rb:20:in bridge': Hue::NoBridgeFound (Hue::NoBridgeFound) from /home/pi/.rvm/gems/ruby-2.2.0/gems/hue-0.1.3/lib/hue/client.rb:49:in
validate_user'
from /home/pi/.rvm/gems/ruby-2.2.0/gems/hue-0.1.3/lib/hue/client.rb:14:in initialize' from /home/pi/dev/alexa-home/modules/lights.rb:4:in
new'
from /home/pi/dev/alexa-home/modules/lights.rb:4:in <top (required)>' from app.rb:8:in
require'
from app.rb:8:in <main>' "Error: Address family not supported by protocol - socket(2) for \"::1\" port 7055" watir-login.rb:80:in
rescue in start_crawler': undefined method last_command' for nil:NilClass (NoMethodError) from watir-login.rb:74:in
start_crawler'
from watir-login.rb:86:in `
Then I think the app.rb and watir-login.rb quits, because I run ps aux | grep ruby and those 2 are no longer showing.
Lastly, I do the jquery insert in Chrome and I keep getting this:
GET http://localhost:4567/command?q=&_=1425397524539 net::ERR_CONNECTION_REFUSED
GET http://localhost:4567/command?q=alexa%20stop&_=1425397524541 net::ERR_CONNECTION_REFUSED
I don't have Hue so obviously that's not working, but I'm thinking something is up with the ports in sinatra. Is it my router? Not sure...
Lastly, I found a typo in your read me file: "chmod +x startScript.sh && ./startupScript.sh". Should be "chmod +x startupScript.sh && ./startupScript.sh"
Thank you so much for the awesome write up! I'm enjoying your blog!
Just to let you guys know.
Youtube has pullen the video
"This video contains content from Believe Music, who has blocked it in your country on copyright grounds."
Tonight when I issued a lights command, Alexa came back with a strange answer: "Could not find any connected home devices."
When I said, "Find connected home devices" she replied:
"Starting discovery. If you have a Philips Hue Bridge, press the button."
It seems she found all the lights, including Wemo lights, just judging by the number of connected home devices she reported finding.
She can't control anything yet...light commands don't work [yes she can...see below] But it seems like it's coming very soon. We'll see if it's as good as your amazing project -- and if it isn't, I hope it doesn't interfere with it!
I would like to work on this with you, so I'm telling you about this, seeking direction. Looks like the modules need to be pluggable, so a user can specify a set of them. I got it working with just nest, by merely commenting out the require lights line in app.rb. How would you envision this being implemented, some config in config.ru?
I'm working on my own automation making use of the Wink hub and api.
https://github.com/KellyMahan/winker
Until a proper SDK is usable I'd like to make use of just your watir code with a configurable callback url. Easiest way is just create a gem with an executable.
I am trying to make it as modular as possible. I already have the basic Winker gem written. The readme explains it pretty well.
Winker-Rails is in progress but not releasable yet. It will be web interface for setting up logic that wink doesn't provide for.
Winker-Voice which I haven't started yet, will be the ai for parsing text strings for the proper commands.
All that i'm lacking is an easy way to get the commands from the echo device is something like your watir code. I may even add some additional functionality for playing music as part of the automation.
If it's not something you have time for then I can create it and attribute it to you.
Hi!
When I put:
var lastCommand;
$(document).ajaxComplete(function(){
command = $(".dd-title.d-dialog-title").first().text()
if(lastCommand != command){
$.get("http://localhost:4567/command?q="+command)
lastCommand = command;
}
})
I get the following:
GET http://localhost:4567/command?q=alexa%20stop&_=1425415875478 net::ERR_CONNECTION_REFUSED
or
GET http://localhost:4567/command?q=alexa%20stop&_=1425416231226 net::ERR_CONNECTION_REFUSED
Not sure if this is a problem...
Thank you Zach!
This error started showing up for me earlier today:
JSON::ParserError: A JSON text must at least contain two octets!
from /Users/arkonovs/.rvm/gems/ruby-2.2.0/gems/json-1.8.2/lib/json/common.rb:155:in `initialize'
It seems like Hue added a redirect to:
https://client-eastwood-dot-hue-prod-us.appspot.com/api/nupnp
from
https://www.meethue.com/api/nupnp
I changed the address in client.rb and all is well again.
Should be:
Type chmod +x startupScript.sh && ./startupScript.sh
Hi Zach,
From my R-Pi, when I run chmod +x startScript.sh && ./startupScript.sh, I get the following:
$ /home/pi/.rvm/gems/ruby-2.2.0/gems/hue-0.1.3/lib/hue/client.rb:20:in bridge': Hue::NoBridgeFound (Hue::NoBridgeFound) from /home/pi/.rvm/gems/ruby-2.2.0/gems/hue-0.1.3/lib/hue/client.rb:49:in
validate_user'
from /home/pi/.rvm/gems/ruby-2.2.0/gems/hue-0.1.3/lib/hue/client.rb:14:in initialize' from /home/pi/dev/alexa-home/modules/lights.rb:4:in
new'
from /home/pi/dev/alexa-home/modules/lights.rb:4:in <top (required)="">' from app.rb:8:in
require'
from app.rb:8:in <main>' "Error: Address family not supported by protocol - socket(2) for \"::1\" port 7055" watir-login.rb:80:in
rescue in start_crawler': undefined method last_command' for nil:NilClass (NoMethodError) from watir-login.rb:74:in
start_crawler'
from watir-login.rb:86:in `
Then I think the app.rb and watir-login.rb quits, because I run ps aux | grep ruby and those 2 are no longer showing.
Thanks!!!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.