Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional information about rest api handlers #7

Open
charlesshoults opened this issue Dec 10, 2015 · 0 comments
Open

Additional information about rest api handlers #7

charlesshoults opened this issue Dec 10, 2015 · 0 comments

Comments

@charlesshoults
Copy link

Could you provide a description on what options are available for the triggers that take place when the Echo tries to run actions against the virtual switches? Can these events handle more than just on and off?

What I'm doing:
I'm building a series of light boxes to be placed in several rooms of my house. These boxes each contain a Raspberry Pi 2, a number of sensors and a relay board connected to several LED light strips. In all, I'm looking to configure up to 8 virtual switches per box. The 16 device limit doesn't bother me, although I've read that in recent weeks, Amazon has increased the device limit in the Echo to control up to 100. I will have up to 7 of these light boxes in my house.

With the example below, I changed the IP address to be that of the Raspberry Pi I'm using for testing, 192.168.0.101. I've also added a port of 49101 so that if I stop and relaunch the python script, it persists. The Echo detects the device and puts it in it's list as "office lights", but when I ask Alexa to turn offlice lights on or off, it thinks for several seconds, then tells me that the device is not responding. I'm not a python guy and I'm not sure what options are available for triggers. Is "http://192.168.5.4/ha-api?cmd=on&a=office" simply looking for a file located in a standard document_root directory for httpd or is this something that is also presented within the python script for fauxmo? If this address is local to the server where the python script is running, could I replace this trigger with the location of a bash or php script? If so, what would that look like? Can this handler handle more than just on and off? I'd love to be able to say something like "Alexa, light box set position one" but I don't completely understand how the Echo determines a command. "Alexa, office lights on" makes sense, but can I use multi-word commands?

['office lights', rest_api_handler('http://192.168.5.4/ha-api?cmd=on&a=office', 'http://192.168.5.4/ha-api?cmd=off&a=office')]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant