Compare commits

..
11 Commits
Author SHA1 Message Date
Patrick762 9df2073585 Merge pull request #96 from KM011092/dev
Additional EP600 values
2024-04-28 17:33:31 +02:00
KM011092 2c6df77078 Deleted .idea directory 2024-04-28 17:31:03 +02:00
KM011092 e584d32037 Additional EP600 values
Added Consumption and Grid, Consumption and Solar in Totals
2024-04-19 11:41:43 +02:00
Patrick762 0cd5ae10fb Merge pull request #87 from Patrick762/pack-polling-fix
Fix writeable_ranges for pack_polling
2024-04-01 14:13:48 +02:00
Patrick762 a93b80796a increase version number 2024-04-01 14:11:24 +02:00
Patrick762 a7967e74dd fix writeable_ranges for ac500, ac300, ep500 and ep500p 2024-04-01 14:08:42 +02:00
Patrick762 5bd98d6de3 Merge pull request #86 from Patrick762/ac200l
Ac200l support and manifest fix
2024-04-01 12:41:23 +02:00
Patrick762 2a4c3e943c updated manifest version 2024-04-01 12:37:48 +02:00
Patrick762 dcfebb0f84 added untested AC200L support based on AC200M 2024-04-01 12:37:22 +02:00
Patrick762 44dbd2b965 Merge pull request #85 from Patrick762/manifest-fix
fix dependency for bt adapters
2024-04-01 12:29:54 +02:00
Patrick762 89928e2d9c fix dependency for bt adapters 2024-04-01 12:29:01 +02:00
10 changed files with 112 additions and 7 deletions

No files matched your search

