Skip to content

Commit

Permalink
Add Energy D{2..7} sensors and clarify efficiency factor meaning
Browse files Browse the repository at this point in the history
  • Loading branch information
rany2 committed Jun 5, 2024
1 parent 5b23ab0 commit bef5da8
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 4 deletions.
2 changes: 1 addition & 1 deletion custom_components/open_meteo_solar_forecast/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"integration_type": "service",
"iot_class": "cloud_polling",
"requirements": ["open_meteo_solar_forecast==0.1.11"],
"version": "0.1.5"
"version": "0.1.6"
}
66 changes: 66 additions & 0 deletions custom_components/open_meteo_solar_forecast/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,72 @@ class OpenMeteoSolarForecastSensorEntityDescription(SensorEntityDescription):
suggested_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
suggested_display_precision=1,
),
OpenMeteoSolarForecastSensorEntityDescription(
key="energy_production_d2",
translation_key="energy_production_d2",
state=lambda estimate: estimate.day_production(
estimate.now().date() + timedelta(days=2)
),
device_class=SensorDeviceClass.ENERGY,
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
suggested_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
suggested_display_precision=1,
),
OpenMeteoSolarForecastSensorEntityDescription(
key="energy_production_d3",
translation_key="energy_production_d3",
state=lambda estimate: estimate.day_production(
estimate.now().date() + timedelta(days=3)
),
device_class=SensorDeviceClass.ENERGY,
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
suggested_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
suggested_display_precision=1,
),
OpenMeteoSolarForecastSensorEntityDescription(
key="energy_production_d4",
translation_key="energy_production_d4",
state=lambda estimate: estimate.day_production(
estimate.now().date() + timedelta(days=4)
),
device_class=SensorDeviceClass.ENERGY,
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
suggested_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
suggested_display_precision=1,
),
OpenMeteoSolarForecastSensorEntityDescription(
key="energy_production_d5",
translation_key="energy_production_d5",
state=lambda estimate: estimate.day_production(
estimate.now().date() + timedelta(days=5)
),
device_class=SensorDeviceClass.ENERGY,
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
suggested_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
suggested_display_precision=1,
),
OpenMeteoSolarForecastSensorEntityDescription(
key="energy_production_d6",
translation_key="energy_production_d6",
state=lambda estimate: estimate.day_production(
estimate.now().date() + timedelta(days=6)
),
device_class=SensorDeviceClass.ENERGY,
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
suggested_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
suggested_display_precision=1,
),
OpenMeteoSolarForecastSensorEntityDescription(
key="energy_production_d7",
translation_key="energy_production_d7",
state=lambda estimate: estimate.day_production(
estimate.now().date() + timedelta(days=7)
),
device_class=SensorDeviceClass.ENERGY,
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
suggested_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
suggested_display_precision=1,
),
OpenMeteoSolarForecastSensorEntityDescription(
key="power_highest_peak_time_today",
translation_key="power_highest_peak_time_today",
Expand Down
20 changes: 19 additions & 1 deletion custom_components/open_meteo_solar_forecast/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"declination": "Declination (0 = Horizontal, 90 = Vertical)",
"latitude": "[%key:common::config_flow::data::latitude%]",
"longitude": "[%key:common::config_flow::data::longitude%]",
"efficiency_factor": "Efficiency factor (0.0-1.0, 0.0 = 100% loss, 1.0 = no loss)",
"efficiency_factor": "DC efficiency factor (0.0-1.0, 0.0 = 100% loss, 1.0 = no loss)",
"modules_power": "Total Watt peak power of your solar modules",
"name": "[%key:common::config_flow::data::name%]"
}
Expand Down Expand Up @@ -44,6 +44,24 @@
"energy_production_tomorrow": {
"name": "Estimated energy production - tomorrow"
},
"energy_production_d2": {
"name": "Estimated energy production - day after tomorrow"
},
"energy_production_d3": {
"name": "Estimated energy production - 3 days from now"
},
"energy_production_d4": {
"name": "Estimated energy production - 4 days from now"
},
"energy_production_d5": {
"name": "Estimated energy production - 5 days from now"
},
"energy_production_d6": {
"name": "Estimated energy production - 6 days from now"
},
"energy_production_d7": {
"name": "Estimated energy production - 7 days from now"
},
"power_highest_peak_time_today": {
"name": "Highest power peak time - today"
},
Expand Down
22 changes: 20 additions & 2 deletions custom_components/open_meteo_solar_forecast/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"declination": "Declination (0 = Horizontal, 90 = Vertical)",
"latitude": "Latitude",
"longitude": "Longitude",
"efficiency_factor": "Efficiency factor (0.0-1.0, 0.0 = 100% loss, 1.0 = no loss)",
"efficiency_factor": "DC efficiency factor (0.0-1.0, 0.0 = 100% loss, 1.0 = no loss)",
"modules_power": "Total Watt peak power of your solar modules",
"name": "Name"
},
Expand All @@ -33,6 +33,24 @@
"energy_production_tomorrow": {
"name": "Estimated energy production - tomorrow"
},
"energy_production_d2": {
"name": "Estimated energy production - day after tomorrow"
},
"energy_production_d3": {
"name": "Estimated energy production - 3 days from now"
},
"energy_production_d4": {
"name": "Estimated energy production - 4 days from now"
},
"energy_production_d5": {
"name": "Estimated energy production - 5 days from now"
},
"energy_production_d6": {
"name": "Estimated energy production - 6 days from now"
},
"energy_production_d7": {
"name": "Estimated energy production - 7 days from now"
},
"power_highest_peak_time_today": {
"name": "Highest power peak time - today"
},
Expand Down Expand Up @@ -70,7 +88,7 @@
"azimuth": "Azimuth (360 degrees, 0 = North, 90 = East, 180 = South, 270 = West)",
"declination": "Declination (0 = Horizontal, 90 = Vertical)",
"inverter_size": "Inverter size (Watt)",
"efficiency_factor": "Efficiency factor (0.0-1.0, 0.0 = 100% loss, 1.0 = no loss)",
"efficiency_factor": "DC efficiency factor (0.0-1.0, 0.0 = 100% loss, 1.0 = no loss)",
"modules_power": "Total Watt peak power of your solar modules"
},
"description": "These values allow tweaking the Forecast.Solar result. Please refer to the documentation if a field is unclear."
Expand Down
5 changes: 5 additions & 0 deletions info.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
### Changes

v0.1.6

- Add D2, D3, D4, D5, D6, D7 energy production sensors.
- Clarify that effiency factor is only for DC wire efficiency not cell efficiency.

v0.1.5

- Fix start time for power sensors.
Expand Down

0 comments on commit bef5da8

Please sign in to comment.