Lupinglade,
Used your samples in HaikuHelper script API to write simple zone unsecured/secured send message. see below:
function onZoneNotReady(zone) {
if(zone.number == 14 ) {// Match zone by number
helper.sendNotification(controller, zone.bestDescription + ' Open');
}
}
function onZoneSecure(zone) {
if(zone.number == 14) { // Match zone by number
helper.sendNotification(controller, zone.bestDescription + ' Closed');
}
}
It Works.
Now I'm "Trying" to write a function that is triggered on flag change (Off) and zone (not ready) to send push.
function onUnitOff(unit) { // when flag off
if(unit.number == 438)// this the flag #
if(zone.number == 14) // this is the zone #, but only if unsecured
helper.sendTroubleNotification(controller, "Main Garage Door OPEN");
}
When i run script in script editor no problem.
when I change the flag in pc access I get a message in Helper that states- unhandled exeception on first line :
in function "onUnitOff": can't find variable:zone.
I have been playing with this script for hours, so I'm down to begging for help.
Thanks in advanced.
Mike Hickman
:blink:
Used your samples in HaikuHelper script API to write simple zone unsecured/secured send message. see below:
function onZoneNotReady(zone) {
if(zone.number == 14 ) {// Match zone by number
helper.sendNotification(controller, zone.bestDescription + ' Open');
}
}
function onZoneSecure(zone) {
if(zone.number == 14) { // Match zone by number
helper.sendNotification(controller, zone.bestDescription + ' Closed');
}
}
It Works.
Now I'm "Trying" to write a function that is triggered on flag change (Off) and zone (not ready) to send push.
function onUnitOff(unit) { // when flag off
if(unit.number == 438)// this the flag #
if(zone.number == 14) // this is the zone #, but only if unsecured
helper.sendTroubleNotification(controller, "Main Garage Door OPEN");
}
When i run script in script editor no problem.
when I change the flag in pc access I get a message in Helper that states- unhandled exeception on first line :
in function "onUnitOff": can't find variable:zone.
I have been playing with this script for hours, so I'm down to begging for help.
Thanks in advanced.
Mike Hickman
:blink: