Skip to content

Commit

Permalink
Merge pull request #608 from canton7/bugfix/aio-h3-work-mode-soc
Browse files Browse the repository at this point in the history
Add work mode / min/max soc back to AIO-H3
  • Loading branch information
canton7 authored Apr 28, 2024
2 parents 9a37ff2 + 8223f72 commit ce4c3dd
Show file tree
Hide file tree
Showing 2 changed files with 141 additions and 11 deletions.
22 changes: 11 additions & 11 deletions custom_components/foxess_modbus/entities/entity_descriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2111,7 +2111,7 @@ def _configuration_entities() -> Iterable[EntityFactory]:
key="work_mode",
address=[
ModbusAddressSpec(input=41000, models=Inv.H1_G1 | Inv.KH_PRE119),
ModbusAddressSpec(holding=41000, models=Inv.H1_G1 | Inv.H1_G2 | Inv.KH_119 | Inv.H3_SET & ~Inv.AIO_H3),
ModbusAddressSpec(holding=41000, models=Inv.H1_G1 | Inv.H1_G2 | Inv.KH_119 | Inv.H3_SET),
],
name="Work Mode",
options_map={0: "Self Use", 1: "Feed-in First", 2: "Back-up"},
Expand All @@ -2138,7 +2138,7 @@ def _configuration_entities() -> Iterable[EntityFactory]:
key="max_charge_current",
addresses=[
ModbusAddressesSpec(input=[41007], models=Inv.H1_G1 | Inv.KH_PRE119),
ModbusAddressesSpec(holding=[41007], models=Inv.H1_G1 | Inv.H1_G2 | Inv.KH_119 | Inv.H3_SET & ~Inv.AIO_H3),
ModbusAddressesSpec(holding=[41007], models=Inv.H1_G1 | Inv.H1_G2 | Inv.KH_119 | Inv.H3_SET),
ModbusAddressesSpec(holding=[46607], models=Inv.H3_PRO),
],
name="Max Charge Current",
Expand All @@ -2152,7 +2152,7 @@ def _configuration_entities() -> Iterable[EntityFactory]:
key="max_charge_current",
address=[
ModbusAddressSpec(input=41007, models=Inv.H1_G1 | Inv.KH_PRE119),
ModbusAddressSpec(holding=41007, models=Inv.H1_G1 | Inv.H1_G2 | Inv.KH_119 | Inv.H3_SET & ~Inv.AIO_H3),
ModbusAddressSpec(holding=41007, models=Inv.H1_G1 | Inv.H1_G2 | Inv.KH_119 | Inv.H3_SET),
ModbusAddressSpec(holding=46607, models=Inv.H3_PRO),
],
name="Max Charge Current",
Expand All @@ -2170,7 +2170,7 @@ def _configuration_entities() -> Iterable[EntityFactory]:
key="max_discharge_current",
addresses=[
ModbusAddressesSpec(input=[41008], models=Inv.H1_G1 | Inv.KH_PRE119),
ModbusAddressesSpec(holding=[41008], models=Inv.H1_G1 | Inv.H1_G2 | Inv.KH_119 | Inv.H3_SET & ~Inv.AIO_H3),
ModbusAddressesSpec(holding=[41008], models=Inv.H1_G1 | Inv.H1_G2 | Inv.KH_119 | Inv.H3_SET),
ModbusAddressesSpec(holding=[46608], models=Inv.H3_PRO),
],
name="Max Discharge Current",
Expand All @@ -2184,7 +2184,7 @@ def _configuration_entities() -> Iterable[EntityFactory]:
key="max_discharge_current",
address=[
ModbusAddressSpec(input=41008, models=Inv.H1_G1 | Inv.KH_PRE119),
ModbusAddressSpec(holding=41008, models=Inv.H1_G1 | Inv.H1_G2 | Inv.KH_119 | Inv.H3_SET & ~Inv.AIO_H3),
ModbusAddressSpec(holding=41008, models=Inv.H1_G1 | Inv.H1_G2 | Inv.KH_119 | Inv.H3_SET),
ModbusAddressSpec(holding=46608, models=Inv.H3_PRO),
],
name="Max Discharge Current",
Expand All @@ -2203,7 +2203,7 @@ def _configuration_entities() -> Iterable[EntityFactory]:
key="min_soc",
addresses=[
ModbusAddressesSpec(input=[41009], models=Inv.H1_G1 | Inv.KH_PRE119),
ModbusAddressesSpec(holding=[41009], models=Inv.H1_G1 | Inv.H1_G2 | Inv.KH_119 | Inv.H3_SET & ~Inv.AIO_H3),
ModbusAddressesSpec(holding=[41009], models=Inv.H1_G1 | Inv.H1_G2 | Inv.KH_119 | Inv.H3_SET),
ModbusAddressesSpec(holding=[46609], models=Inv.H3_PRO),
],
name="Min SoC",
Expand All @@ -2217,7 +2217,7 @@ def _configuration_entities() -> Iterable[EntityFactory]:
key="min_soc",
address=[
ModbusAddressSpec(input=41009, models=Inv.H1_G1 | Inv.KH_PRE119),
ModbusAddressSpec(holding=41009, models=Inv.H1_G1 | Inv.H1_G2 | Inv.KH_119 | Inv.H3_SET & ~Inv.AIO_H3),
ModbusAddressSpec(holding=41009, models=Inv.H1_G1 | Inv.H1_G2 | Inv.KH_119 | Inv.H3_SET),
ModbusAddressSpec(holding=46609, models=Inv.H3_PRO),
],
name="Min SoC",
Expand All @@ -2236,7 +2236,7 @@ def _configuration_entities() -> Iterable[EntityFactory]:
key="max_soc",
addresses=[
ModbusAddressesSpec(input=[41010], models=Inv.H1_G1 | Inv.KH_PRE119),
ModbusAddressesSpec(holding=[41010], models=Inv.H1_G1 | Inv.H1_G2 | Inv.KH_119 | Inv.H3_SET & ~Inv.AIO_H3),
ModbusAddressesSpec(holding=[41010], models=Inv.H1_G1 | Inv.H1_G2 | Inv.KH_119 | Inv.H3_SET),
ModbusAddressesSpec(holding=[46610], models=Inv.H3_PRO),
],
name="Max SoC",
Expand All @@ -2250,7 +2250,7 @@ def _configuration_entities() -> Iterable[EntityFactory]:
key="max_soc",
address=[
ModbusAddressSpec(input=41010, models=Inv.H1_G1 | Inv.KH_PRE119),
ModbusAddressSpec(holding=41010, models=Inv.H1_G1 | Inv.H1_G2 | Inv.KH_119 | Inv.H3_SET & ~Inv.AIO_H3),
ModbusAddressSpec(holding=41010, models=Inv.H1_G1 | Inv.H1_G2 | Inv.KH_119 | Inv.H3_SET),
ModbusAddressSpec(holding=46610, models=Inv.H3_PRO),
],
name="Max SoC",
Expand All @@ -2269,7 +2269,7 @@ def _configuration_entities() -> Iterable[EntityFactory]:
key="min_soc_on_grid",
addresses=[
ModbusAddressesSpec(input=[41011], models=Inv.H1_G1 | Inv.KH_PRE119),
ModbusAddressesSpec(holding=[41011], models=Inv.H1_G1 | Inv.H1_G2 | Inv.KH_119 | Inv.H3_SET & ~Inv.AIO_H3),
ModbusAddressesSpec(holding=[41011], models=Inv.H1_G1 | Inv.H1_G2 | Inv.KH_119 | Inv.H3_SET),
ModbusAddressesSpec(holding=[46611], models=Inv.H3_PRO),
],
name="Min SoC (On Grid)",
Expand All @@ -2283,7 +2283,7 @@ def _configuration_entities() -> Iterable[EntityFactory]:
key="min_soc_on_grid",
address=[
ModbusAddressSpec(input=41011, models=Inv.H1_G1 | Inv.KH_PRE119),
ModbusAddressSpec(holding=41011, models=Inv.H1_G1 | Inv.H1_G2 | Inv.KH_119 | Inv.H3_SET & ~Inv.AIO_H3),
ModbusAddressSpec(holding=41011, models=Inv.H1_G1 | Inv.H1_G2 | Inv.KH_119 | Inv.H3_SET),
ModbusAddressSpec(holding=46611, models=Inv.H3_PRO),
],
name="Min SoC (On Grid)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,121 @@
"name": "Version: Master",
"type": "sensor"
},
{
"addresses": {
"holding": [
41007
]
},
"key": "max_charge_current",
"name": "Max Charge Current",
"scale": 0.1,
"signed": true,
"type": "sensor"
},
{
"addresses": {
"holding": [
41007
]
},
"key": "max_charge_current",
"name": "Max Charge Current",
"scale": 0.1,
"type": "number"
},
{
"addresses": {
"holding": [
41008
]
},
"key": "max_discharge_current",
"name": "Max Discharge Current",
"scale": 0.1,
"signed": true,
"type": "sensor"
},
{
"addresses": {
"holding": [
41008
]
},
"key": "max_discharge_current",
"name": "Max Discharge Current",
"scale": 0.1,
"type": "number"
},
{
"addresses": {
"holding": [
41010
]
},
"key": "max_soc",
"name": "Max SoC",
"scale": null,
"signed": true,
"type": "sensor"
},
{
"addresses": {
"holding": [
41010
]
},
"key": "max_soc",
"name": "Max SoC",
"scale": null,
"type": "number"
},
{
"addresses": {
"holding": [
41009
]
},
"key": "min_soc",
"name": "Min SoC",
"scale": null,
"signed": true,
"type": "sensor"
},
{
"addresses": {
"holding": [
41009
]
},
"key": "min_soc",
"name": "Min SoC",
"scale": null,
"type": "number"
},
{
"addresses": {
"holding": [
41011
]
},
"key": "min_soc_on_grid",
"name": "Min SoC (On Grid)",
"scale": null,
"signed": true,
"type": "sensor"
},
{
"addresses": {
"holding": [
41011
]
},
"key": "min_soc_on_grid",
"name": "Min SoC (On Grid)",
"scale": null,
"type": "number"
},
{
"addresses": {
"holding": [
Expand Down Expand Up @@ -907,5 +1022,20 @@
"scale": 0.1,
"signed": false,
"type": "sensor"
},
{
"addresses": {
"holding": [
41000
]
},
"key": "work_mode",
"name": "Work Mode",
"type": "select",
"values": {
"0": "Self Use",
"1": "Feed-in First",
"2": "Back-up"
}
}
]

0 comments on commit ce4c3dd

Please sign in to comment.