Haiku Using Amazon Alexa devices (Echo, Dot, Tap, etc.) with HAI

I don't know if you can get haiku helper now? 
 
 
I exported my omni config by printing it to a PDF and now I am in the midst of coping and pasting it in Excel.  The trick is to get the Room name before the load name.
 
One question: is there a way to automate buttons?  I would prefer not to say On and Off is there anything else that can be used a verb?
 
Thanks,
 
Neil
 
Sorry but are you asking if you can control a button using Echo? If so, in the spot in the .php file where you have the HH API call, you can use something like: hhapi('controller.buttonWithName('your button name').activate();')
 
In general you can use anything from the HH Javascript Bridge API.
 
As far as Echo syntax, what would you like to say? If you defined an object in the bridge named "your button name', you can say "Turn on (or off) your button name".
 
I figured you can do anything but if I turn a button ON will it stay on? I would like to say activate BUTTON NAME or RUN open gate or Run Quick Gate something like that.  Any thoughts?  I will do more research.  I just had no device response so I restarted the JAR.  Now I need to schedule the JAR to run - preferably not in a terminal window.
 
Thanks,
 
Neil
 
Yeah I don't want my buttons to be on necessarily.  They aren't meant to work like that - I think no one uses buttons like that with any other interface.
 
Im going to do more research.  Did you like my update using the URL variable for the device ID?  I also noticed that the Turn On and Turn Off are really just toggles so that needs some cleaning up
 
I modified the code to not use toggle but to check the URL variable passed 1 or 0 and to turn the load on or off:
 
// Grab the name and date properties from the controller object
if (isset($_GET["dim"])) {
    hhapi('controller.unitWithNumber('.$_GET["DeviceNum"].').setLevel('.$_GET["dim"].')');
}
elseif($_GET["newTargetValue"] == 1){
   hhapi('controller.unitWithNumber('.$_GET["DeviceNum"].').on()');
}
elseif($_GET["newTargetValue"] == 0){
   hhapi('controller.unitWithNumber('.$_GET["DeviceNum"].').off()');
}
 
This works better and I found that sometime the system will queue up and then spit a bunch of stuff out and turn lights on and off and on again :) This solves that problem provided you don't turn the load back on or off before the queue spits out
 
So I look at the command line output and it doesn't seem to be passing the brightness level to the URL.  This looks like a bridge problem but I wonder how its supposed to get there.  I will try to research!
 
So I Have a Tap and an Echo.  The Tap works fine.  The Echo doesn't work at all now. It says the device isn't responding.  They are both on a luxul network that emulates on SSID in the entire home from an AP perspective...
 
So I just replaced the bridge with this one: https://github.com/bwssytems/ha-bridge
 
The web interface is better, the instructions seem much better as well.  Also I noticed it responds with "I found 1 Device".  Lastly it will take a dimming URL which I am going to test now.
 
Thanks!
 
Neil
 
 
FYI i updated the script to work with the butons now.  See below:
 
if (isset($_GET["dim"])) {
    hhapi('controller.unitWithNumber('.$_GET["DeviceNum"].').setLevel('.$_GET["dim"].')');
}
elseif(isset($_GET["newTargetValue"])) {
   if ($_GET["newTargetValue"] == 1){
        hhapi('controller.unitWithNumber('.$_GET["DeviceNum"].').on()');
   }
   elseif($_GET["newTargetValue"] == 0){
   hhapi('controller.unitWithNumber('.$_GET["DeviceNum"].').off()');
   }
}
elseif (isset($_GET["Button"])) {
   hhapi('controller.buttonWithName("'.$_GET["Button"].'").activate()');
  echo $_GET["Button"];
}
 
I'm new to all this, but would be very interested in getting the Amazon Echo integrated with my HAI system. I've read through the readme files, and all six pages of this. I'm still confused where to begin (and what to do after that). You mentioned you were putting together step-by-step instructions. I also have Haiku Helper running on my Macmini, so shouldn't be too different of a set-up. Any help would be greatly appreciated.
 
Ok I can help.  The update that fixed a crash I was experiencing was released yesterday.  Download the jar file and follow those directions and get the .jar built and running.  Once you get that working let me know and I will try to remember the next steps.  You have to make that page based on the code IHF originally provided or the modified code I updated it with.  Then you have to put that file in your root website directory on your macmini.  You also have to enable the webserver *Apache" on your macmini.
 
IHF or Lupin can you guys let me know why a UNIT number for a room might not jive with the loads?  When I go in to HH's web interface the unit numbers are next to it.  For Example 057 should be a couple switches in my garage.  It doesn't work :(.  I have another room and when I make it turn on or off switches in other odd rooms work.  So I don't know where the room unit numbers are coming from?
 
I ran amazon-echo-bridge-0.4.0.jar --upnp.config.address=192.168.1.177
I've also installed MAMP which according to http://osxdaily.com/2015/08/30/automatically-start-apache-mac-os-x-boot/ which enables the web server "Apache" and PHP on my Mac mini.
 
When I go to http://192.168.1.177:8080/configurator.html I am able to access the Amazon Bridge Configuration and it gives me the option to add a new device.
 
Now I'm stuck as what to do next. How do I find the URL for each device I want to add? For example, I want to add my Living Room Lights. 
 
I found Library/Webserver/Documents, but I'm not sure what file I'm supposed to put in there.
 
Finally, when I tried running the other Jar file I could never get it to work. I wasn't able to access the website configuration.
 
Back
Top