Events
The JSON TCP protocol can send messages to connected clients. Once the client is connected, a subscription message must be sent for the server to start sending messages. The server incorporates a keep-alive mechanism with a timeout set to 45 seconds. Therefore, the client must send a message before this deadline is reached, or the server will stop sending messages.
Note
Events are available only with the JSON TCP protocol.
subscribe
Enables/disables subscribing to events and data changes. The server sends a message to confirm or deny the subscription, along with the client ID.
- Type:
Boolean
Request :
{
"subscribe": true,
"id":"message-id", //Optional
"password":"password" //If defined and only for the first request
}
Response :
{
"subscribe":true,
"client_id":"5",
"id":"message-id" //Returns the received ID if defined.
}
ping
Allows testing if the connection is still established with the server and maintaining the message subscription. The server will send a message with the pong variable along with the client ID.
- Type:
Boolean
Request :
{
"ping": true,
"id":"message-id", //Optional
}
Response :
{
"pong":true,
"client_id":"5",
"id":"message-id" //Returns the received ID if defined.
}
event messages
Events are received when the user interacts with the screen. A message is sent with the event object containing information about the event.
action
Event from action buttons.
{
"event":{
"action":{
"id":"action-uid",
"index":"1",
"state":"off"
}
}
}
id
Unique id of action.
- Type:
string
index
List object index of action.
- Type:
string
state
State of action.
- Type:
string - Value:
off|on
alarm
Event from alarm zone buttons.
{
"event":{
"alarm":{
"id":"zone-uid",
"index":"1",
"state":"arm"
}
}
}
id
Unique id of zone.
- Type:
string
index
List object index of zone.
- Type:
string
state
State of zone.
- Type:
string - Value:
arm|disarm
heat
Event from heating device.
{
"event":{
"heat":{
"id":"heat-uid",
"index":"1",
"set_point":"20.5",
"mode":"1"
}
}
}
Conseil
set_point and mode are not send are not sent simultaneously.
id
Unique id of heating device.
- Type:
string
index
List object index of heating device.
- Type:
string
set_point
New set point of heating device.
- Type:
string - Value:
float
mode
Mode touched of heating device.
- Type:
string - Value:
1|2|3|4
home_action
Event from home buttons.
{
"event":{
"home_action":{
"id":"home-uid",
"index":"1",
"state":"off"
}
}
}
id
Unique id of home action.
- Type:
string
index
List object index of home action.
- Type:
string
state
State of home action.
- Type:
string - Value:
off|on
lighting
Event from lighting device.
{
"event":{
"lighting":{
"id":"light-uid",
"index":"1",
"state":"on",
"color":"1249",
"level":"50"
}
}
}
Conseil
state, color and level are not send are not sent simultaneously.
id
Unique id of lighting device.
- Type:
string
index
List object index of lighting device.
- Type:
string
state
New state of lighting device.
- Type:
string - Value:
off|on
color
New color of lighting device.
- Type:
string - Value:
RGB565 integer - Interval:
0 ~ 65535
level
New luminosity level of lighting device.
- Type:
string - Value:
integer - Interval:
0 ~ 100
opening
Event from opening device buttons.
{
"event":{
"opening":{
"id":"opening-uid",
"index":"1",
"direction":"up"
}
}
}
id
Unique id of opening device.
- Type:
string
index
List object index of opening device.
- Type:
string
state
Direction of opening device.
- Type:
string - Value:
up|stop|down
action
Event from action buttons.
{
"event":{
"action":{
"id":"action-uid",
"index":"1",
"state":"off"
}
}
}
id
Unique id of action.
- Type:
string
index
List object index of action.
- Type:
string
state
State of action.
- Type:
string - Value:
off|on
view_list
Event from view_list items buttons.
{
"event":{
"view_list":{
"view":"view01",
"item":"view01-item-00",
"btn":3
}
}
}
view
Unique id of the view.
- Type:
string
item
Unique id of the item.
- Type:
string
btn
Id of the button.
- Type:
integer - Value:
1|2|3
setting_update
Sent when a configuration of domain modified.
{
"event":{
"setting_update":{
"domain":[
"lighting",
"heating"
]
}
}
}
domain
List of domain modified.
- Type:
array of string
restart
Sent when a the screen restart.
{
"event":{
"restart":true
}
}
data messages
This message is sent when one of the variables below changes its value:
| Domain | Variable |
|---|---|
| action | state |
| alarm | subtext, state |
| buzzer | state |
| heat | state, temp, set_point, mode1_state, mode2_state, mode3_state, mode4_state, text_heat, subtext |
| home_action | state |
| lighting | level, subtext, state |
| message | state |
| opening | subtext |
| screen | screen_state, screen_saver_state, screen_id |
| sd | inserted |
Exemple :
{
"data":{
"screen":{
"screen_state":1
}
}
}