diff --git a/custom_components/solarman/api.py b/custom_components/solarman/api.py index cf632d91..97d06bad 100644 --- a/custom_components/solarman/api.py +++ b/custom_components/solarman/api.py @@ -253,6 +253,7 @@ async def service_read_holding_registers(self, register, quantity, wait_for_atte _LOGGER.warning(f"[{self.serial}] service_read_holding_registers: [{register}], quantity: [{quantity}] failed. [{format_exception(e)}]") if not self.auto_reconnect: await self.async_disconnect() + raise async def service_read_input_registers(self, register, quantity, wait_for_attempts = ACTION_ATTEMPTS): _LOGGER.debug(f"[{self.serial}] service_read_input_registers: [{register}], quantity: [{quantity}]") @@ -268,6 +269,7 @@ async def service_read_input_registers(self, register, quantity, wait_for_attemp _LOGGER.warning(f"[{self.serial}] service_read_input_registers: [{register}], quantity: [{quantity}] failed. [{format_exception(e)}]") if not self.auto_reconnect: await self.async_disconnect() + raise async def service_write_holding_register(self, register, value, wait_for_attempts = ACTION_ATTEMPTS) -> bool: _LOGGER.debug(f"[{self.serial}] service_write_holding_register: {register}, value: {value}") diff --git a/custom_components/solarman/inverter_definitions/afore_BNTxxxKTL-2mppt.yaml b/custom_components/solarman/inverter_definitions/afore_BNTxxxKTL-2mppt.yaml index 4113f3cd..2be664aa 100644 --- a/custom_components/solarman/inverter_definitions/afore_BNTxxxKTL-2mppt.yaml +++ b/custom_components/solarman/inverter_definitions/afore_BNTxxxKTL-2mppt.yaml @@ -8,7 +8,7 @@ default: digits: 6 parameters: - - group: solar + - group: PV items: - name: "PV1 Voltage" class: "voltage" @@ -164,6 +164,5 @@ parameters: uom: "°C" scale: 0.1 rule: 1 - registers: [0x000D] icon: "mdi:thermometer" diff --git a/custom_components/solarman/inverter_definitions/afore_hybrid.yaml b/custom_components/solarman/inverter_definitions/afore_hybrid.yaml index 984bde92..4179e21c 100644 --- a/custom_components/solarman/inverter_definitions/afore_hybrid.yaml +++ b/custom_components/solarman/inverter_definitions/afore_hybrid.yaml @@ -7,7 +7,7 @@ default: digits: 6 parameters: - - group: solar + - group: PV items: - name: "PV1 Voltage" class: "voltage" @@ -112,21 +112,21 @@ parameters: registers: [0x07DA] icon: "mdi:battery-minus" - - name: "Battery Status" - class: "" + - name: "Battery State" + class: "enum" state_class: "measurement" uom: "" scale: 1 rule: 1 registers: [0x07D0] - isstr: true + options: ["charging", "discharging", "idle"] lookup: - key: 4 - value: "Charge" + value: "charging" - key: 5 - value: "Discharge" + value: "discharging" - key: 6 - value: "Stand-by" + value: "idle" icon: "mdi:battery" - name: "Battery Power" @@ -156,7 +156,7 @@ parameters: registers: [0x07D5] icon: "mdi:battery" - - name: "Battery SOC" + - name: "Battery" class: "battery" state_class: "measurement" uom: "%" @@ -221,21 +221,20 @@ parameters: registers: [0x0201] icon: "mdi:home-lightning-bolt" - - group: Inverter + - group: Device items: - - name: "Running Status" + - name: "Device State" class: "" state_class: "" uom: "" scale: 1 rule: 1 registers: [0x09C4] - isstr: true lookup: - key: 1 - value: "Stand-by" + value: "Standby" - key: 2 - value: "Start-up" + value: "Startup" - key: 3 value: "Grid" - key: 4 diff --git a/custom_components/solarman/inverter_definitions/deye_hybrid.yaml b/custom_components/solarman/inverter_definitions/deye_hybrid.yaml index aef8531c..3c0c59f7 100644 --- a/custom_components/solarman/inverter_definitions/deye_hybrid.yaml +++ b/custom_components/solarman/inverter_definitions/deye_hybrid.yaml @@ -126,21 +126,21 @@ parameters: registers: [0x0047] icon: "mdi:battery-minus" - - name: "Battery Status" + - name: "Battery State" class: "enum" state_class: "" uom: "" scale: 1 rule: 1 registers: [0x00BD] - options: ["Charge", "Stand-by", "Discharge"] + options: ["charging", "idle", "discharging"] lookup: - key: 0 - value: "Charge" + value: "charging" - key: 1 - value: "Stand-by" + value: "idle" - key: 2 - value: "Discharge" + value: "discharging" icon: "mdi:battery" - name: "Battery Power" @@ -159,7 +159,7 @@ parameters: rule: 1 registers: [0x00B7] - - name: "Battery SOC" + - name: "Battery" class: "battery" state_class: "measurement" uom: "%" @@ -231,7 +231,7 @@ parameters: registers: [0x00A1] icon: "mdi:transmission-tower" - - name: "Internal CT L1 Power" + - name: "Internal CT1 Power" class: "power" state_class: "measurement" uom: "W" @@ -240,7 +240,7 @@ parameters: registers: [0x00A7] icon: "mdi:transmission-tower" - - name: "Internal CT L2 Power" + - name: "Internal CT2 Power" class: "power" state_class: "measurement" uom: "W" @@ -249,7 +249,7 @@ parameters: registers: [0x00A8] icon: "mdi:transmission-tower" - - name: "External CT L1 Power" + - name: "External CT1 Power" class: "power" state_class: "measurement" uom: "W" @@ -258,7 +258,7 @@ parameters: registers: [0x00AA] icon: "mdi:transmission-tower" - - name: "External CT L2 Power" + - name: "External CT2 Power" class: "power" state_class: "measurement" uom: "W" @@ -384,15 +384,18 @@ parameters: value: "ON" icon: "mdi:lightning-bolt-circle" - - group: Inverter + - group: Device items: - - name: "Running Status" + # Device - Operating (Running) state + - name: "Device State" + update_interval: 30 class: "enum" state_class: "" uom: "" scale: 1 rule: 1 registers: [0x003B] + icon: "mdi:information" range: min: 0 max: 5 @@ -408,7 +411,6 @@ parameters: value: "Alarm" - key: 0x0004 value: "Fault" - icon: "mdi:information" - name: "Power" class: "power" diff --git a/custom_components/solarman/inverter_definitions/deye_string.yaml b/custom_components/solarman/inverter_definitions/deye_string.yaml index af6fdb92..f83a859c 100644 --- a/custom_components/solarman/inverter_definitions/deye_string.yaml +++ b/custom_components/solarman/inverter_definitions/deye_string.yaml @@ -119,9 +119,11 @@ parameters: rule: 1 registers: [0x004F] - - group: Inverter + - group: Device items: - - name: "Running Status" + # Device - Operating (Running) state + - name: "Device State" + update_interval: 30 class: "enum" state_class: "" uom: "" diff --git a/custom_components/solarman/inverter_definitions/kstar_hybrid.yaml b/custom_components/solarman/inverter_definitions/kstar_hybrid.yaml index 055c71e8..c9d9107e 100644 --- a/custom_components/solarman/inverter_definitions/kstar_hybrid.yaml +++ b/custom_components/solarman/inverter_definitions/kstar_hybrid.yaml @@ -23,7 +23,7 @@ requests: code: 0x03 parameters: - - group: solar + - group: PV items: - name: "PV1 Voltage" class: "voltage" @@ -263,7 +263,7 @@ parameters: - group: Battery items: - name: "Battery Type" - class: "battery" + class: "" state_class: "measurement" uom: "" scale: 1 @@ -303,7 +303,7 @@ parameters: registers: [3065] icon: "mdi:battery-charging-high" - - name: "Battery SoC" + - name: "Battery" class: "battery" state_class: "measurement" uom: "%" @@ -322,7 +322,7 @@ parameters: icon: "mdi:battery-heart-outline" - name: "Battery Discharge Capacity Depth" - class: "battery" + class: "" state_class: "measurement" uom: "%" scale: 1 @@ -463,7 +463,7 @@ parameters: - key: 0 value: "Initialize" - key: 1 - value: "Stand-by" + value: "Standby" - key: 2 value: "Hybrid Grid" - key: 3 @@ -490,7 +490,7 @@ parameters: value: "Permanent Error" icon: "mdi:wrench" - - name: "Inverter status" + - name: "Inverter Status" class: "" state_class: "measurement" uom: "" @@ -499,7 +499,7 @@ parameters: registers: [3047] lookup: - key: 0 - value: "Stand-by" + value: "Standby" - key: 1 value: "Off-Grid" - key: 2 @@ -510,7 +510,7 @@ parameters: value: "On-Grid to Off-Grid" icon: "mdi:wrench" - - name: "DCDC status" + - name: "DCDC Status" class: "" state_class: "measurement" uom: "" @@ -519,7 +519,7 @@ parameters: registers: [3048] lookup: - key: 0 - value: "Stand-by" + value: "Standby" - key: 1 value: "Soft Boot" - key: 2 @@ -639,7 +639,7 @@ parameters: registers: [3217] icon: "mdi:wrench" - - name: "Inverter SN Number" + - name: "Device Serial Number" class: "" state_class: "measurement" uom: "" diff --git a/custom_components/solarman/inverter_definitions/pylontech_Force-H.yaml b/custom_components/solarman/inverter_definitions/pylontech_Force-H.yaml index ad2ca87d..6f2b83fb 100644 --- a/custom_components/solarman/inverter_definitions/pylontech_Force-H.yaml +++ b/custom_components/solarman/inverter_definitions/pylontech_Force-H.yaml @@ -12,7 +12,7 @@ default: parameters: - group: Basic information items: - - name: "Device SN" + - name: "Device Serial Number" class: "" state_class: "" uom: "" @@ -111,7 +111,7 @@ parameters: registers: [5126] icon: "mdi:thermometer" - - name: "Battery Charge" + - name: "Battery" class: "battery" state_class: "measurement" uom: "%" @@ -300,7 +300,7 @@ parameters: registers: [5151] - name: "Battery Pack SOH" - class: "battery" + class: "" state_class: "measurement" uom: "%" scale: 1 diff --git a/custom_components/solarman/inverter_definitions/sofar_g3hyd.yaml b/custom_components/solarman/inverter_definitions/sofar_g3hyd.yaml index cbc031d8..3a13f3ee 100644 --- a/custom_components/solarman/inverter_definitions/sofar_g3hyd.yaml +++ b/custom_components/solarman/inverter_definitions/sofar_g3hyd.yaml @@ -248,7 +248,7 @@ parameters: - group: Battery items: - - name: "Battery 1 Voltage" + - name: "Battery Voltage" class: "voltage" state_class: "measurement" uom: "V" @@ -256,7 +256,7 @@ parameters: rule: 1 registers: [0x0604] icon: "mdi:battery" - - name: "Battery 1 Current" + - name: "Battery Current" class: "current" state_class: "measurement" uom: "A" @@ -264,7 +264,7 @@ parameters: rule: 2 registers: [0x0605] icon: "mdi:current-dc" - - name: "Battery 1 Power" + - name: "Battery Power" class: "power" state_class: "measurement" uom: "W" @@ -272,7 +272,7 @@ parameters: rule: 2 registers: [0x0606] icon: "mdi:battery-charging" - - name: "Battery 1 Temperature" + - name: "Battery Temperature" class: "temperature" state_class: "measurement" uom: "°C" @@ -280,7 +280,7 @@ parameters: rule: 2 registers: [0x0607] icon: "mdi:battery" - - name: "Battery 1 SOC" + - name: "Battery" class: "battery" state_class: "measurement" uom: "%" @@ -288,15 +288,15 @@ parameters: rule: 1 registers: [0x0608] icon: "mdi:battery" - - name: "Battery 1 SOH" - class: "battery" + - name: "Battery SOH" + class: "" state_class: "measurement" uom: "%" scale: 1 rule: 1 registers: [0x0609] icon: "mdi:battery" - - name: "Battery 1 Number of Cycles" + - name: "Battery Number of Cycles" class: "" state_class: "measurement" uom: "cycle" @@ -1360,7 +1360,7 @@ parameters: - key: 32 value: "ID150 Communication board FLASH error" - key: 64 - value: "ID151 " + value: "ID151" - key: 128 value: "ID152 Safety regulation version error" - key: 256 diff --git a/custom_components/solarman/inverter_definitions/sofar_hyd3k-6k-es.yaml b/custom_components/solarman/inverter_definitions/sofar_hyd3k-6k-es.yaml index db8b7fe3..9456188e 100644 --- a/custom_components/solarman/inverter_definitions/sofar_hyd3k-6k-es.yaml +++ b/custom_components/solarman/inverter_definitions/sofar_hyd3k-6k-es.yaml @@ -13,7 +13,7 @@ requests: code: 0x04 parameters: - - group: solar + - group: PV items: - name: "PV Instant Generated PW" class: "power" @@ -245,7 +245,7 @@ parameters: registers: [0x020F] icon: "mdi:battery-charging-10" - - name: "Battery Percentage" + - name: "Battery" class: "battery" state_class: "measurement" uom: "%" @@ -448,33 +448,43 @@ parameters: registers: [0x10BC] icon: "mdi:battery" - - group: Inverter + - group: Device items: - - name: "Inverter status" - class: "" + - name: "Device State" + class: "enum" uom: "" scale: 1 rule: 1 registers: [0x0200] isstr: true + options: + [ + "Standby", + "Self-test", + "Normal", + "Discharging Check", + "Discharging", + "EPS", + "Alarm", + "Fault", + ] lookup: - key: 0 - value: "Stand-by" + value: "Standby" - key: 1 - value: "Self-Checking" + value: "Self-test" - key: 2 value: "Normal" - key: 3 - value: "Discharging Check State" + value: "Discharging Check" - key: 4 - value: "Discharging State" + value: "Discharging" - key: 5 - value: "EPS State" + value: "EPS" - key: 6 - value: "Fault State" + value: "Alarm" - key: 7 - value: "Permanent State" - icon: "mdi:state-machine" + value: "Fault" - name: "Inverter module temperature" class: "temperature" diff --git a/custom_components/solarman/inverter_definitions/sofar_lsw3.yaml b/custom_components/solarman/inverter_definitions/sofar_lsw3.yaml index bd622f02..72b11569 100644 --- a/custom_components/solarman/inverter_definitions/sofar_lsw3.yaml +++ b/custom_components/solarman/inverter_definitions/sofar_lsw3.yaml @@ -3,7 +3,7 @@ default: digits: 6 parameters: - - group: solar + - group: PV items: - name: "PV1 Power" class: "power" @@ -179,27 +179,27 @@ parameters: registers: [0x0014] icon: "mdi:home-lightning-bolt" - - group: Inverter + - group: Device items: - - name: "Inverter status" - class: "" - state_class: "measurement" + - name: "Device State" + class: "enum" + state_class: "" uom: "" scale: 1 rule: 1 registers: [0x0000] + options: ["Standby", "Self-test", "Normal", "Alarm", "Fault"] lookup: - - key: 0 - value: "Stand-by" - - key: 1 - value: "Self-checking" - - key: 2 + - key: 0x0000 + value: "Standby" + - key: 0x0001 + value: "Self-test" + - key: 0x0002 value: "Normal" - - key: 3 - value: "FAULT" - - key: 4 - value: "Permanent" - icon: "mdi:wrench" + - key: 0x0003 + value: "Alarm" + - key: 0x0004 + value: "Fault" - name: "Inverter module temperature" class: "temperature" diff --git a/custom_components/solarman/inverter_definitions/sofar_wifikit.yaml b/custom_components/solarman/inverter_definitions/sofar_wifikit.yaml index 7700a452..8f1fd778 100644 --- a/custom_components/solarman/inverter_definitions/sofar_wifikit.yaml +++ b/custom_components/solarman/inverter_definitions/sofar_wifikit.yaml @@ -223,7 +223,7 @@ parameters: registers: [0x020D] icon: "mdi:home-battery" - - name: "Battery SOC" + - name: "Battery" class: "battery" state_class: "measurement" uom: "%" @@ -287,7 +287,7 @@ parameters: icon: "mdi:current-dc" - name: "Battery Discharge Depth" - class: "battery" + class: "" state_class: "measurement" uom: "%" scale: 1 diff --git a/custom_components/solarman/inverter_definitions/solis_1p8k-5g.yaml b/custom_components/solarman/inverter_definitions/solis_1p8k-5g.yaml index 16b2bcaf..589c6c98 100644 --- a/custom_components/solarman/inverter_definitions/solis_1p8k-5g.yaml +++ b/custom_components/solarman/inverter_definitions/solis_1p8k-5g.yaml @@ -80,7 +80,7 @@ default: # Working Status Bit decode - name: "WStatus Normal" - class: "running" + class: "" state_class: "" uom: "" mask: 0x01 @@ -225,7 +225,7 @@ default: registers: [3001] isstr: true - - group: InverterDC + - group: PV items: - name: "PV1 Voltage" class: "voltage" diff --git a/custom_components/solarman/inverter_definitions/solis_3p-5g.yaml b/custom_components/solarman/inverter_definitions/solis_3p-5g.yaml index 6e392905..5f739d7c 100644 --- a/custom_components/solarman/inverter_definitions/solis_3p-5g.yaml +++ b/custom_components/solarman/inverter_definitions/solis_3p-5g.yaml @@ -716,7 +716,7 @@ parameters: - group: Battery items: - - name: "Battery Status" + - name: "Battery State" class: "" state_class: "measurement" uom: "" @@ -726,9 +726,11 @@ parameters: isstr: true lookup: - key: 0 - value: "Charge" + value: "charging" - key: 1 - value: "Discharge" + value: "discharging" + - key: "default" + value: "idle" icon: "mdi:battery" - name: "Battery Power" @@ -740,7 +742,7 @@ parameters: registers: [33150, 33149] icon: "mdi:battery-charging" - - name: "Battery SOC" + - name: "Battery" class: "battery" state_class: "measurement" uom: "%" @@ -750,7 +752,7 @@ parameters: icon: "mdi:battery" - name: "Battery SOH" - class: "battery" + class: "" state_class: "measurement" uom: "%" scale: 1 diff --git a/custom_components/solarman/inverter_definitions/solis_hybrid.yaml b/custom_components/solarman/inverter_definitions/solis_hybrid.yaml index 23f16353..f7604312 100644 --- a/custom_components/solarman/inverter_definitions/solis_hybrid.yaml +++ b/custom_components/solarman/inverter_definitions/solis_hybrid.yaml @@ -696,7 +696,7 @@ parameters: - group: Battery items: - - name: "Battery Status" + - name: "Battery State" class: "" state_class: "measurement" uom: "" @@ -706,9 +706,11 @@ parameters: isstr: true lookup: - key: 0 - value: "Charge" + value: "charging" - key: 1 - value: "Discharge" + value: "discharging" + - key: "default" + value: "idle" icon: "mdi:battery" - name: "Battery Power" @@ -720,7 +722,7 @@ parameters: registers: [33150, 33149] icon: "mdi:battery-charging" - - name: "Battery SOC" + - name: "Battery" class: "battery" state_class: "measurement" uom: "%" @@ -730,7 +732,7 @@ parameters: icon: "mdi:battery" - name: "Battery SOH" - class: "battery" + class: "" state_class: "measurement" uom: "%" scale: 1 @@ -847,7 +849,7 @@ parameters: icon: "mdi:battery-arrow-down" - name: "Backup Mode SOC" - class: "battery" + class: "" state_class: "measurement" uom: "%" scale: 1 @@ -856,7 +858,7 @@ parameters: icon: "mdi:battery" - name: "Overdischarge SOC" - class: "battery" + class: "" state_class: "measurement" uom: "%" scale: 1 diff --git a/custom_components/solarman/inverter_definitions/zcs_azzurro-hyd-zss-hp.yaml b/custom_components/solarman/inverter_definitions/zcs_azzurro-hyd-zss-hp.yaml index 86ea1e46..bcdaa464 100644 --- a/custom_components/solarman/inverter_definitions/zcs_azzurro-hyd-zss-hp.yaml +++ b/custom_components/solarman/inverter_definitions/zcs_azzurro-hyd-zss-hp.yaml @@ -8,7 +8,7 @@ default: digits: 6 parameters: - - group: Solar + - group: PV items: - name: "Today Production" friendly_name: Today's Production @@ -103,7 +103,7 @@ parameters: registers: [0x0605] icon: "mdi:battery-charging-10" - - name: "Battery SoC" + - name: "Battery" class: "battery" state_class: "measurement" uom: "%" @@ -112,8 +112,8 @@ parameters: registers: [0x0608] icon: "mdi:battery" - - name: "Battery SoH" - class: "battery" + - name: "Battery SOH" + class: "" state_class: "measurement" uom: "%" scale: 1 @@ -291,27 +291,27 @@ parameters: registers: [0x0693, 0x0692] icon: "mdi:home-lightning-bolt" - - group: Inverter + - group: Device items: - - name: "Inverter status" - class: "" - state_class: "measurement" + - name: "Device State" + class: "enum" + state_class: "" uom: "" scale: 1 rule: 1 registers: [0x0404] + options: ["Standby", "Self-test", "Normal", "Alarm", "Fault"] lookup: - - key: 0 - value: "Stand-by" - - key: 1 - value: "Self-checking" - - key: 2 + - key: 0x0000 + value: "Standby" + - key: 0x0001 + value: "Self-test" + - key: 0x0002 value: "Normal" - - key: 3 - value: "FAULT" - - key: 4 - value: "Permanent" - icon: "mdi:wrench" + - key: 0x0003 + value: "Alarm" + - key: 0x0004 + value: "Fault" - name: "Module temperature" class: "temperature" diff --git a/custom_components/solarman/inverter_definitions/zcs_azzurro-ktl-v3.yaml b/custom_components/solarman/inverter_definitions/zcs_azzurro-ktl-v3.yaml index bce38c17..a6c17934 100644 --- a/custom_components/solarman/inverter_definitions/zcs_azzurro-ktl-v3.yaml +++ b/custom_components/solarman/inverter_definitions/zcs_azzurro-ktl-v3.yaml @@ -23,7 +23,7 @@ default: digits: 6 parameters: - - group: Solar + - group: PV items: - name: Today Production friendly_name: Today's Production @@ -172,27 +172,27 @@ parameters: registers: [0x04A4] icon: "mdi:solar-power" - - group: Inverter + - group: Device items: - - name: "Inverter status" - class: "" - state_class: "measurement" + - name: "Device State" + class: "enum" + state_class: "" uom: "" scale: 1 rule: 1 registers: [0x0404] + options: ["Standby", "Self-test", "Normal", "Alarm", "Fault"] lookup: - - key: 0 - value: "Stand-by" - - key: 1 - value: "Self-checking" - - key: 2 + - key: 0x0000 + value: "Standby" + - key: 0x0001 + value: "Self-test" + - key: 0x0002 value: "Normal" - - key: 3 - value: "FAULT" - - key: 4 - value: "Permanent" - icon: "mdi:wrench" + - key: 0x0003 + value: "Alarm" + - key: 0x0004 + value: "Fault" - name: "Module temperature" class: "temperature" diff --git a/info.md b/info.md index e5b03318..8c648221 100644 --- a/info.md +++ b/info.md @@ -24,7 +24,7 @@ > Implemented using asynchronous [pysolarmanv5](https://github.com/jmccrohan/pysolarmanv5) and fetching through [DataUpdateCoordinator](https://developers.home-assistant.io/docs/integration_fetching_data/) + incorporates many more fixes and improvements and also up to date features of HA (while trying to fully preserve backward compatibility) > [!WARNING] -> It's not possible to use this integration side by side (with the same device) with the implementation from Stephan! It will override it. +> It's not possible to install this integration side by side (with the same device) with the implementation from Stephan! It will be overwritten. ## 👤 Contributors diff --git a/readme.md b/readme.md index b3d9107e..153a8b6a 100644 --- a/readme.md +++ b/readme.md @@ -24,7 +24,7 @@ > Implemented using asynchronous [pysolarmanv5](https://github.com/jmccrohan/pysolarmanv5) and fetching through [DataUpdateCoordinator](https://developers.home-assistant.io/docs/integration_fetching_data/) + incorporates many more fixes and improvements and also up to date features of HA (while trying to fully preserve backward compatibility) > [!WARNING] -> It's not possible to use this integration side by side (with the same device) with the implementation from Stephan! It will override it. +> It's not possible to install this integration side by side (with the same device) with the implementation from Stephan! It will be overwritten. ## 🔨 Installation