Keep-alive

Keep-alive explanation

The Keep-alive is a periodically sent message which contains the most important device data.

T-Valve has two types of keep-alive packets, depending on the payload length, a Short and a Long one.

Packet payload size [Bytes]Description

Packet payload size [Bytes]

Description

Short [2]

Sent over regular time periods (the period is set with command 0x07 from the server). The packet contains the device temperature sensors data from the last measurement and the water valve state. Temperature measurement is done once per hour.

Long [5]

Full device data. Such a packet is send from the device on certain events or by server request with command 0x08 or once per day

Short payload

Byte index

Bit index

Hex value - Meaning

0

[7:0]

Temperature measured by sensor 1. This sensor measures the water temperature, thus only positive values are expected. The resolution is 0.5°C. The temperature is calculated by the expression: T, [°C] = (Bits[7:0])/2

1

7

Valve state, the values are in BIN format: 0 - The valve is closed – water isn’t flowing 1 - The valve is open – water is flowing.

1

[6:0]

Temperature measured by sensor 2. This sensor measures the ambient temperature. The measurement range is (-10°C to 50°C) and the resolution is 0.5°C. The temperature is calculated by the expression: T, [°C] = ((Bits[6:0])-2)/2 Examples: T = (20 - 20) / 2 = 0°C T = (120 - 20) / 2 = 50°C T = (0 - 20) / 2 = -10°C T = (75 - 20) / 2 = 27.5°C

Example packet: 0x0044

00[HEX] = 0[DEC] -> T, [°C] = 0/2 = 0°C

The water temperature is 0°C

44[HEX] = 01000100[BIN] -> [7] = 0 -> Valve is open [6:0] = 01000100-> T, [°C] = (68-20)/2 = 24°C

Long Payload

Byte index

Bit index

Hex value - Meaning

0

[7:5]

Reason to send the packet, the values are in BIN format: 000 - Requested by server command 0x08 or one day elapsed 001 - Device test switches combination is pressed 010 - Flood detected by device sensor 011: - “Open” or “Close” push-button is pressed 100 - Fraud detected – box tamper switch or magnetic sensor

0

4

Reserved

0

3

Box tamper status, the values are in BIN format: 0 - No box tamper detected 1 - Box tamper detected

0

2

Flood detector wire status, the values are in BIN format: 0 - The wire is working 1 - Wire is not working

0

1

Flood detection status, the values are in BIN format: 0 - No flood detected 1 - Flood detected

0

0

Magnet detection status, the values are in BIN format: 0 - No magnet presence is detected 1 - Magnet presence is detected

1

7

Alarm validation indicator. This bit is set to 1 when the user presses the “Verify” button when leakage alarm is active. After, on any response from the application server that bit is cleared

1

6

Manual valve open indicator, the values are in BIN format: 0 - Manual opening of the is disabled 1 - Manual opening of the valve is enabled

1

5

Manual valve close indicator, the values are in BIN format: 0 - Manual closing of the is disabled 1 - Manual closing of the valve is enabled

1

[4:0]

Device software version

2

[7:0]

In reduced access mode controls the valve close time. The resolution is in minutes

3

[7:0]

In reduced access mode controls the valve open time. The resolution is in minutes

4

[7:0]

Battery voltage. It is calculated by the formula: Battery voltage, [mV] = (Bits[7:0])*8 + 1600

Example packet: 0х64620000A4

64620000A4[HEX] = 0110 0100 0110 0010 0000 0000 0000 0000 1010 0100[BIN]

Byte 0: [7:5] = 011 -> Reason for packet “Open” or “Close” push-button is pressed [3] = 0 -> No box tamper detected [2] = 1 -> Wire is not working [1] = 0 -> No flood detected [0] = 0 -> No magnet presence is detected

Byte 1: [7] = 0 -> Alarm not verified [6] = 1 -> Manual open enabled [5] = 1 -> Manual close enabled [4:0] = 00010 -> Firmware version 2

Byte 2: [7:0] = 0000 0000 -> Close time 0 minutes

Byte 3: [7:0] = 0000 0000 -> Open time 0 minutes

Byte 4: [7:0] = 1010 0100 -> Battery voltage, [mV] = 164*8 + 1600 = 2912mV

Last updated