From aab7cd80644f08036f8f24f4a01926762a954411 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anderson=20Gul=C3=A3o?= Date: Fri, 18 Jul 2025 13:59:54 -0300 Subject: [PATCH 1/4] Add daily_yield to ENERGY_SENSORS and power_fraction to a new sensor group called POWER_FACTOR_SENSORS. This power_fraction Indicates the ratio between the generated power and the installed power. --- custom_components/isolarcloud/sensor.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/custom_components/isolarcloud/sensor.py b/custom_components/isolarcloud/sensor.py index 79198fd..bbbeb9a 100644 --- a/custom_components/isolarcloud/sensor.py +++ b/custom_components/isolarcloud/sensor.py @@ -39,11 +39,13 @@ "total_purchased_energy", "total_load_consumption", "total_yield", - "total_direct_energy_consumption", + "total_direct_energy_consumption," + "daily_yield" ] POWER_SENSORS = ["power", "load_power"] BATTERY_SENSORS = ["battery_level_soc"] -ALL_SENSORS = ENERGY_SENSORS + POWER_SENSORS + BATTERY_SENSORS +POWER_FACTOR_SENSORS = ["power_fraction"] +ALL_SENSORS = ENERGY_SENSORS + POWER_SENSORS + BATTERY_SENSORS + POWER_FACTOR_SENSORS def unit_of(sensor: str): @@ -54,6 +56,8 @@ def unit_of(sensor: str): return UnitOfPower.WATT if sensor in BATTERY_SENSORS: return PERCENTAGE + if sensor in POWER_FACTOR_SENSORS: + return PERCENTAGE return None @@ -96,6 +100,12 @@ async def async_setup_entry( coordinator, device, plant, s, SensorDeviceClass.BATTERY ) for s in BATTERY_SENSORS + ] + + [ + ISolarCloudSensor( + coordinator, device, plant, s, SensorDeviceClass.POWER_FACTOR + ) + for s in POWER_FACTOR_SENSORS ], ) return True @@ -133,6 +143,9 @@ def __init__( elif sensor_type == SensorDeviceClass.BATTERY: self._attr_state_class = SensorStateClass.MEASUREMENT self._value_transform = lambda v: v * 100.0 + elif sensor_type == SensorDeviceClass.POWER_FACTOR: + self._attr_state_class = SensorStateClass.MEASUREMENT + self._value_transform = lambda v: v * 100.0 else: self._value_transform = lambda v: v From 0ce1105d0702e46e5bebed50bdf3dc092a1a322f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anderson=20Gul=C3=A3o?= Date: Fri, 18 Jul 2025 14:35:06 -0300 Subject: [PATCH 2/4] Fixed error in ENERGY_SENSORS This commit updates the existing English and German translation files and includes new Portuguese translations for the iSolarCloud integration. --- custom_components/isolarcloud/sensor.py | 2 +- .../isolarcloud/translations/da.json | 6 ++ .../isolarcloud/translations/en.json | 6 ++ .../isolarcloud/translations/pt.json | 91 +++++++++++++++++++ .../isolarcloud/translations/services.pt.json | 26 ++++++ 5 files changed, 130 insertions(+), 1 deletion(-) create mode 100644 custom_components/isolarcloud/translations/pt.json create mode 100644 custom_components/isolarcloud/translations/services.pt.json diff --git a/custom_components/isolarcloud/sensor.py b/custom_components/isolarcloud/sensor.py index bbbeb9a..bd326bd 100644 --- a/custom_components/isolarcloud/sensor.py +++ b/custom_components/isolarcloud/sensor.py @@ -39,7 +39,7 @@ "total_purchased_energy", "total_load_consumption", "total_yield", - "total_direct_energy_consumption," + "total_direct_energy_consumption", "daily_yield" ] POWER_SENSORS = ["power", "load_power"] diff --git a/custom_components/isolarcloud/translations/da.json b/custom_components/isolarcloud/translations/da.json index 63a3123..82c12e0 100644 --- a/custom_components/isolarcloud/translations/da.json +++ b/custom_components/isolarcloud/translations/da.json @@ -82,6 +82,12 @@ }, "battery_level_soc": { "name": "Batteriniveau" + }, + "daily_yield": { + "name": "Täglich erzeugte Energie" + }, + "power_fraction": { + "name": "Leistungsanteil W/Wp" } } } diff --git a/custom_components/isolarcloud/translations/en.json b/custom_components/isolarcloud/translations/en.json index 7445239..cf7445d 100644 --- a/custom_components/isolarcloud/translations/en.json +++ b/custom_components/isolarcloud/translations/en.json @@ -79,6 +79,12 @@ }, "battery_level_soc": { "name": "Battery level" + }, + "daily_yield": { + "name": "Daily Produced energy" + }, + "power_fraction": { + "name": "Power Fraction W/Wp" } } } diff --git a/custom_components/isolarcloud/translations/pt.json b/custom_components/isolarcloud/translations/pt.json new file mode 100644 index 0000000..f2166d7 --- /dev/null +++ b/custom_components/isolarcloud/translations/pt.json @@ -0,0 +1,91 @@ +{ + "config": { + "step": { + "pick_implementation": { + "title": "Escolher provedor de autenticação" + }, + "user": { + "title": "Selecionar servidor iSolarCloud", + "description": "Selecione o servidor ao qual deseja se conectar", + "data": { + "server": "Servidor iSolarCloud" + } + }, + "select_plants": { + "title": "Selecionar usinas", + "description": "Selecione as usinas que deseja conectar.", + "data": { + "plants": "Usinas" + } + } + }, + "abort": { + "already_configured": "Esta conta já está configurada", + "already_in_progress": "A configuração já está em andamento", + "oauth_error": "Ocorreu um erro desconhecido no OAuth2", + "oauth_failed": "Falha na autenticação com o serviço", + "oauth_timeout": "Tempo limite de autenticação excedido", + "oauth_unauthorized": "Não autorizado. Tente novamente.", + "missing_configuration": "Falta a configuração do OAuth2", + "authorize_url_timeout": "Tempo esgotado ao tentar obter a URL de autorização", + "no_url_available": "Nenhuma URL de autorização disponível", + "user_rejected_authorize": "Autorização foi rejeitada", + "invalid_client_id": "O Client ID do OAuth deve estar no formato applicationId@applicationKey" + }, + "create_entry": { + "default": "Autenticado com sucesso e conectado ao serviço", + "reauth_successful": "Reautenticado com sucesso e conectado ao serviço" + } + }, + "options": { + "step": { + "init": { + "title": "Configurar intervalo de atualização", + "description": "Os dados no iSolarCloud são atualizados a cada 5 minutos aproximadamente. Recomenda-se que a frequência das chamadas à API não seja inferior a 300 segundos.", + "data": { + "update_interval": "Intervalo de atualização (segundos)" + } + } + } + }, + "entity": { + "sensor": { + "feed_in_energy_total": { + "name": "Energia injetada na rede" + }, + "cumulative_discharge": { + "name": "Energia descarregada da bateria" + }, + "energy_storage_cumulative_charge": { + "name": "Energia carregada na bateria" + }, + "total_purchased_energy": { + "name": "Energia comprada" + }, + "total_load_consumption": { + "name": "Energia consumida" + }, + "total_yield": { + "name": "Energia produzida" + }, + "total_direct_energy_consumption": { + "name": "Consumo direto" + }, + "power": { + "name": "Fluxo de potência" + }, + "load_power": { + "name": "Potência da carga" + }, + "battery_level_soc": { + "name": "Nível da bateria" + }, + "daily_yield": { + "name": "Energia produzida no dia" + }, + "power_fraction": { + "name": "Fração de potência W/Wp" + } + } + } +} \ No newline at end of file diff --git a/custom_components/isolarcloud/translations/services.pt.json b/custom_components/isolarcloud/translations/services.pt.json new file mode 100644 index 0000000..c50b702 --- /dev/null +++ b/custom_components/isolarcloud/translations/services.pt.json @@ -0,0 +1,26 @@ +{ + "import_historical_data": { + "name": "Importar dados históricos de energia", + "description": "Importa dados de consumo de energia da API do iSolarCloud para um determinado período. (Observação: pode levar algum tempo para buscar os dados de um período mais longo).", + "fields": { + "start": { + "name": "Data de início", + "description": "Início do período para o qual os dados devem ser importados." + }, + "end": { + "name": "Data de término", + "description": "Fim do período para o qual os dados devem ser importados." + } + } + }, + "list_data_points": { + "name": "Listar pontos de dados", + "description": "Exibe quais dados estão disponíveis na API do iSolarCloud", + "fields": { + "measure_points": { + "name": "Pontos de medição", + "description": "Pontos de dados desejados" + } + } + } +} \ No newline at end of file From 621746953f2cc38c22bcbaf61e832014f583c1e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anderson=20Gul=C3=A3o?= Date: Fri, 18 Jul 2025 14:39:01 -0300 Subject: [PATCH 3/4] Updated new sensors descriptions --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 68e7718..fcedbb0 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ The integration will add one device to your HomeAssistant, representing your Sun * Purchased energy * Feed-in energy * Produced energy +* Daily Produced energy * Direct consumption The energy sensors can be used in HomeAssistant's [Energy Dashboard](https://www.home-assistant.io/docs/energy/). @@ -26,6 +27,9 @@ The energy sensors can be used in HomeAssistant's [Energy Dashboard](https://www * Load power * Power flow (This is not explained well in the Sungrow documentation. It seems like it is the net power through the inverter, ie. current solar production +/- battery (dis)charge) +### Power Factor sensors (in %) +* Fraction Power (Indicates the ratio between the generated power and the installed power) + It's possible that other plant types offer different data points which may require changes to the integration. The current configuration is based on my own SH8.0RT-V112 plant. ## Configuration From 9a5037086926791ce3ca2a34671c6524cafd5749 Mon Sep 17 00:00:00 2001 From: Tore Green Date: Sat, 6 Dec 2025 10:35:09 +0100 Subject: [PATCH 4/4] Fix Danish translations --- custom_components/isolarcloud/translations/da.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/isolarcloud/translations/da.json b/custom_components/isolarcloud/translations/da.json index 82c12e0..fdd029f 100644 --- a/custom_components/isolarcloud/translations/da.json +++ b/custom_components/isolarcloud/translations/da.json @@ -84,10 +84,10 @@ "name": "Batteriniveau" }, "daily_yield": { - "name": "Täglich erzeugte Energie" + "name": "Dagens produktion" }, "power_fraction": { - "name": "Leistungsanteil W/Wp" + "name": "Ydelse W/Wp" } } }