diff --git a/custom_components/solarman/const.py b/custom_components/solarman/const.py index 3226c7c..50ec447 100644 --- a/custom_components/solarman/const.py +++ b/custom_components/solarman/const.py @@ -1,13 +1,13 @@ from datetime import timedelta as td -DOMAIN = 'solarman' +DOMAIN = "solarman" PLATFORMS: list[str] = ["sensor"] SENSOR_PREFIX = "Solarman" DISCOVERY_MESSAGE = "WIFIKIT-214028-READ" DISCOVERY_PORT = 48899 +DISCOVERY_RECV_MESSAGE_SIZE = 1024 -DEFINITIONS = 'inverter_definitions' LOOKUP_DIRECTORY = "inverter_definitions" LOOKUP_DIRECTORY_PATH = f"custom_components/{DOMAIN}/{LOOKUP_DIRECTORY}/" diff --git a/custom_components/solarman/discovery.py b/custom_components/solarman/discovery.py index 9456f82..79febcf 100644 --- a/custom_components/solarman/discovery.py +++ b/custom_components/solarman/discovery.py @@ -38,7 +38,7 @@ async def _discover(self, address = ""): while True: try: - recv = await loop.sock_recv(sock, 1024) + recv = await loop.sock_recv(sock, DISCOVERY_RECV_MESSAGE_SIZE) data = recv.decode().split(',') if len(data) == 3: self._ip = data[0] diff --git a/custom_components/solarman/inverter_definitions/deye_sg01hp3.yaml b/custom_components/solarman/inverter_definitions/deye_sg01hp3.yaml new file mode 100644 index 0000000..7776913 --- /dev/null +++ b/custom_components/solarman/inverter_definitions/deye_sg01hp3.yaml @@ -0,0 +1,1549 @@ +# +# SUN-5/6/8/10/12/15/20/25K-SG01HP3-EU-AM2 | 5-25kW | Three Phase | 2 MPPT | Hybrid Inverter | HV Battery Supported +# + +parameters: + - group: Parameters + items: + # Device - Type of the Device + - name: "Device" + update_interval: 300 + class: "" + state_class: "" + uom: "" + scale: 1 + rule: 1 + registers: [0x0000] + icon: "mdi:information" + isstr: true + lookup: + - key: 0x0200 + value: "String Inverter" + - key: 0x0300 + value: "Single-Phase Hybrid Inverter" + - key: 0x0400 + value: "Microinverter" + - key: 0x0005 + value: "LV 3-Phase Hybrid Inverter" + - key: 0x0006 + value: "HV 3-Phase Hybrid Inverter" + - key: 0x0600 + value: "HV 3-Phase Inverter 6-15kw" + - key: 0x0601 + value: "HV 3-Phase Inverter 20-50kw" + attributes: + [ + "Device Modbus Address", + "Device Protocol Version", + "Device Serial Number", + ] + + # Device - Modbus Address of the Device + - name: "Device Modbus Address" + attribute: + update_interval: 300 + class: "" + state_class: "" + uom: "" + scale: 1 + rule: 1 + registers: [0x0001] + icon: "mdi:information" + + # Device - Communication Protocol Version of the Device + - name: "Device Protocol Version" + attribute: + update_interval: 300 + class: "" + state_class: "" + uom: "" + scale: 1 + rule: 1 + registers: [0x0002] + icon: "mdi:information" + isstr: true + lookup: + - key: 0x0100 + value: "1.0" + - key: 0x0101 + value: "1.1" + - key: 0x0102 + value: "1.2" + - key: 0x0103 + value: "1.3" + - key: 0x0104 + value: "1.4" + - key: 0x0105 + value: "1.5" + + # Device - Serial Number of the Device + - name: "Device Serial Number" + attribute: + update_interval: 300 + class: "" + state_class: "" + uom: "" + scale: 1 + rule: 5 + registers: [0x0003, 0x0004, 0x0005, 0x0006, 0x0007] + icon: "mdi:information" + isstr: true + + # Device - Rated Power of the Device + - name: "Rated Power" + disabled: "Value not provided" + attribute: + class: "power" + state_class: "measurement" + uom: "W" + scale: 1 + rule: 1 + registers: [0x0008] + + - group: Settings + items: + - name: "Battery Control Mode" + attribute: + class: "" + state_class: "" + uom: "" + scale: 1 + rule: 1 + registers: [0x0062] + icon: "mdi:battery" + isstr: true + lookup: + - key: 0x0000 + value: "Lead-Battery, four-stage charging method" + - key: 0x0001 + value: "Lithium" + + - name: "Battery Equalization" + attribute: + class: "voltage" + state_class: "measurement" + uom: "V" + scale: 0.01 + rule: 1 + registers: [0x0063] + icon: "mdi:battery" + range: + min: 3800 + max: 6100 + + - name: "Battery Absorption" + attribute: + class: "voltage" + state_class: "measurement" + uom: "V" + scale: 0.01 + rule: 1 + registers: [0x0064] + icon: "mdi:battery" + range: + min: 3800 + max: 6100 + + - name: "Battery Float" + attribute: + class: "voltage" + state_class: "measurement" + uom: "V" + scale: 0.01 + rule: 1 + registers: [0x0065] + icon: "mdi:battery" + range: + min: 3800 + max: 6100 + + - name: "Battery Capacity" + attribute: + class: "" + state_class: "measurement" + uom: "Ah" + scale: 1 + rule: 1 + registers: [0x0066] + icon: "mdi:battery" + range: + min: 0 + max: 2000 + + - name: "Battery Empty" + attribute: + class: "voltage" + state_class: "measurement" + uom: "V" + scale: 0.01 + rule: 1 + registers: [0x0067] + icon: "mdi:battery" + + - name: "Zero Export" + attribute: + class: "power" + state_class: "measurement" + uom: "W" + scale: 1 + rule: 1 + registers: [0x0068] + icon: "mdi:transmission-tower-import" + + - name: "Battery Equalization Cycle" + attribute: + class: "duration" + state_class: "measurement" + uom: "d" + display_precision: 0 + scale: 1 + rule: 1 + registers: [0x0069] + icon: "mdi:battery" + range: + min: 0 + max: 90 + + - name: "Battery Equalization Time" + attribute: + class: "duration" + state_class: "measurement" + uom: "h" + scale: 0.5 + rule: 1 + registers: [0x006A] + icon: "mdi:battery" + range: + min: 0 + max: 20 + + - name: "Battery Temperature Compensation" + attribute: + class: "" + state_class: "measurement" + uom: "mV/*C" + scale: 1 + rule: 2 + registers: [0x006B] + icon: "mdi:battery" + range: + min: 0 + max: 50 + + - name: "Battery Max Charging Current" + attribute: + class: "current" + state_class: "measurement" + uom: "A" + scale: 1 + rule: 1 + registers: [0x006C] + icon: "mdi:battery" + range: + min: 0 + max: 185 + + - name: "Battery Max Discharging Current" + attribute: + class: "current" + state_class: "measurement" + uom: "A" + scale: 1 + rule: 1 + registers: [0x006D] + icon: "mdi:battery" + range: + min: 0 + max: 185 + + - name: "Battery Grid Charging Current" + attribute: + class: "current" + state_class: "measurement" + uom: "A" + scale: 1 + rule: 1 + registers: [0x0080] + icon: "mdi:battery" + range: + min: 0 + max: 185 + + - name: "Battery Grid Charging" + attribute: + class: "" + state_class: "" + uom: "" + scale: 1 + rule: 1 + registers: [0x0082] + icon: "mdi:battery" + isstr: true + lookup: + - key: 0x0000 + value: "Disabled" + - key: 0x0001 + value: "Enabled" + + - name: "SmartLoad Mode" + class: "" + state_class: "" + uom: "" + scale: 1 + rule: 1 + registers: [0x0085] + icon: "mdi:lightning-bolt-circle" + isstr: true + lookup: + - key: 0x0000 + value: "Generator" + - key: 0x0001 + value: "Output" + - key: 0x0002 + value: "Microinverter" + + - name: "SmartLoad Off" + class: "" + state_class: "measurement" + uom: "%" + scale: 1 + rule: 1 + registers: [0x0087] + icon: "mdi:lightning-bolt-circle" + range: + min: 0 + max: 100 + + - name: "SmartLoad On" + class: "" + state_class: "measurement" + uom: "%" + scale: 1 + rule: 1 + registers: [0x0089] + icon: "mdi:lightning-bolt-circle" + range: + min: 0 + max: 100 + + - group: BMS + items: + - name: "BMS Charging Voltage" + attribute: + class: "voltage" + state_class: "measurement" + uom: "V" + scale: 0.1 + rule: 1 + registers: [0x00D2] + icon: "mdi:battery" + + - name: "BMS Discharging Voltage" + attribute: + class: "voltage" + state_class: "measurement" + uom: "V" + scale: 0.1 + rule: 1 + registers: [0x00D3] + icon: "mdi:battery" + + - name: "BMS Charging Current Limit" + attribute: + class: "current" + state_class: "measurement" + uom: "A" + scale: 1 + rule: 1 + registers: [0x00D4] + icon: "mdi:battery" + + - name: "BMS Discharging Current Limit" + attribute: + class: "current" + state_class: "measurement" + uom: "A" + scale: 1 + rule: 1 + registers: [0x00D5] + icon: "mdi:battery" + + - name: "BMS" + class: "" + state_class: "measurement" + uom: "%" + scale: 1 + rule: 1 + registers: [0x00D6] + icon: "mdi:battery" + validation: + min: 0 + max: 101 + attributes: + [ + "BMS Type", + "BMS Charging Voltage", + "BMS Discharging Voltage", + "BMS Charging Current Limit", + "BMS Discharging Current Limit", + "BMS Max Charging Current", + "BMS Max Discharging Current", + ] + + - name: "BMS Voltage" + class: "voltage" + state_class: "measurement" + uom: "V" + scale: 0.1 + rule: 1 + registers: [0x00D7] + + - name: "BMS Current" + class: "current" + state_class: "measurement" + uom: "A" + scale: 0.1 + rule: 2 + registers: [0x00D8] + + - name: "BMS Max Charging Current" + attribute: + class: "current" + state_class: "measurement" + uom: "A" + scale: 1 + rule: 1 + registers: [0x00DA] + icon: "mdi:battery" + + - name: "BMS Max Discharging Current" + attribute: + class: "current" + state_class: "measurement" + uom: "A" + scale: 1 + rule: 1 + registers: [0x00DB] + icon: "mdi:battery" + + - name: "BMS Alarm" + class: "" + state_class: "" + uom: "" + scale: 1 + rule: 1 + registers: [0x00DC] + icon: "mdi:battery-alert" + isstr: true + lookup_default: "Active" + lookup: + - key: 0 + value: "Inactive" + - key: 1 + value: "Active" + + - name: "BMS Fault Location" + class: "" + state_class: "" + uom: "" + scale: 1 + rule: 1 + registers: [0x00DD] + icon: "mdi:battery-alert" + range: + min: 0 + max: 65535 + + - name: "BMS Other Symbol" + disabled: + attribute: + class: "" + state_class: "" + uom: "" + scale: 1 + rule: 1 + registers: [0x00DE] + icon: "mdi:battery-unknown" + range: + min: 0 + max: 65535 + + - name: "BMS Type" + attribute: + class: "" + state_class: "" + uom: "" + scale: 1 + rule: 1 + registers: [0x00DF] + icon: "mdi:battery" + isstr: true + lookup: + - key: 0x0000 + value: "PYLON" + - key: 0x0001 + value: "Tianbangda" + - key: 0x0002 + value: "KOK" + - key: 0x0003 + value: "keith" + - key: 0x0004 + value: "Toppai" + - key: 0x0005 + value: "Peneng 485" + - key: 0x0006 + value: "Jeris 485" + - key: 0x0007 + value: "Sunwoda 485" + - key: 0x0008 + value: "Xinrui 485" + - key: 0x0009 + value: "Tianbangda 485" + - key: 0x000A + value: "Shenggao Electric CAN" + + - group: Device + items: + # Device - Operating (Running) status + - name: "Device Status" + update_interval: 30 + class: "" + state_class: "" + uom: "" + scale: 1 + rule: 1 + registers: [0x01F4] + icon: "mdi:information" + range: + min: 0 + max: 5 + isstr: true + lookup: + - key: 0x0000 + value: "Standby" + - key: 0x0001 + value: "Self-test" + - key: 0x0002 + value: "Normal" + - key: 0x0003 + value: "Alarm" + - key: 0x0004 + value: "Fault" + + - group: Meter + items: + - name: "Today Battery Charge" + class: "energy" + state_class: "total_increasing" + uom: "kWh" + scale: 0.1 + rule: 1 + registers: [0x0202] + icon: "mdi:battery-plus" + + - name: "Today Battery Discharge" + class: "energy" + state_class: "total_increasing" + uom: "kWh" + scale: 0.1 + rule: 1 + registers: [0x0203] + icon: "mdi:battery-minus" + + - name: "Total Battery Charge" + class: "energy" + state_class: "total_increasing" + uom: "kWh" + scale: 0.1 + rule: 3 + registers: [0x0204, 0x0205] + icon: "mdi:battery-plus" + + - name: "Total Battery Discharge" + class: "energy" + state_class: "total_increasing" + uom: "kWh" + scale: 0.1 + rule: 3 + registers: [0x0206, 0x0207] + icon: "mdi:battery-minus" + + - name: "Today Battery Life Cycles" + class: "" + state_class: "total_increasing" + uom: "" + scale: 1 + rule: 0 + params: ["Today Battery Charge", "Battery Capacity", "Battery Nominal Voltage"] + formula: "round({0} / ({1} * {2} / 1000), 2)" + icon: "mdi:battery-sync" + + - name: "Total Battery Life Cycles" + class: "" + state_class: "total_increasing" + uom: "" + scale: 1 + rule: 0 + params: ["Total Battery Charge", "Battery Capacity", "Battery Nominal Voltage"] + formula: "round({0} / ({1} * {2} / 1000), 2)" + icon: "mdi:battery-sync" + + - name: "Today Energy Export" + class: "energy" + state_class: "total_increasing" + uom: "kWh" + scale: 0.1 + rule: 1 + registers: [0x0208] + icon: "mdi:transmission-tower-export" + + - name: "Today Energy Import" + class: "energy" + state_class: "total_increasing" + uom: "kWh" + scale: 0.1 + rule: 1 + registers: [0x0209] + icon: "mdi:transmission-tower-import" + + - name: "Total Energy Export" + class: "energy" + state_class: "total_increasing" + uom: "kWh" + scale: 0.1 + rule: 3 + registers: [0x020A, 0x020B] + icon: "mdi:transmission-tower-export" + + - name: "Total Energy Import" + class: "energy" + state_class: "total_increasing" + uom: "kWh" + scale: 0.1 + rule: 3 + registers: [0x020C, 0x020D] + icon: "mdi:transmission-tower-import" + + - name: "Today Load Consumption" + class: "energy" + state_class: "total_increasing" + uom: "kWh" + scale: 0.1 + rule: 1 + registers: [0x020E] + + - name: "Total Load Consumption" + class: "energy" + state_class: "total_increasing" + uom: "kWh" + scale: 0.1 + rule: 3 + registers: [0x020F, 0x0210] + + - name: "Today Losses" + class: "energy" + state_class: "total_increasing" + uom: "kWh" + scale: 0.1 + rule: 0 + params: ["Today Energy Export", "Today Production", "Today Battery Discharge", "Today Energy Import", "Today Load Consumption", "Today Battery Charge"] + formula: "max(round({0} + {1} + {2} - {3} - {4} - {5}, 1), 0)" + + - name: "Total Losses" + class: "energy" + state_class: "total_increasing" + uom: "kWh" + scale: 0.1 + rule: 0 + params: ["Total Energy Export", "Total Production", "Total Battery Discharge", "Total Energy Import", "Total Load Consumption", "Total Battery Charge"] + formula: "max(round({0} + {1} + {2} - {3} - {4} - {5}, 1), 0)" + + - name: "Today 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" + + - name: "DC Temperature" + disabled: + class: "temperature" + state_class: "measurement" + uom: "°C" + scale: 0.1 + rule: 2 + offset: 1000 + registers: [0x021C] + icon: "mdi:thermometer" + range: + min: 0 + max: 3000 + + - name: "Temperature" + class: "temperature" + state_class: "measurement" + uom: "°C" + scale: 0.1 + rule: 2 + offset: 1000 + registers: [0x021D] + icon: "mdi:thermometer" + range: + min: 0 + max: 3000 + + - group: Status + items: + # Device - Power on/off status + - name: "Device Power Status" + update_interval: 30 + class: "" + state_class: "" + uom: "" + scale: 1 + rule: 1 + registers: [0x0227] + icon: "mdi:information" + isstr: true + lookup: + - key: 0x0000 + value: "Off" + - key: 0x0001 + value: "On" + + # Device - AC Relay status + - name: "Device Relay Status" + update_interval: 30 + class: "" + state_class: "" + uom: "" + scale: 1 + rule: 1 + registers: [0x0228] + icon: "mdi:information" + isstr: true + lookup_default: "Power Supply" + lookup: + - key: 0x0001 + value: "Inverter" + - key: 0x0004 + value: "Grid" + - key: 0x0005 + value: "Inverter-Grid" + - key: 0x0008 + value: "Generator" + - key: 0x0009 + value: "Inverter-Gen" + - key: 0x000C + value: "Grid-Generator" + - key: 0x000D + value: "Inv-Grid-Gen" + + # Device - AC Grid state + - name: "Device State" + class: "" + state_class: "" + uom: "" + scale: 1 + rule: 0 + params: ["Device Relay Status enum"] + formula: "'On-grid' if {0} & 4 == 4 else 'Off-grid'" + isstr: true + icon: "mdi:transmission-tower-off" + + # Device - Alarm message (word 1 & 2) [0, 65535] + - name: "Device Alert" + update_interval: 30 + class: "" + state_class: "" + uom: "" + scale: 1 + rule: 3 + registers: [0x0229, 0x022A] + icon: "mdi:alert-circle" + isstr: true + lookup_default: "Error" + lookup: + - key: 0x0000 + value: "Ok" + - key: 0x0001 + value: "Fan failure" + - key: 0x0002 + value: "Grid error" + - key: 0x4000 + value: "Battery loss" + - key: 0x8000 + value: "Parallel communication quality" + + # Device - Fault message (word 1, 2, 3 & 4) [0, 65535] + - name: "Device Fault" + update_interval: 30 + class: "" + state_class: "" + uom: "" + scale: 1 + rule: 6 + registers: [0x22B, 0x022C, 0x022D, 0x022E] + icon: "mdi:alert" + + - group: Battery + items: + # Battery - The temperature of battery 1 + - name: "Battery Temperature" + realtime: + class: "temperature" + state_class: "measurement" + uom: "°C" + scale: 0.1 + rule: 1 + offset: 1000 + registers: [0x024A] + range: + min: 0 + max: 3000 + validation: + min: 1 + max: 99 + invalidate_all: + + # Battery - The voltage of battery 1 (L:0.01V, H:0.1V) + - name: "Battery Voltage" + class: "voltage" + state_class: "measurement" + uom: "V" + scale: 0.1 + rule: 1 + registers: [0x024B] + + # Battery - The State of Charge (SOC) of battery 1 + - name: "Battery" + class: "battery" + state_class: "measurement" + uom: "%" + scale: 1 + rule: 1 + registers: [0x024C] + range: + min: 0 + max: 100 + validation: + min: 0 + max: 101 + attributes: + [ + "Battery Control Mode", + "Battery Capacity", + "Battery Corrected Capacity", + "Battery Absorption", + "Battery Float", + "Battery Empty", + "Battery Equalization", + "Battery Equalization Cycle", + "Battery Equalization Time", + "Battery Temperature Compensation", + "Battery Max Charging Current", + "Battery Max Discharging Current", + "Battery Grid Charging", + "Battery Grid Charging Current", + ] + + # Battery - The power of battery is S16bit (low 16 bits | L:1W, H:10W) + - name: "Battery Power" + class: "power" + state_class: "measurement" + uom: "W" + scale: 10 + rule: 2 + registers: [0x024E] + + # Battery - The state of health + - name: "Battery SOH" + class: "" + state_class: "measurement" + uom: "%" + scale: 1 + rule: 0 + params: ["Total Battery Charge", "Battery Capacity", "Battery Nominal Voltage", "Battery Life Cycle Rating"] + formula: "round(100 - {0} / ({1} * {2} / 1000) / ({3} * 0.05), 2)" + icon: "mdi:battery-heart" + + # Battery - The state of battery + - name: "Battery State" + class: "" + state_class: "" + uom: "" + scale: 1 + rule: 0 + params: ["Battery Power", "Battery Power"] + formula: "'discharging' if {0} > 50 else 'charging' if {1} < -50 else 'static'" + isstr: true + icon: "mdi:battery" + + # Battery - The current of battery 1 is S16bit (low 16 bits) + - name: "Battery Current" + class: "current" + state_class: "measurement" + uom: "A" + scale: 0.01 + rule: 2 + registers: [0x024F] + + # Battery - Actual capacity of the battery + - name: "Battery Corrected Capacity" + attribute: + class: "current" + state_class: "measurement" + uom: "Ah" + display_precision: 2 + scale: 1 + rule: 1 + registers: [0x0250] + icon: "mdi:battery" + range: + min: 0 + max: 3000 + + - group: Grid + items: + # Grid side - The voltage of phase A + - name: "Grid L1 Voltage" + class: "voltage" + state_class: "measurement" + uom: "V" + scale: 0.1 + rule: 1 + registers: [0x0256] + icon: "mdi:transmission-tower" + + # Grid side - The voltage of phase B + - name: "Grid L2 Voltage" + class: "voltage" + state_class: "measurement" + uom: "V" + scale: 0.1 + rule: 1 + registers: [0x0257] + icon: "mdi:transmission-tower" + + # Grid side - The voltage of phase C + - name: "Grid L3 Voltage" + class: "voltage" + state_class: "measurement" + uom: "V" + scale: 0.1 + rule: 1 + registers: [0x0258] + icon: "mdi:transmission-tower" + + # Grid internal - The power of phase A is S16bit (low 16 bits) + S16bit (high 16 bits) + - name: "Internal CT1 Power" + realtime: + class: "power" + state_class: "measurement" + uom: "W" + scale: 1 + rule: 4 + registers: [0x025C, 0x02BC] + icon: "mdi:transmission-tower" + + # Grid internal - The power of phase B is S16bit (low 16 bits) + S16bit (high 16 bits) + - name: "Internal CT2 Power" + realtime: + class: "power" + state_class: "measurement" + uom: "W" + scale: 1 + rule: 4 + registers: [0x025D, 0x02BD] + icon: "mdi:transmission-tower" + + # Grid internal - The power of phase C is S16bit (low 16 bits) + S16bit (high 16 bits) + - name: "Internal CT3 Power" + realtime: + class: "power" + state_class: "measurement" + uom: "W" + scale: 1 + rule: 4 + registers: [0x025E, 0x02BE] + icon: "mdi:transmission-tower" + + # Grid internal - Total active power is S16bit (low 16 bits) + S16bit (high 16 bits) + - name: "Internal Power" + realtime: + class: "power" + state_class: "measurement" + uom: "W" + scale: 1 + rule: 4 + registers: [0x025F, 0x02BF] + icon: "mdi:transmission-tower" + + # Grid internal - The current of phase A is S16bit (low 16 bits) + - name: "Internal CT1 Current" + class: "current" + state_class: "measurement" + uom: "A" + scale: 0.01 + rule: 2 + registers: [0x0262] + icon: "mdi:transmission-tower" + + # Grid internal - The current of phase B is S16bit (low 16 bits) + - name: "Internal CT2 Current" + class: "current" + state_class: "measurement" + uom: "A" + scale: 0.01 + rule: 2 + registers: [0x0263] + icon: "mdi:transmission-tower" + + # Grid internal - The current of phase C is S16bit (low 16 bits) + - name: "Internal CT3 Current" + class: "current" + state_class: "measurement" + uom: "A" + scale: 0.01 + rule: 2 + registers: [0x0264] + icon: "mdi:transmission-tower" + + # Grid external - The current of phase A is S16bit (low 16 bits) + - name: "External CT1 Current" + class: "current" + state_class: "measurement" + uom: "A" + scale: 0.01 + rule: 2 + registers: [0x0265] + icon: "mdi:transmission-tower" + + # Grid external - The current of phase B is S16bit (low 16 bits) + - name: "External CT2 Current" + class: "current" + state_class: "measurement" + uom: "A" + scale: 0.01 + rule: 2 + registers: [0x0266] + icon: "mdi:transmission-tower" + + # Grid external - The current of phase C is S16bit (low 16 bits) + - name: "External CT3 Current" + class: "current" + state_class: "measurement" + uom: "A" + scale: 0.01 + rule: 2 + registers: [0x0267] + icon: "mdi:transmission-tower" + + # Grid external - The power of phase A is S16bit (low 16 bits) + S16bit (high 16 bits) + - name: "External CT1 Power" + realtime: + class: "power" + state_class: "measurement" + uom: "W" + scale: 1 + rule: 4 + registers: [0x0268, 0x02C1] + icon: "mdi:transmission-tower" + + # Grid external - The power of phase B is S16bit (low 16 bits) + S16bit (high 16 bits) + - name: "External CT2 Power" + realtime: + class: "power" + state_class: "measurement" + uom: "W" + scale: 1 + rule: 4 + registers: [0x0269, 0x02C2] + icon: "mdi:transmission-tower" + + # Grid external - The power of phase C is S16bit (low 16 bits) + S16bit (high 16 bits) + - name: "External CT3 Power" + realtime: + class: "power" + state_class: "measurement" + uom: "W" + scale: 1 + rule: 4 + registers: [0x026A, 0x02C3] + icon: "mdi:transmission-tower" + + # Grid external - Total active power is S16bit (low 16 bits) + S16bit (high 16 bits) + - name: "External Power" + realtime: + class: "power" + state_class: "measurement" + uom: "W" + scale: 1 + rule: 4 + registers: [0x026B, 0x02C4] + icon: "mdi:transmission-tower" + + # The following three (four) registers change according to the built-in and external settings + # Grid - The power of phase A is S16bit (low 16 bits) + S16bit (high 16 bits) + - name: "Grid L1 Power" + realtime: + class: "measurement" + state_class: "measurement" + uom: "W" + scale: 1 + rule: 4 + registers: [0x026E, 0x02AF] + icon: "mdi:transmission-tower" + + # Grid - The power of phase A is S16bit (low 16 bits) + S16bit (high 16 bits) + - name: "Grid L2 Power" + realtime: + class: "measurement" + state_class: "measurement" + uom: "W" + scale: 1 + rule: 4 + registers: [0x026F, 0x02B0] + icon: "mdi:transmission-tower" + + # Grid - The power of phase A is S16bit (low 16 bits) + S16bit (high 16 bits) + - name: "Grid L3 Power" + realtime: + class: "measurement" + state_class: "measurement" + uom: "W" + scale: 1 + rule: 4 + registers: [0x0270, 0x02B1] + icon: "mdi:transmission-tower" + + # Grid - Total active power is S16bit (low 16 bits) + S16bit (high 16 bits) + - name: "Grid Power" + realtime: + class: "measurement" + state_class: "measurement" + uom: "W" + scale: 1 + rule: 4 + registers: [0x0271, 0x02B2] + icon: "mdi:transmission-tower" + attributes: + [ + "Zero Export", + ] + + - group: Inverter + items: + # Inverter output - The voltage of phase A + - name: "Inverter L1 Voltage" + class: "voltage" + state_class: "measurement" + uom: "V" + scale: 0.1 + rule: 1 + registers: [0x0273] + + # Inverter output - The voltage of phase B + - name: "Inverter L2 Voltage" + class: "voltage" + state_class: "measurement" + uom: "V" + scale: 0.1 + rule: 1 + registers: [0x0274] + + # Inverter output - The voltage of phase C + - name: "Inverter L3 Voltage" + class: "voltage" + state_class: "measurement" + uom: "V" + scale: 0.1 + rule: 1 + registers: [0x0275] + + # Inverter output - The current of phase A is S16bit (low 16 bits) + - name: "Inverter L1 Current" + class: "current" + state_class: "measurement" + uom: "A" + scale: 0.01 + rule: 2 + registers: [0x0276] + + # Inverter output - The current of phase B is S16bit (low 16 bits) + - name: "Inverter L2 Current" + class: "current" + state_class: "measurement" + uom: "A" + scale: 0.01 + rule: 2 + registers: [0x0277] + + # Inverter output - The current of phase C is S16bit (low 16 bits) + - name: "Inverter L3 Current" + class: "current" + state_class: "measurement" + uom: "A" + scale: 0.01 + rule: 2 + registers: [0x0278] + + # Inverter output - The power of phase A is S16bit (low 16 bits) + S16bit (high 16 bits) + - name: "Inverter L1 Power" + realtime: + class: "power" + state_class: "measurement" + uom: "W" + scale: 1 + rule: 4 + registers: [0x0279, 0x02B3] + + # Inverter output - The power of phase B is S16bit (low 16 bits) + S16bit (high 16 bits) + - name: "Inverter L2 Power" + realtime: + class: "power" + state_class: "measurement" + uom: "W" + scale: 1 + rule: 4 + registers: [0x027A, 0x02B4] + + # Inverter output - The power of phase C is S16bit (low 16 bits) + S16bit (high 16 bits) + - name: "Inverter L3 Power" + realtime: + class: "power" + state_class: "measurement" + uom: "W" + scale: 1 + rule: 4 + registers: [0x027B, 0x02B5] + + # Inverter output - Total active power is S16bit (low 16 bits) + S16bit (high 16 bits) + - name: "Inverter Power" + realtime: + class: "power" + state_class: "measurement" + uom: "W" + scale: 1 + rule: 4 + registers: [0x027C, 0x02B6] + + # Inverter - Includes consumption of the device itself aswell power losses of AC/DC conversions + - name: "Power losses" + class: "power" + state_class: "measurement" + uom: "W" + scale: 1 + rule: 0 + params: ["Battery Power", "PV1 Power", "PV2 Power", "Inverter Power"] + formula: "max({0} + {1} + {2} - {3}, 0)" + + # Inverter - Frequency + - name: "Inverter Frequency" + realtime: + class: "frequency" + state_class: "measurement" + uom: "Hz" + scale: 0.01 + rule: 1 + registers: [0x027E] + + - group: Upload + items: + # UPS output - The power of phase A is U16bit (low 16 bits) + U16bit (high 16 bits) + - name: "UPS L1 Power" + realtime: + class: "power" + state_class: "measurement" + uom: "W" + scale: 1 + rule: 3 + registers: [0x0280, 0x02B8] + icon: "mdi:home-lightning-bolt" + + # UPS output - The power of phase B is U16bit (low 16 bits) + U16bit (high 16 bits) + - name: "UPS L2 Power" + realtime: + class: "power" + state_class: "measurement" + uom: "W" + scale: 1 + rule: 3 + registers: [0x0281, 0x02B9] + icon: "mdi:home-lightning-bolt" + + # UPS output - The power of phase C is U16bit (low 16 bits) + U16bit (high 16 bits) + - name: "UPS L3 Power" + realtime: + class: "power" + state_class: "measurement" + uom: "W" + scale: 1 + rule: 3 + registers: [0x0282, 0x02BA] + icon: "mdi:home-lightning-bolt" + + # UPS output - Total active power is U16bit (low 16 bits) + U16bit (high 16 bits) + - name: "UPS Power" + realtime: + class: "power" + state_class: "measurement" + uom: "W" + scale: 1 + rule: 3 + registers: [0x0283, 0x02BB] + icon: "mdi:home-lightning-bolt" + + # Load output - The voltage of phase A + - name: "Load L1 Voltage" + class: "voltage" + state_class: "measurement" + uom: "V" + scale: 0.1 + rule: 1 + registers: [0x0284] + + # Load output - The voltage of phase B + - name: "Load L2 Voltage" + class: "voltage" + state_class: "measurement" + uom: "V" + scale: 0.1 + rule: 1 + registers: [0x0285] + + # Load output - The voltage of phase C + - name: "Load L3 Voltage" + class: "voltage" + state_class: "measurement" + uom: "V" + scale: 0.1 + rule: 1 + registers: [0x0286] + + # Load - The power of phase A is S16bit (low 16 bits) + S16bit (high 16 bits) + - name: "Load L1 Power" + realtime: + class: "power" + state_class: "measurement" + uom: "W" + scale: 1 + rule: 2 + registers: [0x028A, 0x0290] + + # Load - The power of phase A is S16bit (low 16 bits) + S16bit (high 16 bits) + - name: "Load L2 Power" + realtime: + class: "power" + state_class: "measurement" + uom: "W" + scale: 1 + rule: 2 + registers: [0x028B, 0x0291] + + # Load - The power of phase A is S16bit (low 16 bits) + S16bit (high 16 bits) + - name: "Load L3 Power" + realtime: + class: "power" + state_class: "measurement" + uom: "W" + scale: 1 + rule: 2 + registers: [0x028C, 0x0292] + + # Load - Total active power is S16bit (low 16 bits) + S16bit (high 16 bits) + - name: "Load Power" + realtime: + class: "power" + state_class: "measurement" + uom: "W" + scale: 1 + rule: 2 + registers: [0x028D, 0x0293] + + - group: Photovoltaic + items: + # Photovoltaic - The combined power of Input 1 & 2 + - name: "PV Power" + realtime: + class: "power" + state_class: "measurement" + uom: "W" + scale: 1 + rule: 0 + params: ["PV1 Power", "PV2 Power"] + formula: "{0} + {1}" + icon: "mdi:solar-power-variant" + + # Photovoltaic - The power of Input 1 (L:1W, H:10W) + - name: "PV1 Power" + realtime: + class: "power" + state_class: "measurement" + uom: "W" + scale: 10 + rule: 1 + registers: [0x02A0] + icon: "mdi:solar-power-variant" + + # Photovoltaic - The power of Input 2 (L:1W, H:10W) + - name: "PV2 Power" + realtime: + class: "power" + state_class: "measurement" + uom: "W" + scale: 10 + rule: 1 + registers: [0x02A1] + icon: "mdi:solar-power-variant" + + # Photovoltaic - The power of Input 3 (L:1W, H:10W) + - name: "PV3 Power" + disabled: + realtime: + class: "power" + state_class: "measurement" + uom: "W" + scale: 10 + rule: 1 + registers: [0x02A2] + icon: "mdi:solar-power-variant" + + # Photovoltaic - The power of Input 4 (L:1W, H:10W) + - name: "PV4 Power" + disabled: + realtime: + class: "power" + state_class: "measurement" + uom: "W" + scale: 10 + rule: 1 + registers: [0x02A3] + icon: "mdi:solar-power-variant" + + # Photovoltaic - The voltage of Input 1 + - name: "PV1 Voltage" + realtime: + class: "voltage" + state_class: "measurement" + uom: "V" + scale: 0.1 + rule: 1 + registers: [0x02A4] + icon: "mdi:solar-power-variant" + range: + min: 0 + max: 65535 + + # Photovoltaic - The current of Input 1 + - name: "PV1 Current" + realtime: + class: "current" + state_class: "measurement" + uom: "A" + scale: 0.1 + rule: 1 + registers: [0x02A5] + icon: "mdi:solar-power-variant" + range: + min: 0 + max: 65535 + + # Photovoltaic - The voltage of Input 2 + - name: "PV2 Voltage" + realtime: + class: "voltage" + state_class: "measurement" + uom: "V" + scale: 0.1 + rule: 1 + registers: [0x02A6] + icon: "mdi:solar-power-variant" + range: + min: 0 + max: 65535 + + # Photovoltaic - The current of Input 2 + - name: "PV2 Current" + realtime: + class: "current" + state_class: "measurement" + uom: "A" + scale: 0.1 + rule: 1 + registers: [0x02A7] + icon: "mdi:solar-power-variant" + range: + min: 0 + max: 65535 + + # Photovoltaic - The voltage of Input 3 + - name: "PV3 Voltage" + disabled: + realtime: + class: "voltage" + state_class: "measurement" + uom: "V" + scale: 0.1 + rule: 1 + registers: [0x02A8] + icon: "mdi:solar-power-variant" + range: + min: 0 + max: 65535 + + # Photovoltaic - The current of Input 3 + - name: "PV3 Current" + disabled: + realtime: + class: "current" + state_class: "measurement" + uom: "A" + scale: 0.1 + rule: 1 + registers: [0x02A9] + icon: "mdi:solar-power-variant" + range: + min: 0 + max: 65535 + + # Photovoltaic - The voltage of Input 4 + - name: "PV4 Voltage" + disabled: + realtime: + class: "voltage" + state_class: "measurement" + uom: "V" + scale: 0.1 + rule: 1 + registers: [0x02AA] + icon: "mdi:solar-power-variant" + range: + min: 0 + max: 65535 + + # Photovoltaic - The current of Input 4 + - name: "PV4 Current" + disabled: + realtime: + class: "current" + state_class: "measurement" + uom: "A" + scale: 0.1 + rule: 1 + registers: [0x02AB] + icon: "mdi:solar-power-variant" + range: + min: 0 + max: 65535 diff --git a/custom_components/solarman/inverter_definitions/deye_sg04lp3.yaml b/custom_components/solarman/inverter_definitions/deye_sg04lp3.yaml index b8f6cd8..dee5c11 100644 --- a/custom_components/solarman/inverter_definitions/deye_sg04lp3.yaml +++ b/custom_components/solarman/inverter_definitions/deye_sg04lp3.yaml @@ -31,6 +31,8 @@ parameters: value: "Microinverter" - key: 0x0005 value: "LV 3-Phase Hybrid Inverter" + - key: 0x0006 + value: "HV 3-Phase Hybrid Inverter" - key: 0x0600 value: "HV 3-Phase Inverter 6-15kw" - key: 0x0601 diff --git a/custom_components/solarman/inverter_definitions/deye_sun-12k-sg04lp3.yaml b/custom_components/solarman/inverter_definitions/deye_sun-12k-sg04lp3.yaml index 5184b79..736f1db 100644 --- a/custom_components/solarman/inverter_definitions/deye_sun-12k-sg04lp3.yaml +++ b/custom_components/solarman/inverter_definitions/deye_sun-12k-sg04lp3.yaml @@ -33,6 +33,8 @@ parameters: value: "Microinverter" - key: 0x0005 value: "LV 3-Phase Hybrid Inverter" + - key: 0x0006 + value: "HV 3-Phase Hybrid Inverter" - key: 0x0600 value: "HV 3-Phase Inverter 6-15kw" - key: 0x0601