Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/).
Expand All @@ -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
Expand Down
15 changes: 14 additions & 1 deletion custom_components/isolarcloud/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@
"total_load_consumption",
"total_yield",
"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):
Expand All @@ -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


Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
6 changes: 6 additions & 0 deletions custom_components/isolarcloud/translations/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@
},
"battery_level_soc": {
"name": "Batteriniveau"
},
"daily_yield": {
"name": "Dagens produktion"
},
"power_fraction": {
"name": "Ydelse W/Wp"
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions custom_components/isolarcloud/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@
},
"battery_level_soc": {
"name": "Battery level"
},
"daily_yield": {
"name": "Daily Produced energy"
},
"power_fraction": {
"name": "Power Fraction W/Wp"
}
}
}
Expand Down
91 changes: 91 additions & 0 deletions custom_components/isolarcloud/translations/pt.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
}
26 changes: 26 additions & 0 deletions custom_components/isolarcloud/translations/services.pt.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
}