Skip to content

Commit

Permalink
Add Support AS1-3KS-5.1, fix unit_of_measurement
Browse files Browse the repository at this point in the history
  • Loading branch information
djansen1987 committed Nov 29, 2021
1 parent ed069f7 commit 023ef2a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ Saj Sec Module:
### **Storage Solar Inverter**<br>
##### *H1-3~6K-S2* <br>
##### *AS1-3KS-5.1* (use h1 sensors)<br>
<br>
Expand All @@ -206,7 +207,6 @@ Saj Sec Module:
<br>
### **Storage Solar Inverter**<br>
##### *AS1-3KS-5.1* (not tested) <br>
##### *B1-5.1-48* (not tested) <br>
<br><br>
Expand Down
13 changes: 13 additions & 0 deletions custom_components/saj_esolar/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
DEVICE_CLASS_POWER,
ENERGY_KILO_WATT_HOUR,
POWER_WATT,
PERCENTAGE,

)
from homeassistant.helpers.aiohttp_client import async_get_clientsession
Expand Down Expand Up @@ -187,6 +188,8 @@ def add_years(d, years):
key="totalConsumpElec",
name="totalConsumpElec",
icon="mdi:solar-panel",
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
device_class=DEVICE_CLASS_ENERGY,
),
SensorEntityDescription(
key="totalSellElec",
Expand Down Expand Up @@ -394,6 +397,7 @@ def add_years(d, years):
key="batCapcity",
name="batCapcity",
icon="mdi:solar-panel-large",
unit_of_measurement="A⋅h"
),
SensorEntityDescription(
key="batCurr",
Expand All @@ -404,16 +408,24 @@ def add_years(d, years):
key="batEnergyPercent",
name="batEnergyPercent",
icon="mdi:solar-panel-large",
native_unit_of_measurement=PERCENTAGE,
),
SensorEntityDescription(
key="batteryDirection",
name="batteryDirection",
icon="mdi:solar-panel-large",
),
SensorEntityDescription(
key="batteryPower",
name="batteryPower",
icon="mdi:solar-panel-large",
native_unit_of_measurement=POWER_WATT,
),
SensorEntityDescription(
key="gridPower",
name="gridPower",
icon="mdi:solar-panel-large",
native_unit_of_measurement=POWER_WATT,
),
SensorEntityDescription(
key="h1Online",
Expand All @@ -424,6 +436,7 @@ def add_years(d, years):
key="outPower",
name="outPower",
icon="mdi:solar-panel-large",
native_unit_of_measurement=POWER_WATT,
),
SensorEntityDescription(
key="outPutDirection",
Expand Down
2 changes: 1 addition & 1 deletion info.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ Saj Sec Module:
### **Storage Solar Inverter**<br>
##### *H1-3~6K-S2* <br>
##### *AS1-3KS-5.1* (use h1 sensors)<br>
<br>
Expand All @@ -206,7 +207,6 @@ Saj Sec Module:
<br>
### **Storage Solar Inverter**<br>
##### *AS1-3KS-5.1* (not tested) <br>
##### *B1-5.1-48* (not tested) <br>
<br><br>
Expand Down

0 comments on commit 023ef2a

Please sign in to comment.