diff --git a/homeassistant/components/fronius/icons.json b/homeassistant/components/fronius/icons.json index a84140617dd..59d5a110449 100644 --- a/homeassistant/components/fronius/icons.json +++ b/homeassistant/components/fronius/icons.json @@ -4,13 +4,13 @@ "current_dc": { "default": "mdi:current-dc" }, - "current_dc_2": { + "current_dc_mppt_no": { "default": "mdi:current-dc" }, "voltage_dc": { "default": "mdi:current-dc" }, - "voltage_dc_2": { + "voltage_dc_mppt_no": { "default": "mdi:current-dc" }, "co2_factor": { diff --git a/homeassistant/components/fronius/sensor.py b/homeassistant/components/fronius/sensor.py index c65f6072ba6..e287786aaa8 100644 --- a/homeassistant/components/fronius/sensor.py +++ b/homeassistant/components/fronius/sensor.py @@ -168,6 +168,26 @@ INVERTER_ENTITY_DESCRIPTIONS: list[FroniusSensorEntityDescription] = [ native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, + translation_key="current_dc_mppt_no", + translation_placeholders={"mppt_no": "2"}, + ), + FroniusSensorEntityDescription( + key="current_dc_3", + default_value=0, + native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, + device_class=SensorDeviceClass.CURRENT, + state_class=SensorStateClass.MEASUREMENT, + translation_key="current_dc_mppt_no", + translation_placeholders={"mppt_no": "3"}, + ), + FroniusSensorEntityDescription( + key="current_dc_4", + default_value=0, + native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, + device_class=SensorDeviceClass.CURRENT, + state_class=SensorStateClass.MEASUREMENT, + translation_key="current_dc_mppt_no", + translation_placeholders={"mppt_no": "4"}, ), FroniusSensorEntityDescription( key="power_ac", @@ -197,6 +217,26 @@ INVERTER_ENTITY_DESCRIPTIONS: list[FroniusSensorEntityDescription] = [ native_unit_of_measurement=UnitOfElectricPotential.VOLT, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, + translation_key="voltage_dc_mppt_no", + translation_placeholders={"mppt_no": "2"}, + ), + FroniusSensorEntityDescription( + key="voltage_dc_3", + default_value=0, + native_unit_of_measurement=UnitOfElectricPotential.VOLT, + device_class=SensorDeviceClass.VOLTAGE, + state_class=SensorStateClass.MEASUREMENT, + translation_key="voltage_dc_mppt_no", + translation_placeholders={"mppt_no": "3"}, + ), + FroniusSensorEntityDescription( + key="voltage_dc_4", + default_value=0, + native_unit_of_measurement=UnitOfElectricPotential.VOLT, + device_class=SensorDeviceClass.VOLTAGE, + state_class=SensorStateClass.MEASUREMENT, + translation_key="voltage_dc_mppt_no", + translation_placeholders={"mppt_no": "4"}, ), # device status entities FroniusSensorEntityDescription( @@ -727,7 +767,7 @@ class _FroniusSensorEntity(CoordinatorEntity["FroniusCoordinatorBase"], SensorEn self.response_key = description.response_key or description.key self.solar_net_id = solar_net_id self._attr_native_value = self._get_entity_value() - self._attr_translation_key = description.key + self._attr_translation_key = description.translation_key or description.key def _device_data(self) -> dict[str, Any]: """Extract information for SolarNet device from coordinator data.""" diff --git a/homeassistant/components/fronius/strings.json b/homeassistant/components/fronius/strings.json index 9cd3b7c8a54..e965e3117c5 100644 --- a/homeassistant/components/fronius/strings.json +++ b/homeassistant/components/fronius/strings.json @@ -52,8 +52,8 @@ "current_dc": { "name": "DC current" }, - "current_dc_2": { - "name": "DC current 2" + "current_dc_mppt_no": { + "name": "DC current {mppt_no}" }, "power_ac": { "name": "AC power" @@ -64,8 +64,8 @@ "voltage_dc": { "name": "DC voltage" }, - "voltage_dc_2": { - "name": "DC voltage 2" + "voltage_dc_mppt_no": { + "name": "DC voltage {mppt_no}" }, "inverter_state": { "name": "Inverter state" diff --git a/tests/components/fronius/snapshots/test_sensor.ambr b/tests/components/fronius/snapshots/test_sensor.ambr index 63d2c85986a..1c718910428 100644 --- a/tests/components/fronius/snapshots/test_sensor.ambr +++ b/tests/components/fronius/snapshots/test_sensor.ambr @@ -238,7 +238,7 @@ 'platform': 'fronius', 'previous_unique_id': None, 'supported_features': 0, - 'translation_key': 'current_dc_2', + 'translation_key': 'current_dc_mppt_no', 'unique_id': '12345678-current_dc_2', 'unit_of_measurement': , }) @@ -342,7 +342,7 @@ 'platform': 'fronius', 'previous_unique_id': None, 'supported_features': 0, - 'translation_key': 'voltage_dc_2', + 'translation_key': 'voltage_dc_mppt_no', 'unique_id': '12345678-voltage_dc_2', 'unit_of_measurement': , }) @@ -3798,7 +3798,7 @@ 'platform': 'fronius', 'previous_unique_id': None, 'supported_features': 0, - 'translation_key': 'current_dc_2', + 'translation_key': 'current_dc_mppt_no', 'unique_id': '12345678-current_dc_2', 'unit_of_measurement': , }) @@ -3902,7 +3902,7 @@ 'platform': 'fronius', 'previous_unique_id': None, 'supported_features': 0, - 'translation_key': 'voltage_dc_2', + 'translation_key': 'voltage_dc_mppt_no', 'unique_id': '12345678-voltage_dc_2', 'unit_of_measurement': , })