+1
View File
@@ -19,6 +19,7 @@ After the installation, you can use this button to install the integration:
- AC60
- AC180 (basic data)
- AC180P (basic data)
- AC200L (untested)
- AC200M
- AC300 (tested)
- AC500
@@ -0,0 +1,59 @@
"""AC200L fields."""
from typing import List
from ..utils.commands import ReadHoldingRegisters
from ..field_enums import AutoSleepMode, OutputMode
from ..base_devices.ProtocolV1Device import ProtocolV1Device
class AC200L(ProtocolV1Device):
def __init__(self, address: str, sn: str):
super().__init__(address, "AC200L", sn)
# Details
self.struct.add_enum_field("ac_output_mode", 70, OutputMode)
self.struct.add_decimal_field("internal_ac_voltage", 71, 1)
self.struct.add_decimal_field("internal_current_one", 72, 1)
self.struct.add_uint_field("internal_power_one", 73)
self.struct.add_decimal_field("internal_ac_frequency", 74, 2)
self.struct.add_uint_field("internal_dc_input_voltage", 86)
self.struct.add_decimal_field("internal_dc_input_power", 87, 1)
self.struct.add_decimal_field("internal_dc_input_current", 88, 2)
# Battery packs
self.struct.add_uint_field("pack_num_max", 91) # internal
self.struct.add_decimal_field("total_battery_voltage", 92, 1)
self.struct.add_uint_field("pack_num", 96) # internal
self.struct.add_decimal_field("pack_voltage", 98, 2) # Full pack voltage
self.struct.add_uint_field("pack_battery_percent", 99)
self.struct.add_decimal_array_field("cell_voltages", 105, 16, 2) # internal
# Controls
self.struct.add_bool_field("power_off", 3060)
self.struct.add_enum_field("auto_sleep_mode", 3061, AutoSleepMode)
@property
def pack_num_max(self):
return 3
@property
def polling_commands(self) -> List[ReadHoldingRegisters]:
return super().polling_commands + [
ReadHoldingRegisters(70, 5),
ReadHoldingRegisters(86, 3),
ReadHoldingRegisters(3060, 2),
]
@property
def writable_ranges(self) -> List[range]:
return super().writable_ranges + [range(3060, 3062)]
@property
def pack_polling_commands(self) -> List[ReadHoldingRegisters]:
return [
ReadHoldingRegisters(91, 2),
ReadHoldingRegisters(96, 1),
ReadHoldingRegisters(98, 2),
ReadHoldingRegisters(105, 16)
]
@@ -69,7 +69,7 @@ class AC300(ProtocolV1Device):
def writable_ranges(self) -> List[range]:
return super().writable_ranges + [
range(3001, 3017),
range(3061),
range(3061, 3062),
]
@property
@@ -68,7 +68,7 @@ class AC500(ProtocolV1Device):
def writable_ranges(self) -> List[range]:
return super().writable_ranges + [
range(3001, 3017),
range(3061),
range(3061, 3062),
]
@property
@@ -64,7 +64,7 @@ class EP500(ProtocolV1Device):
def writable_ranges(self) -> List[range]:
return super().writable_ranges + [
range(3001, 3017),
range(3061),
range(3061, 3062),
]
@property
@@ -64,7 +64,7 @@ class EP500P(ProtocolV1Device):
def writable_ranges(self) -> List[range]:
return super().writable_ranges + [
range(3001, 3017),
range(3061),
range(3061, 3062),
]
@property
@@ -62,6 +62,22 @@ class EP600(ProtocolV2Device):
self.struct.add_decimal_field("ac_output_current_phase2", 1519, 1)
self.struct.add_decimal_field("ac_output_current_phase3", 1526, 1)
# KM - Consumption
self.struct.add_int_field("consumption_power_phase1", 1430)
self.struct.add_int_field("consumption_power_phase2", 1436)
self.struct.add_int_field("consumption_power_phase3", 1442)
self.struct.add_decimal_field("consumption_voltage_phase1", 1431, 1)
self.struct.add_decimal_field("consumption_voltage_phase2", 1437, 1)
self.struct.add_decimal_field("consumption_voltage_phase3", 1443, 1)
self.struct.add_decimal_field("consumption_current_phase1", 1432, 1)
self.struct.add_decimal_field("consumption_current_phase2", 1438, 1)
self.struct.add_decimal_field("consumption_current_phase3", 1444, 1)
# KM - Totals
self.struct.add_uint_field('pv_input_power_all', 144) # Total PV in
self.struct.add_uint_field('consumption_power_all', 142) # Total AC out
self.struct.add_uint_field('grid_power_all', 146) # Total Grid in - value only +/- unknown
# Statistics
self.struct.add_decimal_field(
"total_ac_consumption", 152, 1
@@ -100,4 +116,9 @@ class EP600(ProtocolV2Device):
ReadHoldingRegisters(152, 1),
ReadHoldingRegisters(156, 1),
ReadHoldingRegisters(158, 1),
# KM - Consumption
ReadHoldingRegisters(1430, 15),
# KM - Totals
ReadHoldingRegisters(142, 5),
]
@@ -217,6 +217,26 @@ FIELD_ATTRIBUTES: dict[str, FieldAttributes] = {
"total_ac_consumption": EnergyFieldAttributes("Total Load Consumption"),
"total_grid_consumption": EnergyFieldAttributes("Total Grid Consumption"),
"total_grid_feed": EnergyFieldAttributes("Total Grid Feed"),
# KM - Consumption
"consumption_power_phase1": PowerFieldAttributes("Consumption Power Phase 1"),
"consumption_power_phase2": PowerFieldAttributes("Consumption Power Phase 2"),
"consumption_power_phase3": PowerFieldAttributes("Consumption Power Phase 3"),
"consumption_voltage_phase1": VoltageFieldAttributes("Consumption Voltage Phase 1"),
"consumption_voltage_phase2": VoltageFieldAttributes("Consumption Voltage Phase 2"),
"consumption_voltage_phase3": VoltageFieldAttributes("Consumption Voltage Phase 3"),
"consumption_current_phase1": CurrentFieldAttributes("Consumption Current Phase 1"),
"consumption_current_phase2": CurrentFieldAttributes("Consumption Current Phase 2"),
"consumption_current_phase3": CurrentFieldAttributes("Consumption Current Phase 3"),
# KM - Consumption end
# KM - Totals
"pv_input_power_all": PowerFieldAttributes("PV Input Power All"),
"consumption_power_all": PowerFieldAttributes("Consumption Power All"),
"grid_power_all": PowerFieldAttributes("Grid Power All"),
# KM - Totals end
# Device specific controls
"power_off": FieldAttributes(
type=FieldType.BOOL,
@@ -5,6 +5,7 @@ import re
from ..devices.ac60 import AC60
from ..devices.ac180 import AC180
from ..devices.ac180p import AC180P
from ..devices.ac200l import AC200L
from ..devices.ac200m import AC200M
from ..devices.ac300 import AC300
from ..devices.ac500 import AC500
@@ -16,7 +17,7 @@ from ..devices.ep760 import EP760
from ..devices.ep800 import EP800
DEVICE_NAME_RE = re.compile(
r"^(AC60|AC180|AC180P|AC200M|AC300|AC500|EB3A|EP500|EP500P|EP600|EP760|EP800)(\d+)$"
r"^(AC60|AC180|AC180P|AC200L|AC200M|AC300|AC500|EB3A|EP500|EP500P|EP600|EP760|EP800)(\d+)$"
)
@@ -28,6 +29,8 @@ def build_device(address: str, name: str):
return AC180(address, match[2])
if match[1] == "AC180P":
return AC180P(address, match[2])
if match[1] == "AC200L":
return AC200L(address, match[2])
if match[1] == "AC200M":
return AC200M(address, match[2])
if match[1] == "AC300":
+3 -2
View File
@@ -4,6 +4,7 @@
"bluetooth": [
{ "local_name": "AC60*" },
{ "local_name": "AC180*" },
{ "local_name": "AC200L*" },
{ "local_name": "AC200M*" },
{ "local_name": "AC300*" },
{ "local_name": "AC500*" },
@@ -16,11 +17,11 @@
],
"codeowners": ["@Patrick762"],
"config_flow": true,
"dependencies": ["bluetooth"],
"dependencies": ["bluetooth_adapters"],
"documentation": "https://github.com/Patrick762/hassio-bluetti-bt",
"integration_type": "device",
"iot_class": "local_polling",
"issue_tracker": "https://github.com/Patrick762/hassio-bluetti-bt/issues",
"requirements": [],
"version": "0.0.21"
"version": "0.0.23"
}