Haiku HAI and the iPAD

I would definitely think about serial support. I would probably right off the bat use this for integration with my Pentair Intellitouch pool automation system to read the pool temp and store in a user value or flag and control hottub etc from Haiku. They have a serial adapter with simple ASCII commands but doing thing like reading temp is a real pain in Omni programming because you need to make a message for each response (no variables), so a message needs to be made for every possible temperature response from the pool system.

Another use would be integrating with the Brultech power monitor again displaying current power consumption through a setting or flag or message perhaps.

Something like:


serialPort = helper.serialOpen("portname",9600,8,1);

serialPort.Write("test");

byteResponse = serialPort.Read(10,1000); // blocks until number of bytes are read or timeout occurs

stringResponse = serialPort.ReadLine(1000); // blocks until number of Lf is read or timeout occurs

serialPort.Close(); //probably not necessary, closed at end of script automatically

//also maybe received event, although blocking methods are more straight forward for typical request/response integration

function onSerialRecieve(recievedBytes)
{

}


Didn't realize Lion Server added a time machine server, I will have to evaluate if this will be the way to go. My WHS is currently running Web-Link and I need it's email abilities so this could work. Haiku has mostly taken over from it's web interface, but I will miss pure web base access to my Omni once in a while from my PC's.

I also run a logger on my WHS to record Omni events and temperatures in a sql database for long term storage and analysis, is there any way to write to a log or file from scripting? If not think about it, maybe even just have event/temp logging built in. SQLlite would be a good solution, but even just writing to text file would be useful. I have a web page currently on my WHS that shows temp trends over time in a graph.

I'll be PMing you ;).
 
I've got a test version with serial support that will do either events or line read/write. PM me and I'll send you a test version -- we really need someone to test the serial features and help with making sure everything needed for serial is available.

For logging, how about this:

You can collect info from the controller using javascript and then send it to an HTTP URL where you have a PHP script that does whatever you like with the data, ie. it could save it do a database. Setting up a timer to execute your log function repeatedly would be super easy and gives you tons of flexibility in terms of how often and what to log.

Lastly, we are planning on a web interface down the road.
 
You've been PM'ed.

Serial port already added, nice.

The http post solution would def work, although I would think about file system access at some point, and perhaps a dedicated logging mechanism that "just works".

I was hoping to hear you say that a web interface was coming. Using whatever apple uses for iCloud (SproutCore I think) you could make look nearly identical to the Haiku app.

One thing you can do with a web interface you can't do with a real App on iOS is more than one icon on springboard going to a specific function. I made a prototype where I could create a icon on my iPhone to jump right to arm/disarm or run a button. I just don't have the time to fully flesh that out, but the iOS specific meta tags for mobile safari let you remove the browser chrome and make it look like a full app.
 
I just purchased Haikuhelper. I was checing to see if you have adding growl messages on your list of supported features. I would like to get a growl notification of all zone events.

Thanks
Randy
 
I just purchased Haikuhelper. I was checing to see if you have adding growl messages on your list of supported features. I would like to get a growl notification of all zone events.

Already on the TODO. Thanks for your feedback!
 
Collecting Climate Statistics using the new log to external file feature:

Code:
var isCollectingStats = false;
function onConnect(controller) {
  // You might call start collecting only once a connection is established
  if(!isCollectingStats) collectStats();
}
function collectStats() {
if(controller.isConnected()) { // Make sure we don't log nonsense if we aren't connected
  isCollectingStats = true;
  line = '"' + controller.dateDescription() + '",';
  line += controller.energyCostDescription() + ',';
  line += controller.outdoorTemperatureSensor().valueDescription() + ',';
  line += controller.outdoorHumiditySensor().valueDescription() + ',';
 
  thermostats = controller.thermostats();
  for(i = 0; i < thermostats.length; i++) {
   thermostat = thermostats[i];
   line += thermostat.temperatureDescription() + ',';
   line += thermostat.humidityDescription() + ',';
  }
 
  helper.logToExternalFile('ClimateStats.csv', line);
 
  setTimeout('collectStats()', 10*60*1000); // Every 10 minutes
} else {
  isCollectingStats = false;
}
}

And here's one line of the result:


"December 4 2011, 7:57 PM",Low,7.0º C,92% RH,21.0º C,44% RH,
 
lupinglade

Got my first camera up and running like a champ. Easy setup!

One small item I'd like, is to be able to rearange the order of the major categories on the favorites page.
 
Lupinglade:
Loving Haiku and HaikuHelper! A simple question for you. Under the "Status" view I used to see the "Security" status under the "Areas" tab, but now this section is blank. I recently upgraded my firmware to 3.9, programmed the room objects in PCAccess (also v3.9). Is there a setting that will enable me to see the security status in "Areas" on the "Status" page? I love this view as it shows the important status items and I used to arm/disarm the security thru this screen. Any thoughts on what I need to change to restore it?
Thanks! Keep up the great work.
Geoff
 
If someone could help me out with an example on how to do the following it would be much appreciated. So I'm looking for a way to have HH send a push notification when buttons are pressed on an HAI panel. For example, if i pressed the button "Goodbye" on my HAI panel, I want Haiku Helper to send out a push notification saying "Button Goodbye Pressed" or something along those lines.
Also, if I wanted to have the code check if a UPB switch was on, and if it was, turn it off when a certain button is pressed. Is that much more difficult? I can see this Java coding option allowing much greater flexibility, but also provide much more efficient logic so that the HAI system isn't sending UPB commands it doesn't need to.
Thanks!
 
Loving Haiku and HaikuHelper! A simple question for you. Under the "Status" view I used to see the "Security" status under the "Areas" tab, but now this section is blank. I recently upgraded my firmware to 3.9, programmed the room objects in PCAccess (also v3.9). Is there a setting that will enable me to see the security status in "Areas" on the "Status" page? I love this view as it shows the important status items and I used to arm/disarm the security thru this screen. Any thoughts on what I need to change to restore it?

The name of the area must be set, even if there is only one area. You can work around it by setting to two areas, naming the first area and then setting back to one area (all of this in PC Access and written to the controller). This will be fixed in the next update. Thanks!
 
If someone could help me out with an example on how to do the following it would be much appreciated. So I'm looking for a way to have HH send a push notification when buttons are pressed on an HAI panel. For example, if i pressed the button "Goodbye" on my HAI panel, I want Haiku Helper to send out a push notification saying "Button Goodbye Pressed" or something along those lines.
Also, if I wanted to have the code check if a UPB switch was on, and if it was, turn it off when a certain button is pressed. Is that much more difficult? I can see this Java coding option allowing much greater flexibility, but also provide much more efficient logic so that the HAI system isn't sending UPB commands it doesn't need to.
Thanks!

Sure, its quite simple:

Code:
function onButtonActivate(button) {
	helper.sendNotification(controller, 'Button ' + button.bestDescription() + ' Pressed');
 
	if(button.name() == 'Goodbye') { // If we push the goodbye button...
		var someUnit = controller.unitWithName('Some Unit'); // The unit you want to work with -- you can also do .unitWithNumber(555) if you prefer
		if(someUnit.isOn()) { // Check if 'Some Unit' is on...
			someUnit.off(); // Turn 'Some Unit' off.
		}
	}
}
 
Lupinglade:
I just finished installing and doing basic programming on my Lutron RadioRa2 system and have integrated the switches into HAI. The RA2 system allows you to program Phantom Buttons (which are virtual button useful for programming in HAI). HAI purports to recognize these Phantom Buttons as scenes. However, I can't seem to find these scenes/Phantom Buttons on Haiku. As a backup, I've gone ahead and created "buttons" in HAI and programmed it where if the HAI button is pressed, the Phantom Button is "pressed". These show up on Haiku and work just fine. However, it's a bit of a roundabout way of accomplishing what I believe is built in. Am I missing something?
 
HaikuHelper 1.60 submitted to App Store:

- Added Growl notifications support
- Added ability to send email notifications from script via helper.mail()
- Added serial communications support to scripting bridge (see scripting documentation)
- Added menu to dock icon
- Added logging file-based method to scripting bridge - great for collecting stats
- Added onRefreshConfig() callback to scripting bridge
- Logs are now saved to ~/Documents/HaikuHelper/HaikuHelper.log
- Improved sync process flow for enhanced reliability
- Controllers pane will no longer pop up when starting on login (uncheck and recheck the option at least once after updating)
- UI improvements
- Time sync and controller config refresh now happens at 4:06 AM daily
- Fixed bugs with Date types in scripting, date methods now return timestamp as a number
 
Back
Top