Skip to content

Commit

Permalink
Minor improvements - see #131
Browse files Browse the repository at this point in the history
  • Loading branch information
klein0r committed Jan 31, 2024
1 parent 38ea1ba commit d67ebb1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Provides forecast data from [forecast.solar](https://forecast.solar), [Solcast](
-->
### **WORK IN PROGRESS**
* (klein0r) Load system configuration via parameter
* (coltc50) Added damping factor for forecast solar

### 2.9.1 (2023-12-18)
* (klein0r) Avoid logging of api key
Expand Down
6 changes: 4 additions & 2 deletions admin/jsonConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@
"type": "number",
"min": 0,
"max": 1,
"step": 0.1,
"attr": "dampm",
"width": "5%",
"title": {
Expand All @@ -334,6 +335,7 @@
"type": "number",
"min": 0,
"max": 1,
"step": 0.1,
"attr": "dampe",
"width": "5%",
"title": {
Expand Down Expand Up @@ -380,7 +382,7 @@
"type": "number",
"attr": "peakpower",
"width": "20%",
"title": {
"title": {
"en": "Peak power (kWp)",
"de": "Spitzenleistung (kWp)",
"ru": "Пик власть (kWp)",
Expand Down Expand Up @@ -467,4 +469,4 @@
}
}
}
}
}
4 changes: 2 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -659,10 +659,10 @@ class Pvforecast extends utils.Adapter {
if (this.config.service === 'forecastsolar') {
if (this.hasApiKey) {
// https://api.forecast.solar/:apikey/estimate/:lat/:lon/:dec/:az/:kwp
url = `https://api.forecast.solar/${this.config.apiKey}/estimate/${this.pvLatitude}/${this.pvLongitude}/${plant.tilt}/${plant.azimuth}/${plant.peakpower}?time=utc&damping=${plant.dampm},${plant.dampe}`;
url = `https://api.forecast.solar/${this.config.apiKey}/estimate/${this.pvLatitude}/${this.pvLongitude}/${plant.tilt}/${plant.azimuth}/${plant.peakpower}?damping_morning=${plant.dampm ?? '0'}&damping_evening=${plant.dampe ?? '0'}&time=utc`;
} else {
// https://api.forecast.solar/estimate/:lat/:lon/:dec/:az/:kwp
url = `https://api.forecast.solar/estimate/${this.pvLatitude}/${this.pvLongitude}/${plant.tilt}/${plant.azimuth}/${plant.peakpower}?time=utc&damping=${plant.dampm},${plant.dampe}`;
url = `https://api.forecast.solar/estimate/${this.pvLatitude}/${this.pvLongitude}/${plant.tilt}/${plant.azimuth}/${plant.peakpower}?damping_morning=${plant.dampm ?? '0'}&damping_evening=${plant.dampe ?? '0'}&time=utc`;
}
} else if (this.config.service === 'solcast') {
url = `https://api.solcast.com.au/world_pv_power/forecasts?format=json&hours=48&loss_factor=1&latitude=${this.pvLatitude}&longitude=${this.pvLongitude}&tilt=${plant.tilt}&azimuth=${this.convertAzimuth(plant.azimuth)}&capacity=${plant.peakpower}&api_key=${this.config.apiKey}`;
Expand Down

0 comments on commit d67ebb1

Please sign in to comment.