Jump to content


Photo
- - - - -

Flag email


  • Please log in to reply
36 replies to this topic

#16 heffneil

heffneil

    Dedicated Cocooner

  • Registered
  • PipPipPip
  • 305 posts

Posted 18 April 2012 - 07:32 AM

Ok well I put the script in and ran it with the time now and I got an email with 0's which I guess isn't a problem. I will let it run for a day or two now and see how it goes. Thanks!

#17 heffneil

heffneil

    Dedicated Cocooner

  • Registered
  • PipPipPip
  • 305 posts

Posted 18 April 2012 - 01:06 PM

I got my report at 1:30 today and it still reads as 0's. I don't think this is correct? What do I put for the zone name the description? I just want to make sure I am doing this properly. Anything else have to reflect the zone name or number in the aforementioned scripts?

Thanks,

Neil

#18 lupinglade

lupinglade

    Cocoonut

  • Manufacturers
  • PipPipPipPip
  • 1130 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 18 April 2012 - 09:19 PM

Not the description. The short name. Everything else should be ok.

Edited by lupinglade, 18 April 2012 - 09:20 PM.


#19 heffneil

heffneil

    Dedicated Cocooner

  • Registered
  • PipPipPip
  • 305 posts

Posted 19 April 2012 - 04:11 PM

Interestingly enough today my email didn't show up?

As for the short name is that the zone name from the omni? That is what I was using.

#20 lupinglade

lupinglade

    Cocoonut

  • Manufacturers
  • PipPipPipPip
  • 1130 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 19 April 2012 - 05:51 PM

Can you post the script with the changes you made?

#21 heffneil

heffneil

    Dedicated Cocooner

  • Registered
  • PipPipPip
  • 305 posts

Posted 20 April 2012 - 07:14 AM

var poolMeterDay = 0;
var poolMeterWeek = 0;

function onSyncStart(forced, timestamp) {
var date = new Date(timestamp);

if(date.getHours() == 13 && date.getMinutes() == 30) {
sendPoolMeterReport();
poolMeterDay = 0;
if(date.getDay() == 0) poolMeterWeek = 0;
}
}

function onZoneNotReady(zone) {
if(zone.name == "Water Meter") incrementPoolMeter();
}

function incrementPoolMeter() {
poolMeterDay += 1;
poolMeterWeek += 1;
}

function sendPoolMeterReport() {
var report = "Pool Meter Report: Week = " + poolMeterWeek + " Day = " + poolMeterDay;
helper.sendMail(controller, "[email protected]", "Pool Meter Report", report);
helper.log(controller, report);
}

#22 heffneil

heffneil

    Dedicated Cocooner

  • Registered
  • PipPipPip
  • 305 posts

Posted 20 April 2012 - 07:15 AM

Also I noticed this morning that HaikuHelper had a little spinning wheel next to the controller and it said something. I stopped it and started it back up and it shows connected now. I think it lost connectivity for some reason - not the first time either.

#23 heffneil

heffneil

    Dedicated Cocooner

  • Registered
  • PipPipPip
  • 305 posts

Posted 20 April 2012 - 07:25 AM

The problems I foresee with this methodology and I hope you can clarify is this: if for any reason HaikuHelper restarts - the flags are reset to 0. That means if I restart the program, reboot the machine or whatever, correct?

If this is the case it doesn't work very well for me. There are more and numerous circumstances this machine could need a restart. Just wondering but I would better to have a DB or a file we wrote to that we could retrieve that number?

Thanks,

Neil

#24 heffneil

heffneil

    Dedicated Cocooner

  • Registered
  • PipPipPip
  • 305 posts

Posted 20 April 2012 - 02:28 PM

Good news I got my email today! 7, 7

So I think there was a hiccup in the connection between the machine and the omnipro.

Thanks,

Neil

#25 lupinglade

lupinglade

    Cocoonut

  • Manufacturers
  • PipPipPipPip
  • 1130 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 21 April 2012 - 12:21 AM

We will be adding a way to store values and retrieve them soon.

#26 heffneil

heffneil

    Dedicated Cocooner

  • Registered
  • PipPipPip
  • 305 posts

Posted 22 April 2012 - 11:29 AM

I didn't get my email yesterday. Maybe you guys are rejecting my emails because I bombarded yall?

#27 lupinglade

lupinglade

    Cocoonut

  • Manufacturers
  • PipPipPipPip
  • 1130 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 23 April 2012 - 01:13 PM

Check the HaikuHelper log to see if the report was generated and logged at the time it was supposed to?


Also regarding storing values -- the next version adds support for localStorage and databases (HTML5). So you will be able to have it remember the values even if the machine or HaikuHelper is restarted. To do so, you will use localStorage.poolMeterDay and localStorage.poolMeterWeek (instead of poolMeterDay and poolMeterWeek) and take out the first two lines from the script.

#28 heffneil

heffneil

    Dedicated Cocooner

  • Registered
  • PipPipPip
  • 305 posts

Posted 23 April 2012 - 02:02 PM

Looks like it isn't running every day. I started using an include but that wasn't when it stopped working.

First line:


helper.include(controller, "pool.js")

pool.js just has our regular script.

#29 lupinglade

lupinglade

    Cocoonut

  • Manufacturers
  • PipPipPipPip
  • 1130 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 23 April 2012 - 05:44 PM

Try adding this line into onSyncStart:
 
helper.log(controller, 'Started sync at ' + now.getHours() + ':' + now.getMinutes());
Lets see if it logs properly every minute? Afterwards, move it into the if() condition so that it only logs when the scheduled time matches.

I've tested here and it seems to be working fine.

#30 heffneil

heffneil

    Dedicated Cocooner

  • Registered
  • PipPipPip
  • 305 posts

Posted 23 April 2012 - 09:45 PM

I added that line and nothing in the log files. I think it has to do with the include. I am going to pull it out and see what happens.

Something is screwy. I put it in the script and I don't see anything in the logs. Any ideas now?

I just looked at my events.log and I don't think that is working properly for me anymore. Also in that events.log I noticed that the events are being repeated lots and lots of time....

Sorry for the trouble!

Update: I pulled my event log script / function out of the include and it is writing now. It seems to write the same stuff everytime is runs. Anyway still no email or log entry for the pool stuff

Edited by heffneil, 23 April 2012 - 10:08 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users