Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions lib/Hoymiles/src/commands/AlarmDataCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,21 @@ Derives from MultiDataCommand

Command structure:
* DT: this specific command uses 0x11
* AlarmId: The last event id received from the inverter or zero in case that no events
has been received yet. --> Not Implemented yet
* Sel: sub-selector byte. Unused for 0x11, send 0x00.
* Time: unix time. If it differs from the inverter clock by 5 s or more, the inverter
re-syncs its clock and shifts the stored event times by the difference.
* Gap: averaging interval in minutes for the interval record. 0 keeps the current interval
(default 15 min).
* AlarmId: the SeqIdx of the last event already received. The inverter returns only entries
whose SeqIdx is greater; 0 returns the whole log. On the first request after inverter boot
it continues its event numbering from AlarmId. --> Not implemented here (always sent as 0)

00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
-----------------------------------------------------------------------------------------------------------------------
|<------------------- CRC16 --------------------->|
15 71 60 35 46 80 12 23 04 80 11 00 65 72 06 B8 00 00 00 00 00 00 00 00 00 00 00 -- -- -- -- --
^^ ^^^^^^^^^^^ ^^^^^^^^^^^ ^^ ^^ ^^ ^^^^^^^^^^^ ^^^^^ ^^^^^ ^^^^^^^^^^^ ^^^^^ ^^
ID Target Addr Source Addr Idx DT ? Time Gap AlarmId Password CRC16 CRC8
ID Target Addr Source Addr Idx DT Sel Time Gap AlarmId Password CRC16 CRC8
*/
#include "AlarmDataCommand.h"
#include "inverters/InverterAbstract.h"
Expand Down
14 changes: 9 additions & 5 deletions lib/Hoymiles/src/commands/MultiDataCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,23 @@ Command structure:
* Idx: the counter of sequencial packages to send. Currently it's only 0x80
because all request requests only consist of one package.
* DT: repressents the data type and specifies which sub-command to be fetched
* Time: represents the current unix timestamp as hex format. The time on the inverter is synced to the sent time.
* Sel: sub-selector byte. Parsed for every request, used only for DT 0xFF (hidden selector).
0x00 for all other DTs.
* Time: represents the current unix timestamp as hex format. If it differs from the inverter clock
by 5 s or more, the inverter re-syncs its clock and shifts the stored event times by the difference.
Can be calculated e.g. using the following command
echo "obase=16; $(date --date='2023-12-07 18:54:00' +%s)" | bc
* Gap: always 0x0
* Password: currently always 0x0
* Gap: averaging interval in minutes for the interval record. 0 keeps the current interval
(default 15 min).
* Password: not read by the inverter's request parser, currently always 0x0
* CRC16: calcuclated over the highlighted amount of bytes

00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
-----------------------------------------------------------------------------------------------------------------------
|<------------------- CRC16 --------------------->|
15 71 60 35 46 80 12 23 04 80 00 00 65 72 06 B8 00 00 00 00 00 00 00 00 00 00 00 -- -- -- -- --
^^ ^^^^^^^^^^^ ^^^^^^^^^^^ ^^ ^^ ^^ ^^^^^^^^^^^ ^^^^^ ^^^^^^^^^^^ ^^^^^ ^^
ID Target Addr Source Addr Idx DT ? Time Gap Password CRC16 CRC8
^^ ^^^^^^^^^^^ ^^^^^^^^^^^ ^^ ^^ ^^ ^^^^^^^^^^^ ^^^^^ ^^^^^ ^^^^^^^^^^^ ^^^^^ ^^
ID Target Addr Source Addr Idx DT Sel Time Gap Password CRC16 CRC8
*/
#include "MultiDataCommand.h"
#include "crc.h"
Expand Down
21 changes: 14 additions & 7 deletions lib/Hoymiles/src/parser/AlarmLogParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ Data structure:
* wcode:
* right 12 bit (bits 0-11): Event ID
* bit 13: Start time = PM (12h has to be added to start time)
* bit 12: End time = PM (12h has to be added to start time)
* bit 12: End time = PM (12h has to be added to end time)
* Start: 12h based start time of the event (PM indicator in wcode)
* End: 12h based start time of the event (PM indicator in wcode)
* End: 12h based end time of the event (PM indicator in wcode)

00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
00 01 02 03 04 05 06 07 08 09 10 11
|<-------------- First log entry -------------->| |<->|
-----------------------------------------------------------------------------------------------------------------------------
95 80 14 82 66 80 14 33 28 01 00 01 80 01 00 01 91 EA 91 EA 00 00 00 00 00 8F 65 -- -- -- -- --
^^ ^^^^^^^^^^^ ^^^^^^^^^^^ ^^ ^^^^^ ^^^^^ ^^^^^ ^^^^^ ^^ ^^ ^^ ^^ ^^^^^ ^^
ID Source Addr Target Addr Idx ? wcode ? Start End ? ? ? ? wcode CRC8
ID Source Addr Target Addr Idx Count wcode SeqIdx Start End Data (2 words) CRC16 CRC8
*/
#include "AlarmLogParser.h"
#include <cstring>
Expand All @@ -34,6 +34,7 @@ const std::array<const AlarmMessage_t, ALARM_MSG_COUNT> AlarmLogParser::_alarmMe
{ AlarmMessageType_t::ALL, 2, "Time calibration", "Zeitabgleich", "" },
{ AlarmMessageType_t::ALL, 3, "EEPROM reading and writing error during operation", "", "" },
{ AlarmMessageType_t::ALL, 4, "Offline", "Offline", "Non connecté" },
{ AlarmMessageType_t::ALL, 5, "Internal communication error (SCI , DSP-radio link)", "Interner Kommunikationsfehler (SCI, DSP-Funkmodul)", "Erreur de communication interne (SCI, liaison DSP-module radio)" },

