Jump to content


Photo
* * * * * 2 votes

HAI and the iPAD


  • Please log in to reply
466 replies to this topic

#391 bighorn

bighorn

    Cocooner

  • Registered
  • PipPip
  • 31 posts
  • Experience:average
  • Hardware:HAI OmniPro II
  • Tech:UPB
  • Audio:Russound
  • Video:AirPlay
  • CCTV:analog, dvr

Posted 13 December 2011 - 05:16 PM

Another new feature coming in the subsequent HaikuHelper update, AppleScript control:

Controlling iTunes via AppleScript

function onButtonActivate(button) {
  if(button.name() == 'iTunes Play') {
	helper.executeAppleScript(controller,'tell application "iTunes" to play');
  } else if(button.name() == 'iTunes Pause') {
	helper.executeAppleScript(controller, 'tell application "iTunes" to pause');
  } else if(button.name() == 'iTunes Prev') {
	helper.executeAppleScript(controller, 'tell application "iTunes" to skip to previous track');
  } else if(button.name() == 'iTunes Next') {
	helper.executeAppleScript(controller, 'tell application "iTunes" to skip to next track');
  }
}

This will let you control iTunes using a few simple named buttons on the controller, for example. You can control almost any application using AppleScript.


Lupinglade,
Very cool iTunes feature. When will the next version of HaikuHelper be available?
Cheers,

#392 lupinglade

lupinglade

    Cocoonut

  • Manufacturers
  • PipPipPipPip
  • 1120 posts
  • Experience:guru
  • Software:Custom
  • Hardware:HAI OmniPro II
  • Tech:UPB, ZigBee, Custom
  • Audio:Nuvo
  • Video:AirPlay
  • CCTV:ip, dvr
  • Phone:Linksys PAP2, Vonage

Posted 13 December 2011 - 06:51 PM


Lupinglade,
Very cool iTunes feature. When will the next version of HaikuHelper be available?
Cheers,


HaikuHelper 1.60 just became available on the Mac App Store.

#393 lupinglade

lupinglade

    Cocoonut

  • Manufacturers
  • PipPipPipPip
  • 1120 posts
  • Experience:guru
  • Software:Custom
  • Hardware:HAI OmniPro II
  • Tech:UPB, ZigBee, Custom
  • Audio:Nuvo
  • Video:AirPlay
  • CCTV:ip, dvr
  • Phone:Linksys PAP2, Vonage

Posted 13 December 2011 - 08:43 PM

There is a potential crash bug in Haiku 3.52, it is recommended you do not update if you haven't yet and wait until 3.53, which has already been submitted to Apple.

#394 networkcrasher

networkcrasher

    Cocooner

  • Registered
  • PipPip
  • 97 posts
  • Location:Atlanta

Posted 13 December 2011 - 11:10 PM

Collecting Climate Statistics using the new log to external file feature:

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,


Just installed 1.6 and got the following error when I attempted to try out this script:
Unhandled exception in script on line: 6 in function collectStats: 'undefined' is not an object. I don't have anything else in the script editor, and line 6 appears to be the function collectStats line.

#395 lupinglade

lupinglade

    Cocoonut

  • Manufacturers
  • PipPipPipPip
  • 1120 posts
  • Experience:guru
  • Software:Custom
  • Hardware:HAI OmniPro II
  • Tech:UPB, ZigBee, Custom
  • Audio:Nuvo
  • Video:AirPlay
  • CCTV:ip, dvr
  • Phone:Linksys PAP2, Vonage

Posted 14 December 2011 - 12:18 AM


Just installed 1.6 and got the following error when I attempted to try out this script:
Unhandled exception in script on line: 6 in function collectStats: 'undefined' is not an object. I don't have anything else in the script editor, and line 6 appears to be the function collectStats line.


Its complaining because the auxiliary sensors haven't been loaded yet. That code was early :) You just need to make sure the auxiliary sensors are refreshed first. Here's an updated script:

 
var isCollectingStats = false;
 
function onRefreshConfig(forced) {
  controller.refreshAuxiliarySensors();
}
 
function onSyncStart(forced) {
  if(!isCollectingStats) collectStats();
}
 
