General
Each OpenMotics Gateway (GEN2 Gateway or GEN3 Brain(+)) has minimum 2 RS485 connections:
- OM Bus: Master controller Microchip DSPIC is controlling the OM bus -> All traditional slave modules like input, relay, Dim Control, CAN control communicates over this bus
- Energy bus: BB is controlling the Energy bus -> All Energy modules are residing on this bus
The firmware and hardware of the HVAC module has been developed in 2 versions:
- A version that communicates over OM bus (only for internal purposes)
- A version that communicates over the Energy bus (Commercial version)
2 flavours of the HVAC module firmware exists:
- V6.x.y only works with Gen 3.0 hardware on the OM bus (GEN3)
- V7.x.y only works with Gen 3.1 hardware on the Energy bus (GEN3)
This document describes the HVAC communication protocol over the Energy bus.
General Information about the energy bus can be found here:
ToDo:
- Bootloader commands
- Init commands
Versioning
This document describes the RS485 communication protocol available on the HVAC module.
HVAC Module FW version
|
7.x.y
|
Notation
Every RS485 instruction from BB to Slave over the energy bus must start with string characters STR
, the return message (from Slave to BB) must also start with STR
.
- Request M->S
'
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
12
|
13
|
14
|
15
|
16
|
17
|
STR |
ID0 |
ID1 |
CID |
Mode |
Type0 |
Type1 |
Type2 |
Length |
Data0 |
Data1 |
Data2 |
Data3 |
Data4 |
Data5 |
... |
CRC |
13 |
10
|
- M->S: Master to Slave
- Master to slave message will start with "STR"
- The ID0..1 is the destination slave address. ID0 (ascii) is always the module type, ID1 (binary) is the ID number. For the HVAC module, the Module type is "H".
- CID (UINT8): This Byte (binary) contains the Communication ID. When the Gateway sends a request to the Master, the Gateway will add the communication ID (communication sequence). The Master will always answer the request of the Gateway with the same communication ID. CID is set between 1 and 255. When CID is set to 0, it is not used.
- Mode: This byte (ascii) can contain "G"=get, "S"=set in request (M->S). "N" = No Ack.
- Type0..2 is the instruction type. The instruction type consist of 3 ASCII characters
- Length (UINT8): Length (binary) of the data bytes. Maximum length: 32.
- Data: Data information (binary), number of bytes can be found in variable length
- CRC (UINT8): CRC8 (binary) calculation of all bytes starting at ID0 till the last data byte.
- Request S->M (Normal answer)
'
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
12
|
13
|
14
|
15
|
16
|
17
|
RTR |
ID0 |
ID1 |
CID |
Mode |
Type0 |
Type1 |
Type2 |
Length |
Data0 |
Data1 |
Data2 |
Data3 |
Data4 |
Data5 |
... |
CRC |
13 |
10
|
- S->M: Slave to Master
- Slave to Master message will start with "RTR"
- The ID0..1 is the originating slave address. ID0 (ascii) is always the module type, ID1 (binary) is the ID number. For the HVAC module, the Module type is "H".
- CID (UINT8): This Byte contains the Communication ID. When the Gateway sends a request to the Master, the Gateway will add the communication ID (communication sequence). The Master will always answer the request of the Gateway with the same communication ID. CID is set between 1 and 255. When CID is set to 0, it is not used.
- Mode: Mode (ascii) can contain "G"=get, "S"=set in request (M->S), the answer (S->M) will contain the same Mode. "N" = No Ack.
- Type0..2 is the instruction type (ascii). The instruction type consist of 3 ASCII characters
- Length (UINT8): Length (binary) of the data bytes. Maximum length: 32.
- Data: Data information (binary), number of bytes can be found in variable length
- CRC (UINT8): CRC8 (binary) calculation of all bytes starting at ID0 till the last data byte.
- Request S->M (Error answer)
'
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
12
|
13
|
14
|
15
|
RTR |
ID0 |
ID1 |
CID |
Mode |
Type0 |
Type1 |
Type2 |
Length |
ErrorType |
ErrorData0 |
ErrorData1 |
ErrorData2 |
ErrorData3 |
CRC |
13 |
10
|
- This Error message will be send when the receiving slave device detects a problem with the incoming message. Examples: CRC error, message data is beyond limits, message format is not correct etc
- S->M: Slave to Master
- Slave to Master message will start with "RTR"
- The ID0..1 is the originating slave address. ID0 (ascii) is always the module type, ID1 (binary) is the ID number. For the HVAC module, the Module type is "H".
- CID (UINT8): This Byte contains the Communication ID. When the Gateway sends a request to the Master, the Gateway will add the communication ID (communication sequence). The Master will always answer the request of the Gateway with the same communication ID. CID is set between 1 and 255. When CID is set to 0, it is not used.
- Mode: Mode (ascii) can contain "G"=get, "S"=set in request (M->S), the answer (S->M) will contain the same Mode. "N" = No Ack or Error. In this Message, "N" will appear.
- Type0..2 is the instruction type (ascii). The instruction type consist of 3 ASCII characters
- Length (UINT8): Length (binary) of the data bytes. Maximum length: 32. Since this is an error message, length will be 5.
- ErrorType: ErrorType contains the Error category. See Energy Bus Error Codes.
- ErrorData: ErrorData contains the necessary Error Data points. See Energy Bus Error Codes.
- CRC (UINT8): CRC8 (binary) calculation of all bytes starting at ID0 till the last data byte (Byte0..12).
Instruction Set
Instructions in Live Mode
The Energy bus can be put in 2 modes:
- Live mode: The BB will scan all slave modules on a regular basis. The slave modules will only respond to messages of the BB.
- Init mode: In this mode, the BB will not scan the bus and will respond to messages of the slave Modules. This mode is used to initialise the slave modules on the bus.
Instruction AGT is used to switch between modes and can be used in Live and Init mode.
"AGT": Switch between Live and Init Mode
The Energy bus can be put in 2 modes:
- Live mode: The BB will scan all slave modules on a regular basis. The slave modules will only respond to messages of the BB.
- Init mode: In this mode, the BB will not scan the bus and will respond to messages of the slave Modules. This mode is used to initialise the slave modules on the bus
- Request M->S
'
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
STR |
ID0 |
ID1 |
CID |
S |
A |
G |
T |
Length |
Mode |
CRC |
13 |
10
|
- The ID0..1 is the destination slave address. Since this is a broadcast message, ID0 must be set at 'H' and ID1 must be set at 255.
- CID=0
- Byte3="S" -> Set
- Byte4..6="AGT" -> Instruction
- Length (UINT8)=1
- Mode (UINT8):
- Mode=1 -> Put bus in Init Mode
- Mode=0 -> Put bus in Live Mode
- CRC (UINT8): CRC8 calculation of Byte0..8
- Response S->M
The slaves will change mode but will not respond.
"BGT": Go to Bootloader
This instruction will do the following:
- Set in eeprom location 75 value 5 (5 seconds timeout)
- Reply to the Gateway
- reset the module so the module can enter bootload mode
- Request M->S
'
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
STR |
ID0 |
ID1 |
CID |
S |
B |
G |
T |
Length |
CRC |
13 |
10
|
- The ID0..1 is the destination slave address.
- Byte3="S" -> Set
- Byte4..6="BGT" -> Instruction
- Length (UINT8)=0
- CRC (UINT8): CRC8 calculation of Byte0..7
- Response S->M
'
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
RTR |
ID0 |
ID1 |
CID |
S |
B |
G |
T |
Length |
CRC |
13 |
10
|
- The ID0..1 is the originating slave address. ID0="H"
- Byte3="S" -> Set
- Byte4..6="BGT" -> Instruction
- Length (UINT8)=0
- CRC (UINT8): CRC8 calculation of Byte0..7
"EAC": Eeprom Activate
After using instruction "EEP", please use this instruction to activate (copy to RAM) the values written in eeprom.
- Request M->S
'
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
STR |
ID0 |
ID1 |
CID |
S |
E |
A |
C |
Length |
CRC |
13 |
10
|
- The ID0..1 is the destination slave address.
- Byte3="S" -> Set
- Byte4..6="EAC" -> Instruction
- Length (UINT8)=0
- CRC (UINT8): CRC8 calculation of Byte0..7
- Response S->M
'
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
RTR |
ID0 |
ID1 |
CID |
S |
E |
A |
C |
Length |
CRC |
13 |
10
|
- The response will be sent when the full copy from eeprom to RAM is finished so this could take a few 100ms
- The ID0..1 is the originating slave address. ID0="H"
- Byte3="S" -> Set
- Byte4..6="EAC" -> Instruction
- Length (UINT8)=0
- CRC (UINT8): CRC8 calculation of Byte0..7
"EEP": Eeprom HVAC instruction
This instruction will allow to read and write in the local Eeprom of the HVAC module. All configurations are stored in eeprom and can be read and modified by the gateway using instruction "EEP". The HVAC Memory Model contains all eeprom bytes in use and their explanation.
Read eeprom
- Request M->S
'
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
12
|
13
|
STR |
ID0 |
ID1 |
CID |
G |
E |
E |
P |
Length |
Eeprom_Address.MSB |
Eeprom_Address.LSB |
Nr_of_bytes |
CRC |
13 |
10
|
- The ID0..1 is the destination slave address. ID0="H"
- Byte3="G" -> Get
- Byte4..6="EEP" -> Instruction
- Length (UINT8)=3
- Eeprom_Address (UINT16): This is the address of the first byte of the eeprom to be read
- CRC (UINT8): CRC8 calculation of Byte0..10
- Nr_of_bytes (UINT8): Nr of bytes to be read (Minimum 1, maximum 16)
- Response S->M
'
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
...
|
11+Nr_of_bytes
|
12+Nr_of_bytes
|
13+Nr_of_bytes
|
RTR |
ID0 |
ID1 |
CID |
G |
E |
E |
P |
Length |
Eeprom_Address.MSB |
Eeprom_Address.LSB |
Nr_of_bytes |
Eeprom_Data |
... |
CRC |
13 |
10
|
- The ID0..1 is the originating slave address. ID0="H"
- Byte3="G" -> Get
- Byte4..6="EEP" -> Instruction
- Length (UINT8)=3+Nr_of_bytes
- Eeprom_Address (UINT16): This is the address of the first byte of the eeprom to be read
- Eeprom_Data (UINT8): These is the values read from eeprom @ address
- CRC (UINT8): CRC8 calculation of Byte0..10+Nr_of_bytes
- Nr_of_bytes (UINT8): Nr of bytes to be read (Minimum 1, maximum 16)
Write eeprom
- Request M->S
'
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
...
|
11+Nr_of_bytes
|
12+Nr_of_bytes
|
13+Nr_of_bytes
|
STR |
ID0 |
ID1 |
CID |
S |
E |
E |
P |
Length |
Eeprom_Address.MSB |
Eeprom_Address.LSB |
Nr_of_bytes |
Eeprom_Data |
... |
CRC |
13 |
10
|
- The ID0..1 is the destination slave address. ID0="H"
- Byte3="S" -> Set
- Byte4..6="EEP" -> Instruction
- Length (UINT8)=3+Nr_of_bytes
- Eeprom_Address (UINT16): This is the address of the first byte of the eeprom to be written
- Eeprom_Data (UINT8): These are the values to be written in eeprom @ address
- CRC (UINT8): CRC8 calculation of Byte0..10+Nr_of_bytes
- Nr_of_bytes (UINT8): Nr of bytes to be written (Minimum 1, maximum 16)
- When the different writes that needs to happen are done, please perform an eeprom activate (instruction "EAC")
- Response S->M
'
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
...
|
11+Nr_of_bytes
|
12+Nr_of_bytes
|
13+Nr_of_bytes
|
RTR |
ID0 |
ID1 |
CID |
S |
E |
E |
P |
Length |
Eeprom_Address.MSB |
Eeprom_Address.LSB |
Nr_of_bytes |
Eeprom_Data |
... |
CRC |
13 |
10
|
- The ID0..1 is the originating slave address. ID0="H"
- Byte3="S" -> Set
- Byte4..6="EEP" -> Instruction
- Length (UINT8)=3+Nr_of_bytes
- Eeprom_Address (UINT16): This is the address of the first byte of the eeprom to be read
- Eeprom_Data (UINT8): These is the values read from eeprom @ address
- CRC (UINT8): CRC8 calculation of Byte0..10+Nr_of_bytes
- Nr_of_bytes (UINT8): Nr of bytes to be read (Minimum 1, maximum 16)
"FIV": Request Firmware version
- Request M->S
'
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
STR |
ID0 |
ID1 |
CID |
G |
F |
I |
V |
Length |
CRC |
13 |
10
|
- The ID0..1 is the destination slave address.
- Byte3="G" -> Get
- Byte4..6="FIV" -> Instruction
- Length (UINT8)=0
- CRC (UINT8): CRC8 calculation of Byte0..7
- Response S->M
'
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
...
|
24
|
25
|
26
|
27
|
RTR |
ID0 |
ID1 |
CID |
G |
F |
I |
V |
Length |
Char0 |
... |
Char16 |
CRC |
13 |
10
|
- The ID0..1 is the originating slave address. ID0="H"
- Byte3="G" -> Get
- Byte4..6="FIV" -> Instruction
- Length (UINT8)=17
- Char0..16: This is the text field that contains module type and firmware version, example "OMFEY_3_1_2"
- CRC (UINT8): CRC8 calculation of Byte0..24
"FMW": Firmware/serial number instruction
This instruction will read the Firmware version and serial number.
Read Firmware
- Request M->S
'
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
STR |
ID0 |
ID1 |
CID |
G |
F |
M |
W |
Length |
CRC |
13 |
10
|
- The ID0..1 is the destination slave address. ID0="H"
- Byte3="G" -> Get
- Byte4..6="FMW" -> Instruction
- Length (UINT8)=0
- CRC (UINT8): CRC8 calculation of Byte0..7
- Response S->M
'
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
12
|
13
|
14
|
15
|
16
|
17
|
18
|
19
|
20
|
21
|
22
|
23
|
RTR |
ID0 |
ID1 |
CID |
G |
F |
M |
W |
Length |
Err |
Hw |
F1 |
F2 |
F3 |
Stat |
year |
Month |
Day |
Company |
Serial.MSB |
Serial.LSB |
Errors |
CRC |
13 |
10
|
- The ID0..1 is the originating slave address. ID0="H"
- Byte3="G" -> Get
- Byte4..6="FMW" -> Instruction
- Length (UINT8)=13
- Hw: Hardware version (binary) type
- F1, F2 and F3 (UINT8): Major firmware version, minor and built of the active code section (binary)
- Stat (UINT8): status (binary) of the application firmware code and the Total CRC. (0 if match, 1 if some mismatch) (only updated if the
FE
command is send)
- Err: Error code (binary) received from module in Bootloader, see Bootloader Error Codes
- See Bootloader for more information how the Bootloader of the Remote Modules works
- CRC (UINT8): CRC.Byte1 (MSB) and CRC.Byte0 (LSB): Sum of Byte0 to Byte18
- Year (UINT8): Testing year (binary) of this Module
- Month (UINT8): Testing Month (binary)
- Day (UINT8): Testing Day (binary)
- Company (UINT8): Production company (binary) that performed the testing (0: Openmotics, 1: Page, ...)
- Serial (UINT16): Serial.MSB & Serial.LSB: Serial number (binary)
- The full serial number is composed out of following elements: production date + production company + serial number
- Errors (UINT8): Number of errors (binary) that have been found during testing
- CRC (UINT8): CRC8 calculation of Byte0..20
"INP": Input/Sensor instruction
This instruction will read the different input values (like sensors, ADC, inputs etc) that are currently present. Writing is not possible.
ToDo: Input/sensor list to be added.
Read Input/Sensor information
- Request M->S
'
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
STR |
ID0 |
ID1 |
CID |
G |
I |
N |
P |
Length |
CRC |
13 |
10
|
- The ID0..1 is the destination slave address. ID0="H"
- Byte3="G" -> Get
- Byte4..6="INP" -> Instruction
- Length (UINT8)=0
- CRC (UINT8): CRC8 calculation of Byte0..7
- Response S->M
'
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
...
|
28
|
29
|
30
|
31
|
32
|
33
|
34
|
RTR |
ID0 |
ID1 |
CID |
G |
I |
N |
P |
Length |
Type |
Status |
input_value.MSB |
input_value.LSB |
... |
Type |
Status |
input_value.MSB |
input_value.LSB |
CRC |
13 |
10
|
- The return information will contain 6 input/sensor data
- The ID0..1 is the originating slave address. ID0="H"
- Byte3="G" -> Get
- Byte4..6="INP" -> Instruction
- Length (UINT8)=24
- Type: "T" (ascii) -> Temperature sensor, "A" (ascii) -> ADC
- "T": First 4 sensor data points
- "A": 5th and 6th data point
- Status (UINT8): 0 (binary) -> Not connected, 1 (binary) -> Connected
- input_value (UINT16): input, sensor or ADC value
- Type "T": only input_value.LSB used, temperature values are in System Value format
- Type "A": input_value.MSB & input_value.LSB used, value in mV
- CRC (UINT8): CRC8 calculation of Byte0..31
"OTP": Output instruction
This instruction will read/write the output status of the different outputs currently present.
Todo: Output list to be added
Read Output
- Request M->S
'
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
STR |
ID0 |
ID1 |
CID |
G |
O |
T |
P |
Length |
output_nr |
CRC |
13 |
10
|
- The ID0..1 is the destination slave address. ID0="H"
- Byte3="G" -> Get
- Byte4..6="OTP" -> Instruction
- Length (UINT8)=1
- output_nr (UINT8): This is the output_nr (binary, 0..7) of the output to be read
- CRC (UINT8): CRC8 calculation of Byte0..8
- Response S->M
'
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
12
|
13
|
14
|
RTR |
ID0 |
ID1 |
CID |
G |
O |
T |
P |
Length |
output_nr |
Type |
Status |
Dimmer_value |
CRC |
13 |
10
|
- The ID0..1 is the originating slave address. ID0="H"
- Byte3="G" -> Get
- Byte4..6="OTP" -> Instruction
- Length (UINT8)=4
- output_nr (UINT8): This is the output_nr (binary) of the output to be read
- Type: "R" (ascii) -> Relay output, "D" (ascii) -> Dimmed 0-10V output
- Status (UINT8): 0 (binary) -> Output OFF, 1 (binary) -> Output ON
- Dimmer_value (UINT8): 0-255
- CRC (UINT8): CRC8 calculation of Byte0..11
Write Output
- Request M->S
'
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
12
|
13
|
STR |
ID0 |
ID1 |
CID |
S |
O |
T |
P |
Length |
output_nr |
Status |
Dimmer_value |
CRC |
13 |
10
|
- The ID0..1 is the destination slave address. ID0="H"
- Byte3="S" -> Set
- Byte4..6="OTP" -> Instruction
- Length (UINT8)=3
- output_nr (UINT8): This is the output_nr (binary) of the output to be read
- Status (UINT8): 0 (binary) -> Output OFF, 1 (binary) -> ON
- Dimmer_value (UINT8): 0-255
- CRC (UINT8): CRC8 calculation of Byte0..10
- Response S->M
'
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
12
|
13
|
14
|
RTR |
ID0 |
ID1 |
CID |
S |
O |
T |
P |
Length |
output_nr |
Type |
Status |
Dimmer_value |
CRC |
13 |
10
|
- The ID0..1 is the originating slave address. ID0="H"
- Byte3="S" -> Set
- Byte4..6="OTP" -> Instruction
- Length (UINT8)=4
- output_nr (UINT8): This is the output_nr (binary) of the output to be read
- Type: "R" (ascii) -> Relay output, "D" (ascii) -> Dimmed 0-10V output
- Status (UINT8): 0 (binary) -> Output OFF, 1 (binary) -> Output ON
- Dimmer_value (UINT8): 0-255
- CRC (UINT8): CRC8 calculation of Byte0..11
"PID": PID instruction
This instruction will read the active information of a PID filter. Writing is not possible.
Read PID information
- Request M->S
'
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
STR |
ID0 |
ID1 |
CID |
G |
P |
I |
D |
Length |
pid_nr |
CRC |
13 |
10
|
- The ID0..1 is the destination slave address. ID0="H"
- Byte3="G" -> Get
- Byte4..6="PID" -> Instruction
- Length (UINT8)=1
- pid_nr (UINT8): This is the pid_nr (binary) of the PID filter information to be read
- CRC (UINT8): CRC8 calculation of Byte0..8
- Response S->M
'
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
12
|
13
|
14
|
15
|
16
|
17
|
18
|
19
|
20
|
21
|
22
|
23
|
24
|
25
|
26
|
27
|
28
|
RTR |
ID0 |
ID1 |
CID |
G |
P |
I |
D |
Length |
pid_nr |
Status |
H/C |
Sensor_nr |
Temp |
Setpoint |
Error.MSB |
Error.LSB |
P.MSB |
P.LSB |
I.MSB |
I.LSB |
D.MSB |
D.LSB |
PID_calc.MSB |
PID_calc.LSB |
Output_nr |
Output_value |
CRC |
13 |
10
|
- The ID0..1 is the originating slave address. ID0="H"
- Byte3="G" -> Get
- Byte4..6="PID" -> Instruction
- Length (UINT8)=18
- pid_nr (UINT8): This is the pid_nr (binary) of the PID filter to be read
- HVAC module has standard 2 pid's (0 & 1, binary) that can be used
- Status (UINT8): PID_nr is enabled (=1,binary) or disabled (=0,binary)
- H/C (UINT8): H/C=0 (binary) -> Heating, H/C=1 (binary) -> Cooling
- Sensor_nr (UINT8): Sensor_nr (binary) that is linked to pid_nr
- Temp (UINT8): Temperature (binary) of the sensor_nr that has been configured
- Setpoint (UINT8): Temperature setpoint (binary) of Sensor_nr
- All temperature values are in System Value format
- Error (SINT16): Calculated PID Error (binary)
- P, I & D (SINT16): Individual Calculated PID results (binary)
- PID_cal (SINT16): Total PID results (binary)
- Output_nr (UINT8): HVAC output (binary) used for pid_nr
- Output_value (UINT8): HVAC output value (binary) of output_nr
- CRC (UINT8): CRC8 calculation of Byte0..23
"SPT": Setpoint instruction
This instruction will allow to read and write the Temperature setpoint of the HVAC module. Each PID routine needs a setpoint.
Read Setpoint
- Request M->S
'
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
STR |
ID0 |
ID1 |
CID |
G |
S |
P |
T |
Length |
pid_nr |
CRC |
13 |
10
|
- The ID0..1 is the destination slave address. ID0="H"
- Byte3="G" -> Get
- Byte4..6="SPT" -> Instruction
- Length (UINT8)=1
- pid_nr (UINT8): This is the pid_nr (binary) of the temperature setpoint to be read
- CRC (UINT8): CRC8 calculation of Byte0..8
- Response S->M
'
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
12
|
13
|
RTR |
ID0 |
ID1 |
CID |
G |
S |
P |
T |
Length |
pid_nr |
Setpoint |
H/C |
CRC |
13 |
10
|
- The ID0..1 is the originating slave address. ID0="H"
- Byte3="G" -> Get
- Byte4..6="SPT" -> Instruction
- Length (UINT8)=3
- pid_nr (UINT8): This is the pid_nr (binary) of the temperature setpoint to be read
- Setpoint (UINT8): This is the current temperature setpoint used by pid_nr. Temperature is in System Value.
- H/C (UINT8): H/C=0 (binary) -> Heating, H/C=1 (binary) -> Cooling
- CRC (UINT8): CRC8 calculation of Byte0..10
Write Setpoint
- Request M->S
'
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
12
|
13
|
STR |
ID0 |
ID1 |
CID |
S |
S |
P |
T |
Length |
pid_nr |
Setpoint |
H/C |
CRC |
13 |
10
|
- The ID0..1 is the destination slave address. ID0="H"
- Byte3="S" -> Set
- Byte4..6="SPT" -> Instruction
- Length (UINT8)=3
- pid_nr (UINT8): This is the pid_nr (binary) of the temperature setpoint to be written
- Setpoint (UINT8): This is the requested temperature setpoint used by pid_nr. Temperature is in System Value.
- H/C (UINT8): H/C=0 (binary) -> Heating, H/C=1 (binary) -> Cooling
- CRC (UINT8): CRC8 calculation of Byte0..10
- Note: When changing the Mode (from heating to cooling for example) will change the mode but the setpoint will be automatically set to the default setpoint. A second SPT call must be done to set the correct setpoint.
- Response S->M
'
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
12
|
13
|
RTR |
ID0 |
ID1 |
CID |
S |
S |
P |
T |
Length |
pid_nr |
Setpoint |
H/C |
CRC |
13 |
10
|
- The ID0..1 is the originating slave address. ID0="H"
- Byte3="S" -> Set
- Byte4..6="SPT" -> Instruction
- Length (UINT8)=3
- pid_nr (UINT8): This is the pid_nr (binary) of the temperature setpoint to be read
- Setpoint (UINT8): This is the current temperature setpoint used by pid_nr. Temperature is in System Value.
- H/C (UINT8): H/C=0 (binary) -> Heating, H/C=1 (binary) -> Cooling
- CRC (UINT8): CRC8 calculation of Byte0..10
"PST": Power Status instruction
This instruction will read the Power Status of the HVAC module. This instruction is not yet implemented.
Read Power Information
- Request M->S
'
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
STR |
ID0 |
ID1 |
CID |
G |
P |
S |
T |
Length |
CRC |
13 |
10
|
- The ID0..1 is the destination slave address. ID0="H"
- Byte3="G" -> Get
- Byte4..6="PST" -> Instruction
- Length (UINT8)=0
- CRC (UINT8): CRC8 calculation of Byte0..7
- Response S->M
'
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
12
|
13
|
14
|
RTR |
ID0 |
ID1 |
CID |
G |
P |
S |
T |
Length |
Voltage |
Current |
Status1 |
Status2 |
CRC |
13 |
10
|
- The ID0..1 is the originating slave address. ID0="H"
- Byte3="G" -> Get
- Byte4..6="FMW" -> Instruction
- Length (UINT8)=4
- Voltage: Voltage of OpenMotics Bus (UINT8, Per V, 255=255V)
- Current: Current of OpenMotics Bus (UINT8, Per 10mA, 255=2,55A)
- Status1: Status of the OpenMotics Bus (0: No voltage detected, 1: Voltage 24VDC OK)
- Status2: Status of the 230VAC PS (0: No voltage detected, 1: Voltage 230VAC OK)
- CRC (UINT8): CRC8 calculation of Byte0..20
Instructions in Init Mode
The Energy bus can be put in 2 modes:
- Live mode: The BB will scan all slave modules on a regular basis. The slave modules will only respond to messages of the BB.
- Init mode: In this mode, the BB will not scan the bus and will respond to messages of the slave Modules. This mode is used to initialise the slave modules on the bus
Instruction AGT is used to switch between modes and can be used in Live and Init mode.
"AGT": Switch between Live and Init Mode
The Energy bus can be put in 2 modes:
- Live mode: The BB will scan all slave modules on a regular basis. The slave modules will only respond to messages of the BB.
- Init mode: In this mode, the BB will not scan the bus and will respond to messages of the slave Modules. This mode is used to initialise the slave modules on the bus
- Request M->S
'
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
STR |
ID0 |
ID1 |
CID |
S |
A |
G |
T |
Length |
Mode |
CRC |
13 |
10
|
- The ID0..1 is the destination slave address. Since this is a broadcast message, ID0 must be set at 'H' and ID1 must be set at 255.
- Byte3="S" -> Set
- Byte4..6="AGT" -> Instruction
- Length (UINT8)=1
- Mode:
- Mode="I" -> Put bus in Init Mode
- Mode="L" -> Put bus in Live Mode
- CRC (UINT8): CRC8 calculation of Byte0..8
- Response S->M
The slaves will change mode but will not respond.
"HAD": I'm existing and Have an address
This message is only sent from an existing slave module when the bus is in Init mode and the Init button is pressed.
- Request S->M
'
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
...
|
23
|
24
|
25
|
26
|
RTR |
ID0 |
ID1 |
CID |
S |
H |
A |
D |
Length |
Data0 |
... |
Data15 |
CRC |
13 |
10
|
- The ID0..1 is the originating slave address. ID0="H"
- CID=0: Since this message is not a response to a BB request, CID=0
- Byte3="S" -> Set
- Byte4..6="HAD" -> Instruction
- Length (UINT8)=16
- Data0..15: Contains the ascii representation of the Module type and firmware version
- CRC (UINT8): CRC8 calculation of Byte0..23
- Response M->S
No response
"WAD": I'm new and want an address, "SAD" response
This message is only sent from a new (not yet initialised) slave module when the bus is in Init mode and the Init button is pressed. The BB will respond with instruction "SAD" to set the address.
- Request S->M
'
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
...
|
23
|
24
|
25
|
26
|
RTR |
ID0 |
ID1 |
CID |
S |
W |
A |
D |
Length |
Data0 |
... |
Data15 |
CRC |
13 |
10
|
- The ID0..1 is the originating slave address. ID0="H" is the module type, ID1 is the current ID (Default address for New modules is 240).
- CID=0: Since this message is not a response to a BB request, CID=0
- Byte3="S" -> Set
- Byte4..6="WAD" -> Instruction
- Length (UINT8)=16
- Data0..15: Contains the ascii representation of the Module type and firmware version
- CRC (UINT8): CRC8 calculation of Byte0..23
- Response M->S
'
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
STR |
ID0 |
ID1 |
CID |
S |
S |
A |
D |
Length |
New_ID |
CRC |
13 |
10
|
- The ID0..1 is the destination slave address. ID0="H", ID1 is the proposed address of the slave module
- Byte3="S" -> Set
- Byte4..6="SAD" -> Instruction: Set Address
- Length (UINT8)=1
- New_ID (UINT8): This is the new ID (ID1) that can be programmed in the Eeprom of the slave module. From this point on, this module is an existing module.
- CRC (UINT8): CRC8 calculation of Byte0..8
- Response S->M
'
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
RTR |
ID0 |
ID1 |
CID |
S |
S |
A |
D |
Length |
New_ID |
CRC |
13 |
10
|
- The ID0..1 is the destination slave address. ID0="H", ID1 is the new address of the slave module (so ID0=New_Id)
- Byte3="S" -> Set
- Byte4..6="SAD" -> Instruction: Set Address
- Length (UINT8)=1
- New_ID (UINT8): This is the new ID (ID1) requested by the BB.
- CRC (UINT8): CRC8 calculation of Byte0..8