Skip to content

Commit

Permalink
added 'wallbox_min_charging_current' & 'wallbox_set_icmax'
Browse files Browse the repository at this point in the history
  • Loading branch information
marq24 committed Oct 2, 2023
1 parent 7bec88f commit ce5a82b
Show file tree
Hide file tree
Showing 2 changed files with 131 additions and 1 deletion.
80 changes: 80 additions & 0 deletions custom_components/senec/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -1847,6 +1847,26 @@ class ExtBinarySensorEntityDescription(BinarySensorEntityDescription):
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.MEASUREMENT,
),
ExtSensorEntityDescription(
senec_lala_section=SENEC_SECTION_WALLBOX,
entity_registry_enabled_default=False,
key="wallbox_min_charging_current",
name="Wallbox MIN charging current",
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
icon="mdi:current-dc",
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.MEASUREMENT,
),
ExtSensorEntityDescription(
senec_lala_section=SENEC_SECTION_WALLBOX,
entity_registry_enabled_default=False,
key="wallbox_set_icmax",
name="Wallbox set ICMAX",
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
icon="mdi:current-dc",
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.MEASUREMENT,
),

ExtSensorEntityDescription(
senec_lala_section=SENEC_SECTION_WALLBOX,
Expand Down Expand Up @@ -1906,6 +1926,26 @@ class ExtBinarySensorEntityDescription(BinarySensorEntityDescription):
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.MEASUREMENT,
),
ExtSensorEntityDescription(
senec_lala_section=SENEC_SECTION_WALLBOX,
entity_registry_enabled_default=False,
key="wallbox_2_min_charging_current",
name="Wallbox II MIN charging current",
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
icon="mdi:current-dc",
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.MEASUREMENT,
),
ExtSensorEntityDescription(
senec_lala_section=SENEC_SECTION_WALLBOX,
entity_registry_enabled_default=False,
key="wallbox_2_set_icmax",
name="Wallbox II set ICMAX",
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
icon="mdi:current-dc",
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.MEASUREMENT,
),

ExtSensorEntityDescription(
senec_lala_section=SENEC_SECTION_WALLBOX,
Expand Down Expand Up @@ -1965,6 +2005,26 @@ class ExtBinarySensorEntityDescription(BinarySensorEntityDescription):
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.MEASUREMENT,
),
ExtSensorEntityDescription(
senec_lala_section=SENEC_SECTION_WALLBOX,
entity_registry_enabled_default=False,
key="wallbox_3_min_charging_current",
name="Wallbox III MIN charging current",
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
icon="mdi:current-dc",
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.MEASUREMENT,
),
ExtSensorEntityDescription(
senec_lala_section=SENEC_SECTION_WALLBOX,
entity_registry_enabled_default=False,
key="wallbox_3_set_icmax",
name="Wallbox III set ICMAX",
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
icon="mdi:current-dc",
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.MEASUREMENT,
),

ExtSensorEntityDescription(
senec_lala_section=SENEC_SECTION_WALLBOX,
Expand Down Expand Up @@ -2024,6 +2084,26 @@ class ExtBinarySensorEntityDescription(BinarySensorEntityDescription):
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.MEASUREMENT,
),
ExtSensorEntityDescription(
senec_lala_section=SENEC_SECTION_WALLBOX,
entity_registry_enabled_default=False,
key="wallbox_4_min_charging_current",
name="Wallbox IV MIN charging current",
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
icon="mdi:current-dc",
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.MEASUREMENT,
),
ExtSensorEntityDescription(
senec_lala_section=SENEC_SECTION_WALLBOX,
entity_registry_enabled_default=False,
key="wallbox_4_set_icmax",
name="Wallbox IV set ICMAX",
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
icon="mdi:current-dc",
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.MEASUREMENT,
),
]

INVERTER_SENSOR_TYPES = [
Expand Down
52 changes: 51 additions & 1 deletion custom_components/senec/pysenec_ha/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1066,6 +1066,18 @@ def wallbox_l3_charging_current(self) -> float:
SENEC_SECTION_WALLBOX]:
return self._raw[SENEC_SECTION_WALLBOX]["L3_CHARGING_CURRENT"][0]

@property
def wallbox_min_charging_current(self) -> float:
if hasattr(self, '_raw') and SENEC_SECTION_WALLBOX in self._raw and "MIN_CHARGING_CURRENT" in self._raw[
SENEC_SECTION_WALLBOX]:
return self._raw[SENEC_SECTION_WALLBOX]["MIN_CHARGING_CURRENT"][0]