function collectStats() {
  if(controller.isConnected()) { // Make sure we don't log nonsense if we aren't connected
	isCollectingStats = true;
 
	var line = '"' + controller.dateDescription() + '",';
 
	// If you want just the numbers, wrap in parseInt()/parseFloat()
	line += controller.energyCostDescription() + ',';
	line += controller.outdoorTemperatureSensor().valueDescription() + ',';
	line += controller.outdoorHumiditySensor().valueDescription() + ',';
 
	var thermostats = controller.thermostats();
	for(i in thermostats) {
	  var thermostat = thermostats[i];
	  line += thermostat.temperatureDescription() + ',';
	  line += thermostat.humidityDescription() + ',';
	}
 
	// The file gets stored in ~/Library/Application Support/com.nullriver.HaikuHelper2/
	helper.logToExternalFile('ClimateStats.csv', line);
 
	setTimeout('collectStats()', 10*60*1000); // Every 10 minutes
  } else {
	isCollectingStats = false;
  }
}

This updated code combined with HaikuHelper 1.60 will first call the onRefreshConfig() ensuring the aux sensors are refreshed/loaded if needed and then call on SyncStart(). Note that onSyncStart gets called roughly every minute, so be careful what you put in there, you need to make sure it doesn't run more often than you want it to. Hence we have that if(!collectingStats) check.

Edited by lupinglade, 14 December 2011 - 12:25 AM.


#396 networkcrasher

networkcrasher

    Cocooner

  • Registered
  • PipPip
  • 97 posts
  • Location:Atlanta

Posted 14 December 2011 - 12:32 AM

Hmm. Still no go. I have firmware 3.7 on my omnipro if that matters. Same error on line 11 now.

#397 lupinglade

lupinglade

    Cocoonut

  • Manufacturers
  • PipPipPipPip
  • 1120 posts
  • Experience:guru
  • Software:Custom
  • Hardware:HAI OmniPro II
  • Tech:UPB, ZigBee, Custom
  • Audio:Nuvo
  • Video:AirPlay
  • CCTV:ip, dvr
  • Phone:Linksys PAP2, Vonage

Posted 14 December 2011 - 12:34 AM

The firmware should be fine. Is that the only code you pasted? What line is it highlighting? I just tested that code, works perfectly here. Make sure you clicked Run Script (or Apply) before disconnecting and reconnecting the controller. I just tested again with a clean config (fresh install of HaikuHelper) and it worked right away.

The only other thing I can think of is that your controller doesn't have one of the sensors we are using? Do you have an outdoor temperature sensor and an outdoor humidity sensor? If so, what are they named?

Edited by lupinglade, 14 December 2011 - 12:39 AM.


#398 lupinglade

lupinglade

    Cocoonut

  • Manufacturers
  • PipPipPipPip
  • 1120 posts
  • Experience:guru
  • Software:Custom
  • Hardware:HAI OmniPro II
  • Tech:UPB, ZigBee, Custom
  • Audio:Nuvo
  • Video:AirPlay
  • CCTV:ip, dvr
  • Phone:Linksys PAP2, Vonage

Posted 14 December 2011 - 12:41 AM

You can also just mark out these two lines:


//line += controller.outdoorTemperatureSensor().valueDescription() + ',';
//line += controller.outdoorHumiditySensor().valueDescription() + ',';


That should fix the error. I am guessing you don't have the outdoor humidity sensor, so its returning Undefined.

#399 networkcrasher

networkcrasher

    Cocooner

  • Registered
  • PipPip
  • 97 posts
  • Location:Atlanta

Posted 14 December 2011 - 12:55 AM

Yep, didn't think about it. I have multiple temp/humidity sensors, but my outdoor sensor just does temp, as I'm not concerned about the outdoor humidity. I figured it would just return n/a or something if the sensor didn't exist. Was going to troubleshoot that after I got the log working. I commented out the outdoor one and it looks to be working now. Spotlight didn't find the log still, so I had to manually dig down to the folder. Will wait a bit for an index to run and see if it shows up later.

Edited by networkcrasher, 14 December 2011 - 12:56 AM.


#400 lupinglade

lupinglade

    Cocoonut

  • Manufacturers
  • PipPipPipPip
  • 1120 posts
  • Experience:guru
  • Software:Custom
  • Hardware:HAI OmniPro II
  • Tech:UPB, ZigBee, Custom
  • Audio:Nuvo
  • Video:AirPlay
  • CCTV:ip, dvr
  • Phone:Linksys PAP2, Vonage

