From d5d81ab445ce65649e2fde6d2fa39b56bd5bc29e Mon Sep 17 00:00:00 2001 From: rwalker777 <49888088+rwalker777@users.noreply.github.com> Date: Sat, 2 May 2026 13:14:27 -0500 Subject: [PATCH] Refine GoldenMate UPS protocol documentation Updated protocol description and field mappings for GoldenMate UPS. --- components/ups_hid/protocol_goldenmate.h | 36 +++++++++++------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/components/ups_hid/protocol_goldenmate.h b/components/ups_hid/protocol_goldenmate.h index bc36a55..a5e6db6 100644 --- a/components/ups_hid/protocol_goldenmate.h +++ b/components/ups_hid/protocol_goldenmate.h @@ -6,29 +6,25 @@ namespace esphome { namespace ups_hid { /** - * GoldenMate / BMS Smart-Battery HID Protocol + * GoldenMate LiFePO4 UPS Protocol * - * Vendor: 0x06DA (-BMS-), Product: 0xFFFF (Smart-Battery) - * Used by GoldenMate 1000VA Pro and similar BMS-based UPS units. + * Vendor: 0x075D, Product: UPS Pro + * Used by GoldenMate UPS with USB port. * * Data sources: - * Report 0x01 (Feature, 21 bytes) - binary status: - * byte 11: battery % (0-100) - * bytes 12-13 LE16: runtime to empty (seconds) - * byte 16: nominal input voltage (static) - * byte 20: temperature (°C, BMS internal) + * Report 0x01 (Feature, 21 bytes) - binary status: + * byte 11: battery % (0-100) + * bytes 12-13 LE16: runtime to empty (seconds) * - * Report 0x0C (Feature, 65 bytes) - contains packed Megatec ASCII at bytes 30-61: - * "LLLL FFFF OOOO BBB FFF VVV TTT SSSSSSSS" - * Field 1 (4 chars): Load % × 10 (e.g., "0107" = 10.7%) - * Field 2 (4 chars): Low voltage transfer (e.g., "1400" = 140.0V) - * Field 3 (4 chars): High voltage transfer (e.g., "2084" = 208.4V) - * Field 4 (3 chars): Battery % (e.g., "099" = 99%) - * Field 5 (3 chars): Frequency × 10 (e.g., "599" = 59.9 Hz) - * Field 6 (3 chars): Battery voltage × 100 (e.g., "205" = 2.05V) - * Field 7 (3 chars): Temperature × 10 (e.g., "350" = 35.0°C) - * Field 8 (8 chars): Status bits ("01000000" = on battery) - * bit 6: on battery (1 = AC lost) + * Report 0x0C (Feature, 64+ bytes) - contains packed BMS ASCII at bytes 30-61: + * Field 1 (4 chars): Current × 100 (e.g., "1491" = 14.91 A) -> mapped to load_percent + * Field 2 (4 chars): Voltage × 100 (e.g., "1400" = 14.00 V) -> mapped to battery.voltage + * Field 3 (4 chars): Power × 10 (e.g., "2084" = 208.4 W) -> mapped to input_voltage + * Field 4 (3 chars): SOC % (e.g., "100" = 100 %) -> mapped to battery.level + * Field 5 (3 chars): Capacity Ah × 10 (e.g., "599" = 59.9 Ah) -> mapped to frequency + * Field 6 (3 chars): Cycles (e.g., "205" = 205) -> mapped to output_voltage + * Field 7 (3 chars): Temp × 10 (e.g., "350" = 35.0 °C) -> mapped to input_transfer_low + * Field 8 (8 chars): Status bits */ class GoldenMateProtocol : public UpsProtocolBase { public: @@ -38,7 +34,7 @@ class GoldenMateProtocol : public UpsProtocolBase { bool initialize() override; bool read_data(UpsData &data) override; DeviceInfo::DetectedProtocol get_protocol_type() const override { return DeviceInfo::PROTOCOL_GENERIC_HID; } - std::string get_protocol_name() const override { return "GoldenMate BMS"; } + std::string get_protocol_name() const override { return "GoldenMate"; } private: static const uint8_t REPORT_ID_STATUS = 0x01;