Difference between revisions of "JavaScript Callback Functions API"

From HSYCO
Jump to navigation Jump to search
Line 3: Line 3:
 
== System Functions ==
 
== System Functions ==
  
=== DaylightEvent(day) ===
+
=== DaylightEvent ===
  
 
Called at sunrise and sunset, according to the latitude and longitude values set in hsyco.ini, and the optional SunriseOffsetMinutes and SunsetOffsetMinutes parameters.
 
Called at sunrise and sunset, according to the latitude and longitude values set in hsyco.ini, and the optional SunriseOffsetMinutes and SunsetOffsetMinutes parameters.
Line 13: Line 13:
  
  
=== haActiveEvent(active) ===
+
=== haActiveEvent ===
  
 
Triggered by the change of state of an HSYCO server in a master/slave high availability configuration.
 
Triggered by the change of state of an HSYCO server in a master/slave high availability configuration.
 +
 +
haActiveEvent(active)
  
 
'''Parameters:'''
 
'''Parameters:'''
Line 21: Line 23:
  
  
=== PowerEvent(power) ===
+
=== PowerEvent ===
  
 
Triggered by a change of the current power load level, as set using the powerSet() Java API or the POWER action.
 
Triggered by a change of the current power load level, as set using the powerSet() Java API or the POWER action.
Line 30: Line 32:
  
 
Thanks to this method it is possible to alter the power value shown in the Web interface, for example to aggregate power readings acquired from other sensors.
 
Thanks to this method it is possible to alter the power value shown in the Web interface, for example to aggregate power readings acquired from other sensors.
 +
 +
PowerEvent(power)
  
 
'''Parameters:'''
 
'''Parameters:'''
Line 35: Line 39:
  
  
=== programTimerEvent(name) ===
+
=== programTimerEvent ===
  
 
This method is called when a program timer is activated.
 
This method is called when a program timer is activated.
  
 
Program timers are set using programTimerSet(), programTimerReset(), programTimerRepeat(), or using the corresponding actions in the EVENTS.
 
Program timers are set using programTimerSet(), programTimerReset(), programTimerRepeat(), or using the corresponding actions in the EVENTS.
 +
 +
programTimerEvent(name)
  
 
'''Parameters:'''
 
'''Parameters:'''

Revision as of 18:53, 30 January 2014

Callback Functions

System Functions

DaylightEvent

Called at sunrise and sunset, according to the latitude and longitude values set in hsyco.ini, and the optional SunriseOffsetMinutes and SunsetOffsetMinutes parameters.

DaylightEvent(day)

Parameters:

  • day: boolean - true at sunrise, false at sunset.


haActiveEvent

Triggered by the change of state of an HSYCO server in a master/slave high availability configuration.

haActiveEvent(active)

Parameters:

  • active: boolean - true if the server is active, false if not active.


PowerEvent

Triggered by a change of the current power load level, as set using the powerSet() Java API or the POWER action.

If PowerEvent() returns -1 or if not defined, HSYCO status is updated with the detected power value, the value returned by PowerEvent() is otherwise used.

Note The JavaScript PowerEvent return value is used only if the Java PowerEvent callback is not defined or returned -1.

Thanks to this method it is possible to alter the power value shown in the Web interface, for example to aggregate power readings acquired from other sensors.

PowerEvent(power)

Parameters:

  • power: numeric - the power level, in Watts.


programTimerEvent

This method is called when a program timer is activated.

Program timers are set using programTimerSet(), programTimerReset(), programTimerRepeat(), or using the corresponding actions in the EVENTS.

programTimerEvent(name)

Parameters:

  • name: string - program timer name.


SchedulerEvent

StartupEvent

SunPositionEvent

TimeEvent

varEvent

Cameras

CameraCommandEvent

CameraMotionEvent

CameraViewEvent

DMX

DmxEvent

DmxFilter

DmxStartupEvent

Infrared Control

IREvent

I/O Servers

IOEvent

IOStartupEvent

Network Location Services

LocationEvent

Modbus

ModbusEvent

PBX

PBXCallEvent

Squeezebox

SlimPowerEvent

SlimStatusEvent

SlimVolumeEvent

Timers and Schedulers

UserTimerEvent

User Interface

pageEvent

uiClearEvent

userCommand

userSubmit

WebRootRequestEvent

Command and Utility Functions