Posted 14 December 2011 - 01:36 AM

Yep, didn't think about it. I have multiple temp/humidity sensors, but my outdoor sensor just does temp, as I'm not concerned about the outdoor humidity. I figured it would just return n/a or something if the sensor didn't exist. Was going to troubleshoot that after I got the log working. I commented out the outdoor one and it looks to be working now. Spotlight didn't find the log still, so I had to manually dig down to the folder. Will wait a bit for an index to run and see if it shows up later.


Glad you got it working. Spotlight won't find it because its in a system/hidden folder. Unfortunately Apple requires us to put it there. You can specify a relative path that will put it elsewhere though. Like ../../../Documents/HaikuHelper/stats.csv

Edited by lupinglade, 14 December 2011 - 01:36 AM.


#401 Bal

Bal

    Cocooner

  • Registered
  • PipPip
  • 86 posts

Posted 14 December 2011 - 11:35 PM

Why oh why can't we have a pc version....no macs in this house :(

Great stuff regardless. Still wish you could do a floor plan view. I would get a mac if you had that! ;)

#402 lupinglade

lupinglade

    Cocoonut

  • Manufacturers
  • PipPipPipPip
  • 1120 posts
  • Experience:guru
  • Software:Custom
  • Hardware:HAI OmniPro II
  • Tech:UPB, ZigBee, Custom
  • Audio:Nuvo
  • Video:AirPlay
  • CCTV:ip, dvr
  • Phone:Linksys PAP2, Vonage

Posted 15 December 2011 - 01:31 PM

Why oh why can't we have a pc version....no macs in this house :(

Great stuff regardless. Still wish you could do a floor plan view. I would get a mac if you had that! ;)


Haiku/HaikuHelper are heavily dependent on Mac OS X. A Mac mini is perfect for home automation though and not all that expensive when compared with other home automation hardware.

We'll be looking at the control aspect of HaikuHelper in the future.

#403 sshearer

sshearer

    Newbie

  • New Member
  • Pip
  • 2 posts

Posted 16 December 2011 - 09:29 PM

I am a new user of HAIKU and just got connected to my HAI system this evening (had to upgrade the firmware of the Omni Pro II controller to connect). I am using the latest version of HAIKU.

I am connecting fine (wirelessly), but have a question. If I go into the control portion of the program, all my named lights are listed. However, I noticed all the lights were listed as being off (I waited a good bit of time to make sure the system had time to refresh everything). A number of the lights on my system are turned on either by virtue of the time of day or because a motion sensor in the house was tripped. Even though those lights are physically on, HAIKU shows them as being off. Those lights that I manually turn on by a switch do indicate as being on. Is there a reason or is it normal that HAIKU will not properly indicate the "ON" status of those lights that have been turned on automatically (by the HAI controller programming) by virtue of the time of day or tripping of a motion sensor?

Thank you for any suggestions or advice.

Scott

#404 Desert_AIP

Desert_AIP

    Cocoonut

  • Registered
  • PipPipPipPip
  • 1379 posts
  • Location:Washington
  • Experience:average
  • Hardware:HAI OmniPro II, Ocelot, RUC-01
  • Tech:X10-PLC, UPB, ZigBee, Custom
  • Audio:HAI
  • CCTV:ip, dvr
  • Phone:POTS

Posted 16 December 2011 - 09:58 PM

@sshearer
Are you using HLC?

#405 nmconcept

nmconcept

    Cocooner

  • Registered
  • PipPip
  • 30 posts

Posted 16 December 2011 - 11:02 PM

Hi, everyone!
I'm just started to dig into Home automation. I have HAI Omnipro II control board, over 20 HAI dimmers, 3 Omnistat thermostates and 4ch Everfocus DVR. Also I have iPad with Haiku app. Ihavesimilar problems as what mentioned above. Dimmer status is not updating if i turn the switch manualy. Only if i turn it on or off through Haiku i can see it's real status.
Second problem is i can not add correct link for cameras. When i use iphone or ipad i can see the pictures from my cameras. So i was trying to copy link for camera into Haiku, and nothing happens, only black screen.
My links looks like this: for camera 1, 192.168.1.222:5001/m/live.htm?camera=1; for camera 2, 192.168.1.222:5001/m/live.htm?camera=2




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users