Event Keywords

From HSYCO
Revision as of 18:26, 4 February 2014 by Hsyco (talk | contribs) (→‎PING)
Jump to navigation Jump to search

An event is defined as a keyword that identifies the event type, usually followed by one or more parameters and conditional operators. Every keyword uses a specific syntax that interprets parameters according to its own rules.


System Events

DAY

HAACTIVE

HSYCOSTART

NIGHT

POWER

PROGRAMTIMER

SUNAZIMUTH

SUNELEVATION

TIME

Cameras

CAMERA

This event is true while HSYCO is recording video from a specific camera.

Recording could start automatically when a camera notifies a recording request with the recording HTTP API call:

http://192.168.0.50/x/camerarec?camera=name
http://192.168.0.50/x/camerarec?camera=name&zone=id


Recording can also be triggered by the CameraRecTrigger() Java call or the CAMERAREC or CAMERARECFULL actions in EVENTS.

Event State Description
CAMERA name stable the camera is recording
CAMERA name = zone transient transient event triggered by a camera recording request with zone information


Parameters:

  • name - the camera id
  • zone - the zone id.


Examples:

CAMERA entrance

CAMERACOMMAND

Triggered by a camera control input from the Web interface.

It can be used to execute arbitrary actions when the user clicks on the active areas of the camera view.

Event State Description
CAMERACOMMAND name = function transient if this event has a positive match in EVENTS, the standard PTZ command associated to the camera’s PTZ driver is not executed


Parameters:

  • name - the camera id
  • function - see the table below.


icon function action
Camover-ff.png focus far
Camover-fn.png focus near
Camover-zin.png zoom tele
Camover-zout.png zoom wide
Camover-l.png move left
Camover-r.png move right
Camover-u.png move up
Camover-d.png move down
move stop
Camerapanel ptz.png


Examples:

CAMERACOMMAND entrance = focusfar

CAMERAVIEW

This event is used to check if HSYCO is currently displaying the real-time video from a camera.

The event will reset to off when no Web client has been loading images from the camera for several consecutive seconds.

Event State Description
CAMERAVIEW name = status stable the camera real-time view status


Parameters:

  • name - the camera id
  • status - set to “on” or “1” to match the event when HSYCO is displaying the live view, and to “off” or “0” to match the event when HSYCO is not displaying a live view of the camera on any client.


Examples:

CAMERAVIEW entrance = on

DMX

DMX

Events on the DMX bus channels.

Event State Description
DMX address transient any change to the channel value
DMX address = ON stable channel value > 0
DMX address = OFF stable channel value = 0
DMX address = value

DMX address > value DMX address < value DMX address >= value DMX address <= value

stable the channel value is equal, greater, greater or equal, less, less or equal to the given value.

Valid values are numbers between 0 and 255


Parameters:

  • address - when using one DMX gateway, address will be a standard DMX-512 address between 1 and 512. If there is more than one gateway, 1000 must be added to the DMX address for the second gateway, 2000 for the third one and so on. For example, 2100 stands for the address 100 on the DMX bus controlled by the third gateway.


Examples:

DMX 100 = ON
DMX 1200 = OFF
DMX 135 = OFF OR DMX 100 > 50
DMX 41 <= $LEVEL

DMXSTART

This event is triggered when starting the monitor threads for each DMX bus, once per bus at the start of the execution of HSYCO, and also after every restart of the monitor thread.

Event State Description
DMXSTART busid transient occurs when HSYCO connects to the DMX gateway.

HSYCO establishes the connection at start-up.

If the gateway is turned off and then on, or if communication errors occur, HSYCO automatically re-establishes the connection as soon as possible, calling this event in case of success


Parameters:

  • busid - the id of the DMX gateway. The first gateway has address 0. The second has address 1, etc. busid can be omitted if 0.

Examples:

DMXSTART: DMX 100-200 = OFF
DMXSTART 1: DMX 1100-1200 = OFF

Infrared Control

IR

This event is triggered when an IRTrans receives and successfully decodes an infrared command.

