From 216ae4e8952cbbec584a9df338a8567027c141d7 Mon Sep 17 00:00:00 2001 From: David Rapan Date: Tue, 17 Dec 2024 08:15:42 +0100 Subject: [PATCH] feat: Add Today's and Total Generation - Deye --- .../inverter_definitions/deye_hybrid.yaml | 34 ++++++++- .../inverter_definitions/deye_p3.yaml | 72 +++++++++++++------ 2 files changed, 82 insertions(+), 24 deletions(-) diff --git a/custom_components/solarman/inverter_definitions/deye_hybrid.yaml b/custom_components/solarman/inverter_definitions/deye_hybrid.yaml index 0b02036..c326c0d 100644 --- a/custom_components/solarman/inverter_definitions/deye_hybrid.yaml +++ b/custom_components/solarman/inverter_definitions/deye_hybrid.yaml @@ -528,6 +528,26 @@ parameters: validation: min: 0.1 + - name: "Today Generation" + class: "energy" + state_class: "total_increasing" + uom: "kWh" + scale: 0.1 + rule: 1 + registers: [0x003E] + icon: "mdi:generator-stationary" + + - name: "Total Generation" + class: "energy" + state_class: "total_increasing" + uom: "kWh" + scale: 0.1 + rule: 3 + registers: [0x005C, 0x005F] + icon: "mdi:generator-stationary" + validation: + min: 0.1 + - name: "Today Production" friendly_name: Today's Production class: "energy" @@ -560,10 +580,11 @@ parameters: rule: 1 digits: 1 scale: 0.1 - registers: [0x004C, 0x006C, 0x0047, 0x004D, 0x0046, 0x0054] + registers: [0x004C, 0x003E, 0x006C, 0x0047, 0x004D, 0x0046, 0x0054] uint: enforce sensors: - registers: [0x004C] + - registers: [0x003E] - registers: [0x006C] - registers: [0x0047] - operator: subtract @@ -586,6 +607,8 @@ parameters: [ 0x004E, 0x0050, + 0x005C, + 0x005F, 0x0060, 0x0061, 0x004A, @@ -600,6 +623,7 @@ parameters: uint: enforce sensors: - registers: [0x004E, 0x0050] + - registers: [0x005C, 0x005F] - registers: [0x0060, 0x0061] - registers: [0x004A, 0x004B] - operator: subtract @@ -1018,6 +1042,14 @@ parameters: rule: 1 registers: [0x00A6] + - name: "Generator Voltage" + name_lookup: "io_mode_select" + class: "voltage" + state_class: "measurement" + uom: "V" + rule: 1 + registers: [0x00B5] + - name: "Generator Frequency" name_lookup: "io_mode_select" state_class: "measurement" diff --git a/custom_components/solarman/inverter_definitions/deye_p3.yaml b/custom_components/solarman/inverter_definitions/deye_p3.yaml index 2d5b37c..68997b0 100644 --- a/custom_components/solarman/inverter_definitions/deye_p3.yaml +++ b/custom_components/solarman/inverter_definitions/deye_p3.yaml @@ -1656,6 +1656,50 @@ parameters: validation: min: 0.1 + - name: Today Generation + alt: Daily Generation + friendly_name: Today's Production + class: "energy" + state_class: "total_increasing" + uom: "kWh" + scale: 0.1 + rule: 1 + registers: [0x01F5] + icon: "mdi:generator-stationary" + + - name: "Total Generation" + class: "energy" + state_class: "total_increasing" + uom: "kWh" + scale: 0.1 + rule: 3 + registers: [0x01F8, 0x01F9] + icon: "mdi:generator-stationary" + validation: + min: 0.1 + + - name: Today Production + alt: Daily Production + friendly_name: Today's Production + class: "energy" + state_class: "total_increasing" + uom: "kWh" + scale: 0.1 + rule: 1 + registers: [0x0211] + icon: "mdi:solar-power" + + - name: "Total Production" + class: "energy" + state_class: "total_increasing" + uom: "kWh" + scale: 0.1 + rule: 3 + registers: [0x0216, 0x0217] + icon: "mdi:solar-power" + validation: + min: 0.1 + - name: Today Losses alt: Daily Losses friendly_name: Today's Losses @@ -1667,9 +1711,10 @@ parameters: rule: 1 digits: 1 scale: 0.1 - registers: [0x0208, 0x0211, 0x0203, 0x0209, 0x020E, 0x0202] + registers: [0x01F5, 0x0208, 0x0211, 0x0203, 0x0209, 0x020E, 0x0202] uint: enforce sensors: + - registers: [0x01F5] - registers: [0x0208] - registers: [0x0211] - registers: [0x0203] @@ -1691,6 +1736,8 @@ parameters: scale: 0.1 registers: [ + 0x01F8, + 0x01F9, 0x020A, 0x020B, 0x0216, @@ -1706,6 +1753,7 @@ parameters: ] uint: enforce sensors: + - registers: [0x01F8, 0x01F9] - registers: [0x020A, 0x020B] - registers: [0x0216, 0x0217] - registers: [0x0206, 0x0207] @@ -1718,28 +1766,6 @@ parameters: validation: min: 1 - - name: Today Production - alt: Daily Production - friendly_name: Today's Production - class: "energy" - state_class: "total_increasing" - uom: "kWh" - scale: 0.1 - rule: 1 - registers: [0x0211] - icon: "mdi:solar-power" - - - name: "Total Production" - class: "energy" - state_class: "total_increasing" - uom: "kWh" - scale: 0.1 - rule: 3 - registers: [0x0216, 0x0217] - icon: "mdi:solar-power" - validation: - min: 0.1 - - name: "DC Temperature" hidden: class: "temperature"