@property
def wallbox_set_icmax(self) -> float:
if hasattr(self, '_raw') and SENEC_SECTION_WALLBOX in self._raw and "SET_ICMAX" in self._raw[
SENEC_SECTION_WALLBOX]:
return self._raw[SENEC_SECTION_WALLBOX]["SET_ICMAX"][0]

@property
def wallbox_2_power(self) -> float:
"""
Expand Down Expand Up @@ -1142,6 +1154,18 @@ def wallbox_2_l3_charging_current(self) -> float:
SENEC_SECTION_WALLBOX]:
return self._raw[SENEC_SECTION_WALLBOX]["L3_CHARGING_CURRENT"][1]

@property
def wallbox_2_min_charging_current(self) -> float:
if hasattr(self, '_raw') and SENEC_SECTION_WALLBOX in self._raw and "MIN_CHARGING_CURRENT" in self._raw[
SENEC_SECTION_WALLBOX]:
return self._raw[SENEC_SECTION_WALLBOX]["MIN_CHARGING_CURRENT"][1]

@property
def wallbox_2_set_icmax(self) -> float:
if hasattr(self, '_raw') and SENEC_SECTION_WALLBOX in self._raw and "SET_ICMAX" in self._raw[
SENEC_SECTION_WALLBOX]:
return self._raw[SENEC_SECTION_WALLBOX]["SET_ICMAX"][1]

@property
def wallbox_3_power(self) -> float:
"""
Expand Down Expand Up @@ -1218,6 +1242,18 @@ def wallbox_3_l3_charging_current(self) -> float:
SENEC_SECTION_WALLBOX]:
return self._raw[SENEC_SECTION_WALLBOX]["L3_CHARGING_CURRENT"][2]

@property
def wallbox_3_min_charging_current(self) -> float:
if hasattr(self, '_raw') and SENEC_SECTION_WALLBOX in self._raw and "MIN_CHARGING_CURRENT" in self._raw[
SENEC_SECTION_WALLBOX]:
return self._raw[SENEC_SECTION_WALLBOX]["MIN_CHARGING_CURRENT"][2]

@property
def wallbox_3_set_icmax(self) -> float:
if hasattr(self, '_raw') and SENEC_SECTION_WALLBOX in self._raw and "SET_ICMAX" in self._raw[
SENEC_SECTION_WALLBOX]:
return self._raw[SENEC_SECTION_WALLBOX]["SET_ICMAX"][2]

@property
def wallbox_4_power(self) -> float:
"""
Expand Down Expand Up @@ -1294,6 +1330,18 @@ def wallbox_4_l3_charging_current(self) -> float:
SENEC_SECTION_WALLBOX]:
return self._raw[SENEC_SECTION_WALLBOX]["L3_CHARGING_CURRENT"][3]

@property
def wallbox_4_min_charging_current(self) -> float:
if hasattr(self, '_raw') and SENEC_SECTION_WALLBOX in self._raw and "MIN_CHARGING_CURRENT" in self._raw[
SENEC_SECTION_WALLBOX]:
return self._raw[SENEC_SECTION_WALLBOX]["MIN_CHARGING_CURRENT"][3]

@property
def wallbox_4_set_icmax(self) -> float:
if hasattr(self, '_raw') and SENEC_SECTION_WALLBOX in self._raw and "SET_ICMAX" in self._raw[
SENEC_SECTION_WALLBOX]:
return self._raw[SENEC_SECTION_WALLBOX]["SET_ICMAX"][3]

@property
def fan_inv_lv(self) -> bool:
if hasattr(self, '_raw') and SENEC_SECTION_FAN_SPEED in self._raw and "INV_LV" in self._raw[
Expand Down Expand Up @@ -1411,7 +1459,9 @@ async def read_senec_v31(self):
"L2_USED": "",
"L3_CHARGING_CURRENT": "",
"L3_USED": "",
"EV_CONNECTED": ""}
"EV_CONNECTED": "",
"MIN_CHARGING_CURRENT": "",
"SET_ICMAX": ""}
})

async with self.websession.post(self.url, json=form, ssl=False) as res:
Expand Down

0 comments on commit ce5a82b

Please sign in to comment.