The IR code must be in the local IRTrans FLASH memory database.

Event State Description
IR name = command transient command received by an IRTrans device


Parameters:

  • name - the IRTrans, as defined in the IRTrans parameter in hsyco.ini
  • command - the command format is “remote.command”, that is the remote control database name followed by a dot and the command name.


Examples:

IR theater = dvd.play

I/O Servers

IO

Triggered by a status change of any data port of an I/O server.

Event State Description
IO name transient any change of an I/O variable
IO name = value

IO name > value
IO name < value
IO name >= value
IO name <= value

stable the value is equal, greater, greater or equal, less, less or equal to the given value.

Note The names and values of the I/O variables are specifically related to the type of I/O server. Values can be numeric or strings


Parameters:

  • name - the data point name of the input or output port. According to the type of server, the format changes but it generally appears as server name, as declared with the ioServers parameter in hsyco.ini, followed by a dot and the input/output port name. See the Application Notes for more information.


Examples:

IO tempmeter.indoor > 25.5
IO contacts.c1 = 1

IOSTART

This event indicates that the connection with an I/O server has been correctly established.

It should be safe to associate this event with actions that set the I/O server writable variables.


Event State Description
IOSTART id transient Triggered by the start of the communication thread of each I/O server - once for each server at the beginning of the execution of HSYCO, and also after every reboot of the communication thread, for example after communication errors


Parameters:

  • id - the I/O server number, starting from 0, based on the listing order of the ioServers parameter in hsyco.ini; If only one I/O server is available, it can be omitted.


Examples:

IOSTART: IO contacts.c1 = 1
IOSTART 2: IO relays.door = 1

Leak Detector

LEAK

Network Services

LOCATION

This event is triggered when a change in the association status of a client to the Wi-Fi access points is detected.

It is a stable condition that represents the current connection state an location of WiFi clients logged into the HSYCO Web interface.

Event State Description
LOCATION address = zone stable a device connects to the access point identified by the zone name, as declared in the LocationBases parameter in hsyco.ini
LOCATION address = ON stable a device connects to the WiFi network
LOCATION address = OFF stable a device disconnects from the WiFi network


Parameters:

  • address - the WiFi device’s MAC address. It is made of 6 byte pairs, written in hexadecimal format and separated by “:”.


Examples:

LOCATION aa:01:33:e4:41:00 = entrance
LOCATION aa:01:33:e4:41:00 = ON
LOCATION aa:01:33:e4:41:00 = OFF

PING

This transient event is generated by a PING action, that tests the reachability of one or more IP hosts, identified by their hostnames or IP addresses, within the optional timeout defined in milliseconds (or using a default timeout of 200 ms).

Event State Description
PING hostname = ON transient the device has been reached after a PING action
PING hostname = OFF transient the device is not reachable after a PING action


Parameters:

  • hostname - the IP device name or IP address, as called by the corresponding PING action.


Examples:

TIME: PING 192.168.1.1
PING 192.168.1.1 = OFF : LOG = "router is off-line"

URL

PBX

PBX

Called when a call notification is sent to HSYCO by the PBX system.

The call notification must be sent using the HTTP API for telephony services.

See the telephony services appendix for additional information.

Event State Description
PBX from = to transient phone call event, with originator and destination data


Parameters:

  • from - the caller number
  • to - the called number.


Examples:

A call from number 22 to number 44 turns on light k.33:

PBX 22 = 44 : IO k.33 = 1

Squeezebox

MUSIC

Triggered by a status change in a Squeezebox player. It is a stable condition that represents the current ON/OFF/PLAY/PAUSE status of the player.

Event State Description
MUSIC address = ON stable player on
MUSIC address = OFF stable player off
MUSIC address = PLAY stable player on - play
MUSIC address = PAUSE stable player on - pause


Parameters:

  • address - player number, starting from 0 for the first player, based on the listing order of the slimPlayers parameter in hsyco.ini.


Examples:

MUSIC 0 = ON
MUSIC 1 = PLAY

Timers and Schedulers

TIMER

User Interface

PAGE

USER