Difference between revisions of "JavaScript Callback Functions API"
Jump to navigation
Jump to search
Line 19: | Line 19: | ||
− | === PowerEvent === | + | === PowerEvent(power) === |
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. | ||
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. | 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. | ||
+ | |||
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. | ||
'''Parameters:''' | '''Parameters:''' | ||
* power: number - the power level, in Watts. | * power: number - the power level, in Watts. | ||
− | |||
− | |||
=== programTimerEvent === | === programTimerEvent === |
Revision as of 18:43, 30 January 2014
Contents
Callback Functions
System Functions
DaylightEvent(day)
Called at sunrise and sunset, according to the latitude and longitude values set in hsyco.ini, and the optional SunriseOffsetMinutes and SunsetOffsetMinutes parameters.
Parameters:
- day: boolean - true at sunrise, false at sunset.
haActiveEvent(active)
Triggered by the change of state of an HSYCO server in a master/slave high availability configuration.
Parameters:
- active: boolean - true if the server is active, false if not active.
PowerEvent(power)
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.
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.
Parameters:
- power: number - the power level, in Watts.