House API

Trunet's Place - Portfolio
Jump to: navigation, search

I know this info can be used against me. You can hack my house LOL!

PC

Get

Request Byte Answer Type
0x01 Current timestamp from NTP server long (4 bytes)

TrunetClock

Get

Request Byte Answer Type
0x01 Timestamp from DS3231 RTC long (4 bytes)
0x02 Temperature from DS3231 RTC float (4 bytes)

Set

Set Byte Description Type Example
0x50 Set DS3231 using timestamp long (4-bytes) -
0x51 Save message X on memory Message Packet -
0x52 Scrool control Scrolling Packet -
0x53 Show Date/Time/Temp Date/Time/Temp Packet -
0x54 Set display brightness (0-15) 1 Byte -
0x55 Set timezone (-12 to 12) 1 Byte 0xFD = GMT-03
0x56 Set temp? Temp Packet -

Message Packet

Bit D7 D6 D5 D4 D3 D2 D1 D0
Options - - - - Persistent? Save Message N D2 Save Message N D1 Save Message N D0
char up to 99 byte byte byte byte byte byte byte byte

Save Message N - The clocks has 6 possible(0-5) messages to be stored on RAM(D3 = 0) or EEPROM(D3 = 1). This 3-bits are used to tell in what N message will be saved.

Scrolling Packet

Bit D7 D6 D5 D4 D3 D2 D1 D0
Options Line Options Scroll? Line Green Line Red Message D2 Message D1 Message D0 Line

Line: 0 - Row 1
Line: 1 - Row 2

Line Option: 0 - Scroll Forever
Line Option: 1 - Scroll One Time

Date/Time/Temp Packet

Bit D7 D6 D5 D4 D3 D2 D1 D0
Options Date/Temp Swap D2 Date/Temp Swap D1 Date/Temp Swap D0 Row Time Green Time Red Date Green Date Red

Row: 0 - Print on ROW 1
Row: 1 - Print on ROW 2

Date/Temp Swap - Time to swap date with temp using 3-bits. 0 keeps date forever. 1-7 swap each X seconds.

Temp Packet

Bit D7 D6 D5 D4 D3 D2 D1 D0
Float first 8-bits byte byte byte byte byte byte byte byte
Float 8-bits byte byte byte byte byte byte byte byte
Float 8-bits byte byte byte byte byte byte byte byte
Float last 8-bits byte byte byte byte byte byte byte byte

Defaults to and If all is set to 0, it gets from DS3231 RTC that has temp embedded.

Energy Monitor

Get

Request Byte Answer Type
0x01 EMon Packet (all data) EMon Packet
0x02 Voltage float (4 bytes)
0x03 Amperage float (4 bytes)
0x04 Power Factor float (4 bytes)
0x05 Real Power float (4 bytes)
0x06 Apparent Power float (4 bytes)

EMon Packet

Bit D7 D6 D5 D4 D3 D2 D1 D0
Data 1 Apparent Power D3 Apparent Power D2 Apparent Power D1 Apparent Power D0 Real Power D3 Real Power D2 Real Power D1 Real Power D0
Data 2 Voltage D3 Voltage D2 Voltage D1 Voltage D0 Amperage D3 Amperage D2 Amperage D1 Amperage D0
Data 3 - - - - Power Factor D3 Power Factor D2 Power Factor D1 Power Factor D0

Set

Set Byte Description Type Example
0x51 Voltage Calibration float (4 bytes) 0.270418
0x52 Amperage Calibration float (4 bytes) 0.170732
0x53 Phasecal Calibration float (4 bytes) 2.3
0x54 Auto send delay int (2 bytes) 0x0A (auto send each 10 seconds)
0x55 Auto send XBee address 8 bytes(64 bits)
0x00 to disable auto-send
0x00 0x13 0xA2 0x00 0x40 0x66 0x5D 0xB3

Weather Station

Get

Request Byte Answer Type
0x01 Weather Packet (all data) Weather Packet
0x02 Barometer Pressure float (4 bytes)
0x03 Barometer Temperature float (4 bytes)
0x04 Humidity float (4 bytes)
0x05 Humidity Temperature float (4 bytes)
0x06 Luminosity int (2 bytes)
0x07 Battery Voltage float (4 bytes)
0x08 Solar Panel Voltage float (4 bytes)
0x09 Wind Direction 2 x char (1 byte each)
0x10 Wind Speed float (4 bytes)
0x11 Precipitation float (4 bytes)

Weather Packet

All data of above table.

Set

Set Byte Description Type Example
0x51 Auto send delay int (2 bytes) 0x0A (auto send each 10 seconds)
0x52 Auto send XBee address 8 bytes(64 bits)
0x00 to disable auto-send
0x00 0x13 0xA2 0x00 0x40 0x66 0x5D 0xB3
0x53 Barometer Calibration Barometer Calibration Packet -

Barometer Calibration Packet

This is used to calibrate barometer using QFE(Altitude above ground level) or QNH(Barometric pressure adjusted to sea level).

Bit D7 D6 D5 D4 D3 D2 D1 D0
Options - - - - - - - QNH/QFE
Long first 8-bits byte byte byte byte byte byte byte byte
Long 8-bits byte byte byte byte byte byte byte byte
Long 8-bits byte byte byte byte byte byte byte byte
Long last 8-bits byte byte byte byte byte byte byte byte

QNH/QFE: 0 - QNH
QNH/QFE: 1 - QFE