{ AlarmMessageType_t::ALL, 11, "Grid voltage surge", "Netz: Überspannungsimpuls", "" },
{ AlarmMessageType_t::ALL, 12, "Grid voltage sharp drop", "Netz: Spannungseinbruch", "" },
Expand All @@ -43,10 +44,12 @@ const std::array<const AlarmMessage_t, ALARM_MSG_COUNT> AlarmLogParser::_alarmMe

{ AlarmMessageType_t::ALL, 36, "INV overvoltage or overcurrent", "", "" },

{ AlarmMessageType_t::ALL, 46, "FB overvoltage", "FB Überspannung", "" },
{ AlarmMessageType_t::ALL, 47, "FB overcurrent", "FB Überstrom", "" },
{ AlarmMessageType_t::ALL, 48, "FB clamp overvoltage", "", "" },
{ AlarmMessageType_t::ALL, 49, "FB clamp overvoltage", "", "" },
{ AlarmMessageType_t::ALL, 46, "FB-A: overcurrent", "FB-A: Überstrom", "" },
{ AlarmMessageType_t::ALL, 47, "FB-B: overcurrent", "FB-B: Überstrom", "" },
{ AlarmMessageType_t::ALL, 48, "FB-A: clamp overvoltage", "FB-A: Klemm-Überspannung", "" },
{ AlarmMessageType_t::ALL, 49, "FB-B: clamp overvoltage", "FB-B: Klemm-Überspannung", "" },
{ AlarmMessageType_t::ALL, 50, "FB-C: overcurrent", "FB-C: Überstrom", "" },
{ AlarmMessageType_t::ALL, 51, "FB-C: clamp overvoltage", "FB-C: Klemm-Überspannung", "" },

{ AlarmMessageType_t::ALL, 61, "Calibration parameter error", "", "" },
{ AlarmMessageType_t::ALL, 62, "System configuration parameter error", "", "" },
Expand All @@ -55,6 +58,8 @@ const std::array<const AlarmMessage_t, ALARM_MSG_COUNT> AlarmLogParser::_alarmMe
{ AlarmMessageType_t::ALL, 71, "Grid overvoltage load reduction (VW) function enable", "", "" },
{ AlarmMessageType_t::ALL, 72, "Power grid over-frequency load reduction (FW) function enable", "", "" },
{ AlarmMessageType_t::ALL, 73, "Over-temperature load reduction (TW) function enable", "", "" },
{ AlarmMessageType_t::ALL, 74, "Load reduction curve 2 function enable", "", "" },
{ AlarmMessageType_t::ALL, 75, "Load reduction curve 3 function enable", "", "" },

{ AlarmMessageType_t::ALL, 95, "PV-1: Module in suspected shadow", "", "" },
{ AlarmMessageType_t::ALL, 96, "PV-2: Module in suspected shadow", "", "" },
Expand Down Expand Up @@ -133,7 +138,9 @@ const std::array<const AlarmMessage_t, ALARM_MSG_COUNT> AlarmLogParser::_alarmMe

{ AlarmMessageType_t::ALL, 309, "Hardware error code 309", "Hardwarefehlercode 309", "" },
{ AlarmMessageType_t::ALL, 310, "Hardware error code 310", "Hardwarefehlercode 310", "" },
{ AlarmMessageType_t::HMT, 310, "FB-C: overcurrent protection failure", "FB-C: Überstromschutz-Fehler", "" },
{ AlarmMessageType_t::ALL, 311, "Hardware error code 311", "Hardwarefehlercode 311", "" },
{ AlarmMessageType_t::HMT, 311, "FB-C: clamp circuit failure", "FB-C: Klemmschaltungs-Fehler", "" },
{ AlarmMessageType_t::ALL, 312, "Hardware error code 312", "Hardwarefehlercode 312", "" },
{ AlarmMessageType_t::ALL, 313, "Hardware error code 313", "Hardwarefehlercode 313", "" },
{ AlarmMessageType_t::ALL, 314, "Hardware error code 314", "Hardwarefehlercode 314", "" },
Expand Down
2 changes: 1 addition & 1 deletion lib/Hoymiles/src/parser/AlarmLogParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#define ALARM_LOG_ENTRY_SIZE 12
#define ALARM_LOG_PAYLOAD_SIZE (ALARM_LOG_ENTRY_COUNT * ALARM_LOG_ENTRY_SIZE + 4)

#define ALARM_MSG_COUNT 133
#define ALARM_MSG_COUNT 140

struct AlarmLogEntry_t {
uint16_t MessageId;
Expand Down
Loading