Wobei es egal ist, 10 reichen genau so, so genau ist kein Forecast dad man diesen fast stündlich aktualisierten müsste.
Plugin: PV Forecast / Ertragsprognose für eure PV-Anlage
Einklappen
X
-
Kann ich auch bestätigen.
Wobei es egal ist, 10 reichen genau so, so genau ist kein Forecast dad man diesen fast stündlich aktualisierten müsste.
Kein Support per PN! -
Tico
I looked the first time a bit deeper to your solution.
I'm not sure but it looked for me that there is no consideration of time shift and daylight saving time. Solcast use UTC so, so for me in Germany there is a 2 hour difference in summertime to UTC.
I'm wondering also that you use all 48 values, if í sum all 48 values the forecast ist much to high. I only use 24 full hour values to sum, than I get a perfect forecast.
Kein Support per PN!Kommentar
-
hismastersvoice
Reference the post at -
Nachfolger: PV-Solcast Link (https://www.loxforum.com/forum/projektforen/loxberry/plugins/307349-plugin-pv-solcast-forecast-f%C3%BCr-pv-anlagen) END OF LIFE Das Plugin funktioniert nach wie vor mit allen Loxberry <2.x Ich werde aber keine Anpassungen mehr vornehmen da ich inzwischen mit mit Solcast als Forecast-Anbieter
That's correct, there is no consideration of time shift and daylight saving time. But I don't use the timestamps on any values. Each time Solcast is polled, 'Period 1' is the next 30 minutes from when the poll occurred; 'Period 2' is 30-60 minutes from polling event, etc.
So the 48 values summed (each a 30 minute production value) provides a rolling 24 hour look ahead.
A single captured value for the forecast day is triggered at 9pm of the preceding day. I could make this trigger later (closer to sunrise), but the risk becomes that the 24 hour rolling window captures some sunrise of the 2nd day forward. I'm also still awake at 9pm and can see what the next day has in store.
Solcast is providing very high update rates in their solar forecasting; every 10 minutes in Australia and 15 minutes in Europe -
Live and forecast irradiance data and PV power data based on 3 dimensional cloud modelling. Powered by live satellite data, updating every 5 to 15 minutes.
I would like to get better accuracy for a charging control system of a solar battery I have. By polling more often when I need the data (ie. daylight hours), I can better utilise the 20 poll limit.
A Python client library exists for returning the forecasts via script -
A Python client library for the Solcast API. Contribute to cjtapper/solcast-py development by creating an account on GitHub.
I've installed this on the Loxberry, but have had no success making it work. I also lack any meaningful Linux skills...
I would be very grateful if anyone can give the API a try and provide guidance.Zuletzt geändert von Tico; 16.03.2020, 14:41.Ich spreche kein Deutsch. Gib Google Translate die Schuld, wenn ich unverständlich bin.Kommentar
-
I have build a shell scripts that works with the json data that you can download.
the first poll for me is at 4am local time.
And after that every hour until 10pm so I'm always into the 20 poll limit an get an update during the full day. That fits for the longest days in summer.
I'm also calculate the time shift between UTC and local time and put that into the calculation. So the values of the hours fits better than without use time shift. In Germany we have with daylight saving time 2 hours difference.
My battery had her own forecast and I don't need to control.
I use it to of schedule the production of warm water, the dish washer, washing machine etc
Solcast works better for me that the old provider in my plugin.Zuletzt geändert von hismastersvoice; 12.10.2019, 09:10.Kein Support per PN!Kommentar
-
1. Create a folder solcast in /opt
2. Create a file sc_calc.sh in the folder /opt/solcast
3. Copy the code below into the file, setup the paramters and save
3. sudo chmod 0755 /opt/solcast/sc_calc.sh
4. copy the the lines from the second codeblock blow the existing lines into /etc/crontab "at the end of the file the last line hast to be a empty one"
5. sudo service cron restart
The results get send via UDP to the MiniServer.
So you have to create Virtual UDP Input with the used Port eg. 7000
Also Virtual UDP Input Command with command recognition e.g. sc_total.today_w=\v
sc_calc.sh
Code: #!/bin/bash # # © 2019 Dieter Schmidberger # ## CONFIG ########### LAT="xx.xxxxxxx" LON="xx.xxxxx" CAP="xx.x" TILT="xx" AZIM="xxx" LOSS="1" INSTALL="2015-01-01" APIKEY="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ##################### MS_IP="192.1.1.1" MS_UDP="7000" ##################### FORMAT="json" ##################### #NOTHING TO CHANGE### file="/tmp/solcast_forecast.json" timeout=30 req_ok=0 clear echo "Solcast PV Forecast..." echo "Download JSON..." get_data() { req_ok=0 D=`date "+%b %d %H:%M:%S"` echo "$D - PV Forecast get data from Solcast: $url" data=$(curl -s -m $timeout $url --output $file) D=`date "+%b %d %H:%M:%S"` if [ -f "$file" ]; then echo "$D - PV Forecast get data from Solcast: download OK..." req_ok=1 else echo "$D - PV Forecast get data from Solcast: 1. download error... retry..." data=$(curl -s -m $timeout $url --output $file) if [ -f "$file" ]; then echo "$D - PV Forecast get data from Solcast: download OK..." req_ok=1 else echo "$D - PV Forecast get data from Solcast: 2. download error... abort..." req_ok=0 fi fi } url="https://api.solcast.com.au/world_pv_power/forecasts?latitude=$LAT&longitude=$LON&capacity=$CAP&tilt=$TILT&azimuth=$AZIM&loss_factor=$LOSS&install_date=$INSTALL&format=$FORMAT&&api_key=$APIKEY" get_data if [ $req_ok == 1 ]; then time_now_utc_h=$(date "+%H" -u -d "now") time_dif_utc=$(date "+%:::z" -d "now") time_dif_utc=$(echo $time_dif_utc | sed 's/^+0*//') time_now_h=$(date "+%H" -d "now") echo "Calc..." #DAY 1 year=$(date "+%Y") month=$(date "+%m") day=$(date "+%d") date_1=$(echo $year"-"$month"-"$day) day_1_string_0=$(echo $date_1"T00:00:00.0000000Z"); day_1_string_030=$(echo $date_1"T00:30:00.0000000Z") day_1_string_1=$(echo $date_1"T01:00:00.0000000Z"); day_1_string_130=$(echo $date_1"T01:30:00.0000000Z") day_1_string_2=$(echo $date_1"T02:00:00.0000000Z"); day_1_string_230=$(echo $date_1"T02:30:00.0000000Z") day_1_string_3=$(echo $date_1"T03:00:00.0000000Z"); day_1_string_330=$(echo $date_1"T03:30:00.0000000Z") day_1_string_4=$(echo $date_1"T04:00:00.0000000Z"); day_1_string_430=$(echo $date_1"T04:30:00.0000000Z") day_1_string_5=$(echo $date_1"T05:00:00.0000000Z"); day_1_string_530=$(echo $date_1"T05:30:00.0000000Z") day_1_string_6=$(echo $date_1"T06:00:00.0000000Z"); day_1_string_630=$(echo $date_1"T06:30:00.0000000Z") day_1_string_7=$(echo $date_1"T07:00:00.0000000Z"); day_1_string_730=$(echo $date_1"T07:30:00.0000000Z") day_1_string_8=$(echo $date_1"T08:00:00.0000000Z"); day_1_string_830=$(echo $date_1"T08:30:00.0000000Z") day_1_string_9=$(echo $date_1"T09:00:00.0000000Z"); day_1_string_930=$(echo $date_1"T09:30:00.0000000Z") day_1_string_10=$(echo $date_1"T10:00:00.0000000Z"); day_1_string_1030=$(echo $date_1"T10:30:00.0000000Z") day_1_string_11=$(echo $date_1"T11:00:00.0000000Z"); day_1_string_1130=$(echo $date_1"T11:30:00.0000000Z") day_1_string_12=$(echo $date_1"T12:00:00.0000000Z"); day_1_string_1230=$(echo $date_1"T12:30:00.0000000Z") day_1_string_13=$(echo $date_1"T13:00:00.0000000Z"); day_1_string_1330=$(echo $date_1"T13:30:00.0000000Z") day_1_string_14=$(echo $date_1"T14:00:00.0000000Z"); day_1_string_1430=$(echo $date_1"T14:30:00.0000000Z") day_1_string_15=$(echo $date_1"T15:00:00.0000000Z"); day_1_string_1530=$(echo $date_1"T15:30:00.0000000Z") day_1_string_16=$(echo $date_1"T16:00:00.0000000Z"); day_1_string_1630=$(echo $date_1"T16:30:00.0000000Z") day_1_string_17=$(echo $date_1"T17:00:00.0000000Z"); day_1_string_1730=$(echo $date_1"T17:30:00.0000000Z") day_1_string_18=$(echo $date_1"T18:00:00.0000000Z"); day_1_string_1830=$(echo $date_1"T18:30:00.0000000Z") day_1_string_19=$(echo $date_1"T19:00:00.0000000Z"); day_1_string_1930=$(echo $date_1"T19:30:00.0000000Z") day_1_string_20=$(echo $date_1"T20:00:00.0000000Z"); day_1_string_2030=$(echo $date_1"T20:30:00.0000000Z") day_1_string_21=$(echo $date_1"T21:00:00.0000000Z"); day_1_string_2130=$(echo $date_1"T21:30:00.0000000Z") day_1_string_22=$(echo $date_1"T22:00:00.0000000Z"); day_1_string_2230=$(echo $date_1"T22:30:00.0000000Z") day_1_string_23=$(echo $date_1"T23:00:00.0000000Z"); day_1_string_2330=$(echo $date_1"T23:30:00.0000000Z") day_1_arr=() INDEX=0 day_1_0=$(cat $file | jq --arg day_1_string_0 $day_1_string_0 '.forecasts[] | select(.period_end == $day_1_string_0) | .pv_estimate'); if [ -z "$day_1_0" ]; then day_1_0=0; fi; day_1_arr+=("$day_1_0") #day_1_030=$(cat $file | jq --arg day_1_string_030 $day_1_string_030 '.forecasts[] | select(.period_end == $day_1_string_030) | .pv_estimate'); if [ -z "$day_1_030" ]; then day_1_030=0; fi; day_1_arr+=("$day_1_030") day_1_1=$(cat $file | jq --arg day_1_string_1 $day_1_string_1 '.forecasts[] | select(.period_end == $day_1_string_1) | .pv_estimate'); if [ -z "$day_1_1" ]; then day_1_1=0; fi; day_1_arr+=("$day_1_1") #day_1_130=$(cat $file | jq --arg day_1_string_130 $day_1_string_130 '.forecasts[] | select(.period_end == $day_1_string_130) | .pv_estimate'); if [ -z "$day_1_130" ]; then day_1_130=0; fi; day_1_arr+=("$day_1_130") day_1_2=$(cat $file | jq --arg day_1_string_2 $day_1_string_2 '.forecasts[] | select(.period_end == $day_1_string_2) | .pv_estimate'); if [ -z "$day_1_2" ]; then day_1_2=0; fi; day_1_arr+=("$day_1_2") #day_1_230=$(cat $file | jq --arg day_1_string_230 $day_1_string_230 '.forecasts[] | select(.period_end == $day_1_string_230) | .pv_estimate'); if [ -z "$day_1_230" ]; then day_1_230=0; fi; day_1_arr+=("$day_1_230") day_1_3=$(cat $file | jq --arg day_1_string_3 $day_1_string_3 '.forecasts[] | select(.period_end == $day_1_string_3) | .pv_estimate'); if [ -z "$day_1_3" ]; then day_1_3=0; fi; day_1_arr+=("$day_1_3") #day_1_330=$(cat $file | jq --arg day_1_string_330 $day_1_string_330 '.forecasts[] | select(.period_end == $day_1_string_330) | .pv_estimate'); if [ -z "$day_1_330" ]; then day_1_330=0; fi; day_1_arr+=("$day_1_330") day_1_4=$(cat $file | jq --arg day_1_string_4 $day_1_string_4 '.forecasts[] | select(.period_end == $day_1_string_4) | .pv_estimate'); if [ -z "$day_1_4" ]; then day_1_4=0; fi; day_1_arr+=("$day_1_4") #day_1_430=$(cat $file | jq --arg day_1_string_430 $day_1_string_430 '.forecasts[] | select(.period_end == $day_1_string_430) | .pv_estimate'); if [ -z "$day_1_430" ]; then day_1_430=0; fi; day_1_arr+=("$day_1_430") day_1_5=$(cat $file | jq --arg day_1_string_5 $day_1_string_5 '.forecasts[] | select(.period_end == $day_1_string_5) | .pv_estimate'); if [ -z "$day_1_5" ]; then day_1_5=0; fi; day_1_arr+=("$day_1_5") #day_1_530=$(cat $file | jq --arg day_1_string_530 $day_1_string_530 '.forecasts[] | select(.period_end == $day_1_string_530) | .pv_estimate'); if [ -z "$day_1_530" ]; then day_1_530=0; fi; day_1_arr+=("$day_1_530") day_1_6=$(cat $file | jq --arg day_1_string_6 $day_1_string_6 '.forecasts[] | select(.period_end == $day_1_string_6) | .pv_estimate'); if [ -z "$day_1_6" ]; then day_1_6=0; fi; day_1_arr+=("$day_1_6") #day_1_630=$(cat $file | jq --arg day_1_string_630 $day_1_string_630 '.forecasts[] | select(.period_end == $day_1_string_630) | .pv_estimate'); if [ -z "$day_1_630" ]; then day_1_630=0; fi; day_1_arr+=("$day_1_630") day_1_7=$(cat $file | jq --arg day_1_string_7 $day_1_string_7 '.forecasts[] | select(.period_end == $day_1_string_7) | .pv_estimate'); if [ -z "$day_1_7" ]; then day_1_7=0; fi; day_1_arr+=("$day_1_7") #day_1_730=$(cat $file | jq --arg day_1_string_730 $day_1_string_730 '.forecasts[] | select(.period_end == $day_1_string_730) | .pv_estimate'); if [ -z "$day_1_730" ]; then day_1_730=0; fi; day_1_arr+=("$day_1_730") day_1_8=$(cat $file | jq --arg day_1_string_8 $day_1_string_8 '.forecasts[] | select(.period_end == $day_1_string_8) | .pv_estimate'); if [ -z "$day_1_8" ]; then day_1_8=0; fi; day_1_arr+=("$day_1_8") #day_1_830=$(cat $file | jq --arg day_1_string_830 $day_1_string_830 '.forecasts[] | select(.period_end == $day_1_string_830) | .pv_estimate'); if [ -z "$day_1_830" ]; then day_1_830=0; fi; day_1_arr+=("$day_1_830") day_1_9=$(cat $file | jq --arg day_1_string_9 $day_1_string_9 '.forecasts[] | select(.period_end == $day_1_string_9) | .pv_estimate'); if [ -z "$day_1_9" ]; then day_1_9=0; fi; day_1_arr+=("$day_1_9") #day_1_930=$(cat $file | jq --arg day_1_string_930 $day_1_string_930 '.forecasts[] | select(.period_end == $day_1_string_930) | .pv_estimate'); if [ -z "$day_1_930" ]; then day_1_930=0; fi; day_1_arr+=("$day_1_930") day_1_10=$(cat $file | jq --arg day_1_string_10 $day_1_string_10 '.forecasts[] | select(.period_end == $day_1_string_10) | .pv_estimate'); if [ -z "$day_1_10" ]; then day_1_10=0; fi; day_1_arr+=("$day_1_10") #day_1_1030=$(cat $file | jq --arg day_1_string_1030 $day_1_string_1030 '.forecasts[] | select(.period_end == $day_1_string_1030) | .pv_estimate'); if [ -z "$day_1_1030" ]; then day_1_1030=0; fi; day_1_arr+=("$day_1_1030") day_1_11=$(cat $file | jq --arg day_1_string_11 $day_1_string_11 '.forecasts[] | select(.period_end == $day_1_string_11) | .pv_estimate'); if [ -z "$day_1_11" ]; then day_1_11=0; fi; day_1_arr+=("$day_1_11") #day_1_1130=$(cat $file | jq --arg day_1_string_1130 $day_1_string_1130 '.forecasts[] | select(.period_end == $day_1_string_1130) | .pv_estimate'); if [ -z "$day_1_1130" ]; then day_1_1130=0; fi; day_1_arr+=("$day_1_1130") day_1_12=$(cat $file | jq --arg day_1_string_12 $day_1_string_12 '.forecasts[] | select(.period_end == $day_1_string_12) | .pv_estimate'); if [ -z "$day_1_12" ]; then day_1_12=0; fi; day_1_arr+=("$day_1_12") #day_1_1230=$(cat $file | jq --arg day_1_string_1230 $day_1_string_1230 '.forecasts[] | select(.period_end == $day_1_string_1230) | .pv_estimate'); if [ -z "$day_1_1230" ]; then day_1_1230=0; fi; day_1_arr+=("$day_1_1230") day_1_13=$(cat $file | jq --arg day_1_string_13 $day_1_string_13 '.forecasts[] | select(.period_end == $day_1_string_13) | .pv_estimate'); if [ -z "$day_1_13" ]; then day_1_13=0; fi; day_1_arr+=("$day_1_13") #day_1_1330=$(cat $file | jq --arg day_1_string_1330 $day_1_string_1330 '.forecasts[] | select(.period_end == $day_1_string_1330) | .pv_estimate'); if [ -z "$day_1_1330" ]; then day_1_1330=0; fi; day_1_arr+=("$day_1_1330") day_1_14=$(cat $file | jq --arg day_1_string_14 $day_1_string_14 '.forecasts[] | select(.period_end == $day_1_string_14) | .pv_estimate'); if [ -z "$day_1_14" ]; then day_1_14=0; fi; day_1_arr+=("$day_1_14") #day_1_1430=$(cat $file | jq --arg day_1_string_1430 $day_1_string_1430 '.forecasts[] | select(.period_end == $day_1_string_1430) | .pv_estimate'); if [ -z "$day_1_1430" ]; then day_1_1430=0; fi; day_1_arr+=("$day_1_1430") day_1_15=$(cat $file | jq --arg day_1_string_15 $day_1_string_15 '.forecasts[] | select(.period_end == $day_1_string_15) | .pv_estimate'); if [ -z "$day_1_15" ]; then day_1_15=0; fi; day_1_arr+=("$day_1_15") #day_1_1530=$(cat $file | jq --arg day_1_string_1530 $day_1_string_1530 '.forecasts[] | select(.period_end == $day_1_string_1530) | .pv_estimate'); if [ -z "$day_1_1530" ]; then day_1_1530=0; fi; day_1_arr+=("$day_1_1530") day_1_16=$(cat $file | jq --arg day_1_string_16 $day_1_string_16 '.forecasts[] | select(.period_end == $day_1_string_16) | .pv_estimate'); if [ -z "$day_1_16" ]; then day_1_16=0; fi; day_1_arr+=("$day_1_16") #day_1_1630=$(cat $file | jq --arg day_1_string_1630 $day_1_string_1630 '.forecasts[] | select(.period_end == $day_1_string_1630) | .pv_estimate'); if [ -z "$day_1_1630" ]; then day_1_1630=0; fi; day_1_arr+=("$day_1_1630") day_1_17=$(cat $file | jq --arg day_1_string_17 $day_1_string_17 '.forecasts[] | select(.period_end == $day_1_string_17) | .pv_estimate'); if [ -z "$day_1_17" ]; then day_1_17=0; fi; day_1_arr+=("$day_1_17") #day_1_1730=$(cat $file | jq --arg day_1_string_1730 $day_1_string_1730 '.forecasts[] | select(.period_end == $day_1_string_1730) | .pv_estimate'); if [ -z "$day_1_1730" ]; then day_1_1730=0; fi; day_1_arr+=("$day_1_1730") day_1_18=$(cat $file | jq --arg day_1_string_18 $day_1_string_18 '.forecasts[] | select(.period_end == $day_1_string_18) | .pv_estimate'); if [ -z "$day_1_18" ]; then day_1_18=0; fi; day_1_arr+=("$day_1_18") #day_1_1830=$(cat $file | jq --arg day_1_string_1830 $day_1_string_1830 '.forecasts[] | select(.period_end == $day_1_string_1830) | .pv_estimate'); if [ -z "$day_1_1830" ]; then day_1_1830=0; fi; day_1_arr+=("$day_1_1830") day_1_19=$(cat $file | jq --arg day_1_string_19 $day_1_string_19 '.forecasts[] | select(.period_end == $day_1_string_19) | .pv_estimate'); if [ -z "$day_1_19" ]; then day_1_19=0; fi; day_1_arr+=("$day_1_19") #day_1_1930=$(cat $file | jq --arg day_1_string_1930 $day_1_string_1930 '.forecasts[] | select(.period_end == $day_1_string_1930) | .pv_estimate'); if [ -z "$day_1_1930" ]; then day_1_1930=0; fi; day_1_arr+=("$day_1_1930") day_1_20=$(cat $file | jq --arg day_1_string_20 $day_1_string_20 '.forecasts[] | select(.period_end == $day_1_string_20) | .pv_estimate'); if [ -z "$day_1_20" ]; then day_1_20=0; fi; day_1_arr+=("$day_1_20") #day_1_2030=$(cat $file | jq --arg day_1_string_2030 $day_1_string_2030 '.forecasts[] | select(.period_end == $day_1_string_2030) | .pv_estimate'); if [ -z "$day_1_2030" ]; then day_1_2030=0; fi; day_1_arr+=("$day_1_2030") day_1_21=$(cat $file | jq --arg day_1_string_21 $day_1_string_21 '.forecasts[] | select(.period_end == $day_1_string_21) | .pv_estimate'); if [ -z "$day_1_21" ]; then day_1_21=0; fi; day_1_arr+=("$day_1_21") #day_1_2130=$(cat $file | jq --arg day_1_string_2130 $day_1_string_2130 '.forecasts[] | select(.period_end == $day_1_string_2130) | .pv_estimate'); if [ -z "$day_1_2130" ]; then day_1_2130=0; fi; day_1_arr+=("$day_1_2130") day_1_22=$(cat $file | jq --arg day_1_string_22 $day_1_string_22 '.forecasts[] | select(.period_end == $day_1_string_22) | .pv_estimate'); if [ -z "$day_1_22" ]; then day_1_22=0; fi; day_1_arr+=("$day_1_22") #day_1_2230=$(cat $file | jq --arg day_1_string_2230 $day_1_string_2230 '.forecasts[] | select(.period_end == $day_1_string_2230) | .pv_estimate'); if [ -z "$day_1_2230" ]; then day_1_2230=0; fi; day_1_arr+=("$day_1_2230") day_1_23=$(cat $file | jq --arg day_1_string_23 $day_1_string_23 '.forecasts[] | select(.period_end == $day_1_string_23) | .pv_estimate'); if [ -z "$day_1_23" ]; then day_1_23=0; fi; day_1_arr+=("$day_1_23") #day_1_2330=$(cat $file | jq --arg day_1_string_2330 $day_1_string_2330 '.forecasts[] | select(.period_end == $day_1_string_2330) | .pv_estimate'); if [ -z "$day_1_2330" ]; then day_1_2330=0; fi; day_1_arr+=("$day_1_2330") #DAY 2 year=$(date "+%Y") month=$(date "+%m") day=$(date "+%d") tomorrow=$(date --date="next day" +%d) date_2=$(echo $year"-"$month"-"$tomorrow) day_2_string_0=$(echo $date_2"T00:00:00.0000000Z"); day_2_string_030=$(echo $date_2"T00:30:00.0000000Z") day_2_string_1=$(echo $date_2"T01:00:00.0000000Z"); day_2_string_130=$(echo $date_2"T01:30:00.0000000Z") day_2_string_2=$(echo $date_2"T02:00:00.0000000Z"); day_2_string_230=$(echo $date_2"T02:30:00.0000000Z") day_2_string_3=$(echo $date_2"T03:00:00.0000000Z"); day_2_string_330=$(echo $date_2"T03:30:00.0000000Z") day_2_string_4=$(echo $date_2"T04:00:00.0000000Z"); day_2_string_430=$(echo $date_2"T04:30:00.0000000Z") day_2_string_5=$(echo $date_2"T05:00:00.0000000Z"); day_2_string_530=$(echo $date_2"T05:30:00.0000000Z") day_2_string_6=$(echo $date_2"T06:00:00.0000000Z"); day_2_string_630=$(echo $date_2"T06:30:00.0000000Z") day_2_string_7=$(echo $date_2"T07:00:00.0000000Z"); day_2_string_730=$(echo $date_2"T07:30:00.0000000Z") day_2_string_8=$(echo $date_2"T08:00:00.0000000Z"); day_2_string_830=$(echo $date_2"T08:30:00.0000000Z") day_2_string_9=$(echo $date_2"T09:00:00.0000000Z"); day_2_string_930=$(echo $date_2"T09:30:00.0000000Z") day_2_string_10=$(echo $date_2"T10:00:00.0000000Z"); day_2_string_1030=$(echo $date_2"T10:30:00.0000000Z") day_2_string_11=$(echo $date_2"T11:00:00.0000000Z"); day_2_string_1130=$(echo $date_2"T11:30:00.0000000Z") day_2_string_12=$(echo $date_2"T12:00:00.0000000Z"); day_2_string_1230=$(echo $date_2"T12:30:00.0000000Z") day_2_string_13=$(echo $date_2"T13:00:00.0000000Z"); day_2_string_1330=$(echo $date_2"T13:30:00.0000000Z") day_2_string_14=$(echo $date_2"T14:00:00.0000000Z"); day_2_string_1430=$(echo $date_2"T14:30:00.0000000Z") day_2_string_15=$(echo $date_2"T15:00:00.0000000Z"); day_2_string_1530=$(echo $date_2"T15:30:00.0000000Z") day_2_string_16=$(echo $date_2"T16:00:00.0000000Z"); day_2_string_1630=$(echo $date_2"T16:30:00.0000000Z") day_2_string_17=$(echo $date_2"T17:00:00.0000000Z"); day_2_string_1730=$(echo $date_2"T17:30:00.0000000Z") day_2_string_18=$(echo $date_2"T18:00:00.0000000Z"); day_2_string_1830=$(echo $date_2"T18:30:00.0000000Z") day_2_string_19=$(echo $date_2"T19:00:00.0000000Z"); day_2_string_1930=$(echo $date_2"T19:30:00.0000000Z") day_2_string_20=$(echo $date_2"T20:00:00.0000000Z"); day_2_string_2030=$(echo $date_2"T20:30:00.0000000Z") day_2_string_21=$(echo $date_2"T21:00:00.0000000Z"); day_2_string_2130=$(echo $date_2"T21:30:00.0000000Z") day_2_string_22=$(echo $date_2"T22:00:00.0000000Z"); day_2_string_2230=$(echo $date_2"T22:30:00.0000000Z") day_2_string_23=$(echo $date_2"T23:00:00.0000000Z"); day_2_string_2330=$(echo $date_2"T23:30:00.0000000Z") day_2_arr=() INDEX=0 day_2_0=$(cat $file | jq --arg day_2_string_0 $day_2_string_0 '.forecasts[] | select(.period_end == $day_2_string_0) | .pv_estimate'); if [ -z "$day_2_0" ]; then day_2_0=0; fi; day_2_arr+=("$day_2_0") #day_2_030=$(cat $file | jq --arg day_2_string_030 $day_2_string_030 '.forecasts[] | select(.period_end == $day_2_string_030) | .pv_estimate'); if [ -z "$day_2_030" ]; then day_2_030=0; fi; day_2_arr+=("$day_2_030") day_2_1=$(cat $file | jq --arg day_2_string_1 $day_2_string_1 '.forecasts[] | select(.period_end == $day_2_string_1) | .pv_estimate'); if [ -z "$day_2_1" ]; then day_2_1=0.0; fi; day_2_arr+=("$day_2_1") #day_2_130=$(cat $file | jq --arg day_2_string_130 $day_2_string_130 '.forecasts[] | select(.period_end == $day_2_string_130) | .pv_estimate'); if [ -z "$day_2_130" ]; then day_2_130=0; fi; day_2_arr+=("$day_2_130") day_2_2=$(cat $file | jq --arg day_2_string_2 $day_2_string_2 '.forecasts[] | select(.period_end == $day_2_string_2) | .pv_estimate'); if [ -z "$day_2_2" ]; then day_2_2=0; fi; day_2_arr+=("$day_2_2") #day_2_230=$(cat $file | jq --arg day_2_string_230 $day_2_string_230 '.forecasts[] | select(.period_end == $day_2_string_230) | .pv_estimate'); if [ -z "$day_2_230" ]; then day_2_230=0; fi; day_2_arr+=("$day_2_230") day_2_3=$(cat $file | jq --arg day_2_string_3 $day_2_string_3 '.forecasts[] | select(.period_end == $day_2_string_3) | .pv_estimate'); if [ -z "$day_2_3" ]; then day_2_3=0; fi; day_2_arr+=("$day_2_3") #day_2_330=$(cat $file | jq --arg day_2_string_330 $day_2_string_330 '.forecasts[] | select(.period_end == $day_2_string_330) | .pv_estimate'); if [ -z "$day_2_330" ]; then day_2_330=0; fi; day_2_arr+=("$day_2_330") day_2_4=$(cat $file | jq --arg day_2_string_4 $day_2_string_4 '.forecasts[] | select(.period_end == $day_2_string_4) | .pv_estimate'); if [ -z "$day_2_4" ]; then day_2_4=0; fi; day_2_arr+=("$day_2_4") #day_2_430=$(cat $file | jq --arg day_2_string_430 $day_2_string_430 '.forecasts[] | select(.period_end == $day_2_string_430) | .pv_estimate'); if [ -z "$day_2_430" ]; then day_2_430=0; fi; day_2_arr+=("$day_2_430") day_2_5=$(cat $file | jq --arg day_2_string_5 $day_2_string_5 '.forecasts[] | select(.period_end == $day_2_string_5) | .pv_estimate'); if [ -z "$day_2_5" ]; then day_2_5=0; fi; day_2_arr+=("$day_2_5") #day_2_530=$(cat $file | jq --arg day_2_string_530 $day_2_string_530 '.forecasts[] | select(.period_end == $day_2_string_530) | .pv_estimate'); if [ -z "$day_2_530" ]; then day_2_530=0; fi; day_2_arr+=("$day_2_530") day_2_6=$(cat $file | jq --arg day_2_string_6 $day_2_string_6 '.forecasts[] | select(.period_end == $day_2_string_6) | .pv_estimate'); if [ -z "$day_2_6" ]; then day_2_6=0; fi; day_2_arr+=("$day_2_6") #day_2_630=$(cat $file | jq --arg day_2_string_630 $day_2_string_630 '.forecasts[] | select(.period_end == $day_2_string_630) | .pv_estimate'); if [ -z "$day_2_630" ]; then day_2_630=0; fi; day_2_arr+=("$day_2_630") day_2_7=$(cat $file | jq --arg day_2_string_7 $day_2_string_7 '.forecasts[] | select(.period_end == $day_2_string_7) | .pv_estimate'); if [ -z "$day_2_7" ]; then day_2_7=0; fi; day_2_arr+=("$day_2_7") #day_2_730=$(cat $file | jq --arg day_2_string_730 $day_2_string_730 '.forecasts[] | select(.period_end == $day_2_string_730) | .pv_estimate'); if [ -z "$day_2_730" ]; then day_2_730=0; fi; day_2_arr+=("$day_2_730") day_2_8=$(cat $file | jq --arg day_2_string_8 $day_2_string_8 '.forecasts[] | select(.period_end == $day_2_string_8) | .pv_estimate'); if [ -z "$day_2_8" ]; then day_2_8=0; fi; day_2_arr+=("$day_2_8") #day_2_830=$(cat $file | jq --arg day_2_string_830 $day_2_string_830 '.forecasts[] | select(.period_end == $day_2_string_830) | .pv_estimate'); if [ -z "$day_2_830" ]; then day_2_830=0; fi; day_2_arr+=("$day_2_830") day_2_9=$(cat $file | jq --arg day_2_string_9 $day_2_string_9 '.forecasts[] | select(.period_end == $day_2_string_9) | .pv_estimate'); if [ -z "$day_2_9" ]; then day_2_9=0; fi; day_2_arr+=("$day_2_9") #day_2_930=$(cat $file | jq --arg day_2_string_930 $day_2_string_930 '.forecasts[] | select(.period_end == $day_2_string_930) | .pv_estimate'); if [ -z "$day_2_930" ]; then day_2_930=0; fi; day_2_arr+=("$day_2_930") day_2_10=$(cat $file | jq --arg day_2_string_10 $day_2_string_10 '.forecasts[] | select(.period_end == $day_2_string_10) | .pv_estimate'); if [ -z "$day_2_10" ]; then day_2_10=0; fi; day_2_arr+=("$day_2_10") #day_2_1030=$(cat $file | jq --arg day_2_string_1030 $day_2_string_1030 '.forecasts[] | select(.period_end == $day_2_string_1030) | .pv_estimate'); if [ -z "$day_2_1030" ]; then day_2_1030=0; fi; day_2_arr+=("$day_2_1030") day_2_11=$(cat $file | jq --arg day_2_string_11 $day_2_string_11 '.forecasts[] | select(.period_end == $day_2_string_11) | .pv_estimate'); if [ -z "$day_2_11" ]; then day_2_11=0; fi; day_2_arr+=("$day_2_11") #day_2_1130=$(cat $file | jq --arg day_2_string_1130 $day_2_string_1130 '.forecasts[] | select(.period_end == $day_2_string_1130) | .pv_estimate'); if [ -z "$day_2_1130" ]; then day_2_1130=0; fi; day_2_arr+=("$day_2_1130") day_2_12=$(cat $file | jq --arg day_2_string_12 $day_2_string_12 '.forecasts[] | select(.period_end == $day_2_string_12) | .pv_estimate'); if [ -z "$day_2_12" ]; then day_2_12=0; fi; day_2_arr+=("$day_2_12") #day_2_1230=$(cat $file | jq --arg day_2_string_1230 $day_2_string_1230 '.forecasts[] | select(.period_end == $day_2_string_1230) | .pv_estimate'); if [ -z "$day_2_1230" ]; then day_2_1230=0; fi; day_2_arr+=("$day_2_1230") day_2_13=$(cat $file | jq --arg day_2_string_13 $day_2_string_13 '.forecasts[] | select(.period_end == $day_2_string_13) | .pv_estimate'); if [ -z "$day_2_13" ]; then day_2_13=0; fi; day_2_arr+=("$day_2_13") #day_2_1330=$(cat $file | jq --arg day_2_string_1330 $day_2_string_1330 '.forecasts[] | select(.period_end == $day_2_string_1330) | .pv_estimate'); if [ -z "$day_2_1330" ]; then day_2_1330=0; fi; day_2_arr+=("$day_2_1330") day_2_14=$(cat $file | jq --arg day_2_string_14 $day_2_string_14 '.forecasts[] | select(.period_end == $day_2_string_14) | .pv_estimate'); if [ -z "$day_2_14" ]; then day_2_14=0; fi; day_2_arr+=("$day_2_14") #day_2_1430=$(cat $file | jq --arg day_2_string_1430 $day_2_string_1430 '.forecasts[] | select(.period_end == $day_2_string_1430) | .pv_estimate'); if [ -z "$day_2_1430" ]; then day_2_1430=0; fi; day_2_arr+=("$day_2_1430") day_2_15=$(cat $file | jq --arg day_2_string_15 $day_2_string_15 '.forecasts[] | select(.period_end == $day_2_string_15) | .pv_estimate'); if [ -z "$day_2_15" ]; then day_2_15=0; fi; day_2_arr+=("$day_2_15") #day_2_1530=$(cat $file | jq --arg day_2_string_1530 $day_2_string_1530 '.forecasts[] | select(.period_end == $day_2_string_1530) | .pv_estimate'); if [ -z "$day_2_1530" ]; then day_2_1530=0; fi; day_2_arr+=("$day_2_1530") day_2_16=$(cat $file | jq --arg day_2_string_16 $day_2_string_16 '.forecasts[] | select(.period_end == $day_2_string_16) | .pv_estimate'); if [ -z "$day_2_16" ]; then day_2_16=0; fi; day_2_arr+=("$day_2_16") #day_2_1630=$(cat $file | jq --arg day_2_string_1630 $day_2_string_1630 '.forecasts[] | select(.period_end == $day_2_string_1630) | .pv_estimate'); if [ -z "$day_2_1630" ]; then day_2_1630=0; fi; day_2_arr+=("$day_2_1630") day_2_17=$(cat $file | jq --arg day_2_string_17 $day_2_string_17 '.forecasts[] | select(.period_end == $day_2_string_17) | .pv_estimate'); if [ -z "$day_2_17" ]; then day_2_17=0; fi; day_2_arr+=("$day_2_17") #day_2_1730=$(cat $file | jq --arg day_2_string_1730 $day_2_string_1730 '.forecasts[] | select(.period_end == $day_2_string_1730) | .pv_estimate'); if [ -z "$day_2_1730" ]; then day_2_1730=0; fi; day_2_arr+=("$day_2_1730") day_2_18=$(cat $file | jq --arg day_2_string_18 $day_2_string_18 '.forecasts[] | select(.period_end == $day_2_string_18) | .pv_estimate'); if [ -z "$day_2_18" ]; then day_2_18=0; fi; day_2_arr+=("$day_2_18") #day_2_1830=$(cat $file | jq --arg day_2_string_1830 $day_2_string_1830 '.forecasts[] | select(.period_end == $day_2_string_1830) | .pv_estimate'); if [ -z "$day_2_1830" ]; then day_2_1830=0; fi; day_2_arr+=("$day_2_1830") day_2_19=$(cat $file | jq --arg day_2_string_19 $day_2_string_19 '.forecasts[] | select(.period_end == $day_2_string_19) | .pv_estimate'); if [ -z "$day_2_19" ]; then day_2_19=0; fi; day_2_arr+=("$day_2_19") #day_2_1930=$(cat $file | jq --arg day_2_string_1930 $day_2_string_1930 '.forecasts[] | select(.period_end == $day_2_string_1930) | .pv_estimate'); if [ -z "$day_2_1930" ]; then day_2_1930=0; fi; day_2_arr+=("$day_2_1930") day_2_20=$(cat $file | jq --arg day_2_string_20 $day_2_string_20 '.forecasts[] | select(.period_end == $day_2_string_20) | .pv_estimate'); if [ -z "$day_2_20" ]; then day_2_20=0; fi; day_2_arr+=("$day_2_20") #day_2_2030=$(cat $file | jq --arg day_2_string_2030 $day_2_string_2030 '.forecasts[] | select(.period_end == $day_2_string_2030) | .pv_estimate'); if [ -z "$day_2_2030" ]; then day_2_2030=0; fi; day_2_arr+=("$day_2_2030") day_2_21=$(cat $file | jq --arg day_2_string_21 $day_2_string_21 '.forecasts[] | select(.period_end == $day_2_string_21) | .pv_estimate'); if [ -z "$day_2_21" ]; then day_2_21=0; fi; day_2_arr+=("$day_2_21") #day_2_2130=$(cat $file | jq --arg day_2_string_2130 $day_2_string_2130 '.forecasts[] | select(.period_end == $day_2_string_2130) | .pv_estimate'); if [ -z "$day_2_2130" ]; then day_2_2130=0; fi; day_2_arr+=("$day_2_2130") day_2_22=$(cat $file | jq --arg day_2_string_22 $day_2_string_22 '.forecasts[] | select(.period_end == $day_2_string_22) | .pv_estimate'); if [ -z "$day_2_22" ]; then day_2_22=0; fi; day_2_arr+=("$day_2_22") #day_2_2230=$(cat $file | jq --arg day_2_string_2230 $day_2_string_2230 '.forecasts[] | select(.period_end == $day_2_string_2230) | .pv_estimate'); if [ -z "$day_2_2230" ]; then day_2_2230=0; fi; day_2_arr+=("$day_2_2230") day_2_23=$(cat $file | jq --arg day_2_string_23 $day_2_string_23 '.forecasts[] | select(.period_end == $day_2_string_23) | .pv_estimate'); if [ -z "$day_2_23" ]; then day_2_23=0; fi; day_2_arr+=("$day_2_23") #day_2_2330=$(cat fore.json | jq --arg day_2_string_2330 $day_2_string_2330 '.forecasts[] | select(.period_end == $day_2_string_2330) | .pv_estimate'); if [ -z "$day_2_2330" ]; then day_2_2330=0; fi; day_2_arr+=("$day_2_2330") #CALC... sum_day_1=$(IFS="+";bc<<<"${day_1_arr[*]}") sum_day_1_kw=$(echo "scale=3; ($sum_day_1/1)" | bc) sum_day_1_w=$(echo "scale=0; ($sum_day_1_kw*1000)/1" | bc) echo "Sum Day 1: "$sum_day_1_kw "kW / "$sum_day_1_w"W" sum_day_2=$(IFS="+";bc<<<"${day_2_arr[*]}") sum_day_2_kw=$(echo "scale=3; ($sum_day_2/1)" | bc) sum_day_2_w=$(echo "scale=0; ($sum_day_2_kw*1000)/1" | bc) echo "Sum Day 2: "$sum_day_2_kw"kW / "$sum_day_2_w"W" #NEXT X HOURS index_calc1=$(echo "scale=0; ($time_now_h-$time_dif_utc)" | bc) #NEXT 3H index_calc2=$(echo "scale=0; ($index_calc1+3)" | bc) sum_3h=0 if [ $index_calc2 -le 24 ]; then for ((i = $index_calc1; i < $index_calc2; ++i)); do #echo "$i- ${day_1_arr[$i]}" val_3h=${day_1_arr[$i]} sum_3h=$(echo "($sum_3h + ${day_1_arr[$i]})" | bc) done elif [ $index_calc2 -gt 24 ]; then for ((i = $index_calc1; i < 24; ++i)); do echo "$i - ${day_1_arr[$i]}" val_3h=${day_1_arr[$i]} sum_3h=$(echo "($sum_3h + ${day_1_arr[$i]})" | bc) done index_0=$(echo "scale=0; ($index_calc2 - 24)" | bc) for ((i = 0; i < $index_0; ++i)); do #echo "$i - ${day_2_arr[$i]}" val_3h=${day_2_arr[$i]} sum_3h=$(echo "($sum_3h + ${day_2_arr[$i]})" | bc) done fi sum_3h_kw=$(echo "scale=3; ($sum_3h/1)" | bc) sum_3h_w=$(echo "scale=0; ($sum_3h_kw*1000)/1" | bc) echo "Sum next 3h: "$sum_3h_kw"kW / "$sum_3h_w"W" #NEXT 6H index_calc2=$(echo "scale=0; ($index_calc1+6)" | bc) sum_6h=0 if [ $index_calc2 -le 24 ]; then for ((i = $index_calc1; i < $index_calc2; ++i)); do #echo "$i - ${day_1_arr[$i]}" val_6h=${day_1_arr[$i]} sum_6h=$(echo "($sum_6h + ${day_1_arr[$i]})" | bc) done elif [ $index_calc2 -gt 24 ]; then for ((i = $index_calc1; i < 24; ++i)); do #echo "$i - ${day_1_arr[$i]}" val_6h=${day_1_arr[$i]} sum_6h=$(echo "($sum_6h + ${day_1_arr[$i]})" | bc) done index_0=$(echo "scale=0; ($index_calc2 - 24)" | bc) for ((i = 0; i < $index_0; ++i)); do #echo "$i - ${day_2_arr[$i]}" val_6h=${day_2_arr[$i]} sum_6h=$(echo "($sum_6h + ${day_2_arr[$i]})" | bc) done fi sum_6h_kw=$(echo "scale=3; ($sum_6h/1)" | bc) sum_6h_w=$(echo "scale=0; ($sum_6h_kw*1000)/1" | bc) echo "Sum next 6h: "$sum_6h_kw"kW / "$sum_6h_w"W" #MORNING sum_morning=0 index_calc_sm=$(echo "scale=0; (13 - $time_dif_utc)" | bc) for ((i = 0; i < $index_calc_sm; ++i)); do #echo "$i - ${day_1_arr[$i]}" val_morning=${day_1_arr[$i]} sum_morning=$(echo "($sum_morning + ${day_1_arr[$i]})" | bc) done sum_morning_kw=$(echo "scale=3; ($sum_morning/1)" | bc) sum_morning_w=$(echo "scale=0; ($sum_morning_kw*1000)/1" | bc) echo "Sum Morning:: "$sum_morning_kw"kW / "$sum_morning_w"W" #Afernoon sum_afternoon=0 index_calc_sa=$(echo "scale=0; (13 - $time_dif_utc)" | bc) for ((i = $index_calc_sa; i < 24; ++i)); do #echo "$i - ${day_1_arr[$i]}" val_afternoon=${day_1_arr[$i]} sum_afternoon=$(echo "($sum_afternoon + ${day_1_arr[$i]})" | bc) done sum_afternoon_kw=$(echo "scale=3; ($sum_afternoon/1)" | bc) sum_afternoon_w=$(echo "scale=0; ($sum_afternoon_kw*1000)/1" | bc) echo "Sum Afternoon:: "$sum_afternoon_kw"kW / "$sum_afternoon_w"W" echo -n "sc_total.today_w=$sum_day_1_w sc_total.today_kw=$sum_day_1_kw sc_total.tomorrow_w=$sum_day_2_w sc_total.tomorrow_kw=$sum_day_2_kw" >/dev/udp/$MS_IP/$MS_UDP & echo -n "sc_total.morning_w=$sum_morning_w sc_total.morning_kw=$sum_morning_kw sc_total.afternoon_w=$sum_afternoon_w sc_total.afternoon_kw=$sum_afternoon_kw" >/dev/udp/$MS_IP/$MS_UDP & echo -n "sc_next.3.hours_w=$sum_3h_w sc_next.3.hours_kw=$sum_3h_kw sc_next.6.hours_w=$sum_6h_w sc_next.6.hours_kw=$sum_6h_kw" >/dev/udp/$MS_IP/$MS_UDP & rm -rf $file else echo "JSON File not exist" fi echo -n "sc_req.ok=$req_ok" >/dev/udp/$MS_IP/$MS_UDP & exit 0
Code:01 0 * * * root /opt/solcast/sc_calc.sh 00 4 * * * root /opt/solcast/sc_calc.sh 00 5 * * * root /opt/solcast/sc_calc.sh 00 6 * * * root /opt/solcast/sc_calc.sh 00 7 * * * root /opt/solcast/sc_calc.sh 00 8 * * * root /opt/solcast/sc_calc.sh 00 9 * * * root /opt/solcast/sc_calc.sh 00 10 * * * root /opt/solcast/sc_calc.sh 00 11 * * * root /opt/solcast/sc_calc.sh 00 12 * * * root /opt/solcast/sc_calc.sh 00 13 * * * root /opt/solcast/sc_calc.sh 00 14 * * * root /opt/solcast/sc_calc.sh 00 15 * * * root /opt/solcast/sc_calc.sh 00 16 * * * root /opt/solcast/sc_calc.sh 00 17 * * * root /opt/solcast/sc_calc.sh 00 18 * * * root /opt/solcast/sc_calc.sh 00 19 * * * root /opt/solcast/sc_calc.sh 00 20 * * * root /opt/solcast/sc_calc.sh 00 21 * * * root /opt/solcast/sc_calc.sh 00 22 * * * root /opt/solcast/sc_calc.sh
Zuletzt geändert von hismastersvoice; 13.05.2021, 01:09.Kein Support per PN!Kommentar
-
Mit putty per ssh auf den Terminal gehen.
Einloggen mit User loxberry und deinem Passwort. -
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
loxberry@loxberry:~ $ mikdir
-bash: mikdir: command not found
loxberry@loxberry:~ $ mkdir
mkdir: missing operand
Try 'mkdir --help' for more information.
loxberry@loxberry:~ $ mkdir/opt/solcast
-bash: mkdir/opt/solcast: No such file or directory
loxberry@loxberry:~ $ mkdir /opt/solcast
mkdir: cannot create directory ‘/opt/solcast’: Permission denied
loxberry@loxberry:~ $
mache ich noch was anderes falsch?
-
-
hismastersvoice
Thankyou! The script works fine. I haven't got some values yet, but it's night-time here. I should see them roll in tomorrow.
Ich spreche kein Deutsch. Gib Google Translate die Schuld, wenn ich unverständlich bin.Kommentar
-
I'm having a small problem getting crontab to automate the process. I'm currently manually injecting the command -
Code:bash sc_calc.sh
Also a question - Is the sum of daily values local midnight to local midnight? I'm UTC+8, so might I be seeing 0800 local to 0800 local?
Code:day_1_string_0=$(echo $date_1"T00:00:00.0000000Z");
3 BilderIch spreche kein Deutsch. Gib Google Translate die Schuld, wenn ich unverständlich bin.Kommentar
-
Thanks. I did alter the FILE called crontab in /etc. That didn't work. I had success with creating a crontab in -
/opt/loxberry/system/cron/cron.d
following the guide here -
The only issue I had was ongoing emails with error - "TERM environment variable not set." - That was resolved by putting MAILTO="" in the crontab.
Maybe the "TERM environment variable not set" has something to do with why it wasn't working in /etc? -
By adding "/bin/bash" to the crontab, I could get the script executing via the crontab. See below:
01 0 * * * /bin/bash /opt/solcast/sc_calc.sh
00 4 * * * /bin/bash /opt/solcast/sc_calc.sh
00 5 * * * /bin/bash /opt/solcast/sc_calc.sh
00 6 * * * /bin/bash /opt/solcast/sc_calc.sh
00 7 * * * /bin/bash /opt/solcast/sc_calc.sh
00 8 * * * /bin/bash /opt/solcast/sc_calc.sh
00 9 * * * /bin/bash /opt/solcast/sc_calc.sh
00 10 * * * /bin/bash /opt/solcast/sc_calc.sh
00 11 * * * /bin/bash /opt/solcast/sc_calc.sh
00 12 * * * /bin/bash /opt/solcast/sc_calc.sh
00 13 * * * /bin/bash /opt/solcast/sc_calc.sh
00 14 * * * /bin/bash /opt/solcast/sc_calc.sh
00 15 * * * /bin/bash /opt/solcast/sc_calc.sh
00 16 * * * /bin/bash /opt/solcast/sc_calc.sh
00 17 * * * /bin/bash /opt/solcast/sc_calc.sh
00 18 * * * /bin/bash /opt/solcast/sc_calc.sh
Regards,
Chris -
@stoeff99
than the file is not executable 0755
chmod 0755 sc_calc.sh
-
-
I discovered a curious aspect of Virtual Inputs when using the Solcast http URL.
I'm using two different accounts with two separate API keys for different data streams.
1. The Loxberry script and UDP inputs for the Production Forecast (API1) and,
2. Loxone Virtual HTTP Inputs for the retrieval of the Radiation Forecast (API2).
API2 is being polled every 4500 seconds (1hr 15mins). This keeps it within the daily limit of 20 calls.
This works fine until I do any modifications to the Config and use 'Save in Miniserver'. Once this occurs, I notice that I hit the polling limit for API2. The more times I execute 'Save in Miniserver', the earlier in the day I hit the polling limit.
My previous assumption was that Virtual Inputs were not initially polled until after the elapsed time of the polling cycle. ie. 4500 seconds after 'Save in Miniserver'. I expected I should use less polls whenever work is done on the Config, with the first and subsequent polls pushed back by the applicable working time before saving.
My new hypothesis is that the Virtual HTTP Input is polled immediately upon 'Save in Miniserver', just the Command Recognition doesn't work in the immediate timeframe of the reboot. This hypothesis seems to match what I'm observing.
This could be confirmed if someone has a Virtual HTTP Input where the polling address 'does something', rather than being used for Command Recognition.
Curious if anyone can shed some light?Ich spreche kein Deutsch. Gib Google Translate die Schuld, wenn ich unverständlich bin.Kommentar
-
I think the poll is after every restart, and that makes sense to have after a restart the actually values.
I belove that is a thing you can't change.
Kein Support per PN!Kommentar
-
Hi.
Wollte dein Plugin testen, jedoch hab ich ein Problem.
Meine 10kWp Anlage ist auf dem Haudach und auf der Garage verteilt. Jeder Teil zeigt in eine andere Himmelsrichtung.
Leider kann ich in deinem Plugin nur -90 bis +90 eingeben.
Ein Teil meiner Anlage zeigt jedoch nach NordOst was ja -135 sein müsste. Dies geht in deinem Plugin leider nicht.
Wenn ich jedoch im API Aufruf -135 eintrage klappt das einwandfrei.
Kannst du das im Plugin fixen?
DankeKommentar
-
Hi.
Wollte dein Plugin testen, jedoch hab ich ein Problem.
Meine 10kWp Anlage ist auf dem Haudach und auf der Garage verteilt. Jeder Teil zeigt in eine andere Himmelsrichtung.
Leider kann ich in deinem Plugin nur -90 bis +90 eingeben.
Ein Teil meiner Anlage zeigt jedoch nach NordOst was ja -135 sein müsste. Dies geht in deinem Plugin leider nicht.
Wenn ich jedoch im API Aufruf -135 eintrage klappt das einwandfrei.
Kannst du das im Plugin fixen?
Danke
Ich werde an dem Plugin nicht mehr arbeiten und es auch nicht fixen da ich selber nicht mehr installiert habe und auch nicht nutze.
Der Forecast ist einfach zu schlecht, deswegen bin ich auf Solcast gewechselt.Kein Support per PN!Kommentar
-
Du hast als no comercial erst mal 1000 frei, erst wenn die 1000 verbraucht sind geht es los mit den 20. Oder habe die das geändert?
API Usage
Usage Allowance / 520 of 1000 calls remaining
Daily Usage Limit / 20 calls
Daily usage does not apply until the usage allowance is consumed or expires on the 2019-11-16 -
Die Werte sind extrem viel besser bei mir, nur so zB
01.11 ~500W Abweichung
31.10 ~350W Abweichung
30.10 ~700W Abweichung
Sicher gibt es auch mal Ausreißer mit 1-2 kW daneben, aber das ist sehr selten.
Bei pv-forecast waren mehrere kW Abweichung die Regel.
-
-
Verfolge gerade einen anderen Ansatz bei Solcast.
Schick mir den Json Link per NodeRed nach MQTT und mach dort Expand Json data auf einen virtuellen Http Eingang mit 96 Werten in die Zukunft. (30Minuten Takt)
Json Link: https://api.solcast.com.au/world_pv_...i_key=xxxxxxxx
Anbei der Vergleich der 2 Systeme
hismastersvoice machst du im Script die Berechnung der Tagesprognose 1mal am Tag?Zuletzt geändert von AlexAn; 03.11.2019, 12:04.Grüße AlexKommentar
-
Verfolge gerade einen anderen Ansatz bei Solcast.
Schick mir den Json Link per NodeRed nach MQTT und mach dort Expand Json data auf einen virtuellen Http Eingang mit 96 Werten in die Zukunft. (30Minuten Takt)
Json Link: https://api.solcast.com.au/world_pv_...i_key=xxxxxxxx
hismastersvoice machst du im Script die Berechnung der Tagesprognose 1mal am Tag?
Außer das du die Werte je Stunde hast und dafür NodeRed und MTTQ brauchst.
Wenn du die Werte je Stunde willst ist das eine Zeile im Skript zu erweitern.
Ich sehe auch nicht wie du die Zeitverschiebung zwischen UTC und unserer/deiner Zeitzone in die Berechnung mit untergebracht hast?Zuletzt geändert von hismastersvoice; 03.11.2019, 14:02.Kein Support per PN!Kommentar
-
PS: Die halbstündlichen Werte darfst du nicht einzeln aufsummieren, nur die stündlichen. Anderenfalls bekommst du eine Forecast der ~ doppelt so hoch ist wie er sein sollte. -
Ich habe zu beginn auch den Fehler gemacht alles zu addieren.
Bin dann aber schnell drauf gekommen das die Werte immer recht genau doppelt so hoch waren wie die Realität.
Deswegen werte ich nur die vollen Stunden aus, das passt sehr gut.
Die Frage zur Zeitzone würde mich noch interessieren.
-
-
hismastersvoice machst du im Script die Berechnung der Tagesprognose 1mal am Tag?
Mich interessiert ja nicht was heute morgen die Prognose war, sondern die noch folgende Leistung. So ist jede Stunde der Wert geringer.
Was ich aber mache, ich speichere den Prognose Wert morgens um 5 in einen Analogspeichher. Das nutze ich aber nur um zu sehen wie gut die Vorhersage war.
Das ist natürlich nur die halbe Wahrheit, da die Brechungen sich im Tagesverlauf ja noch ändern können.
Zu Testzwecken habe ich mir die json-Datein alle mit Timestamp über mehrer Wochen gespeichert um die Werte zu analysieren.
So bin ich darauf gekommen das die Progonse extrem genau ist.
Auch zB das morgens der Wetr zB für 14 Uhr zB 1,344 kW war und und beim Abruf um 13 Uhr 1,127kW. Wenn ich das nun mit der realen Leistung um 14 Uhr vergleiche (1,14) bin ich sch recht zufrieden das immer wieder neu kalkuliert wird.
Ich nutze die Stunden Leistungen nicht, nur die next 3 oder next 6, so kann ich am besten vorhersehen ob Tockner etc laufen sollen.
Je Stunde ist hier zwar für den Start des Trockners genauer, wenn aber nach einer die Stunde die Leistung einbricht bringt das nix.
Deswegen versuche das ganze etwas aufzuweiten.
Kein Support per PN!Kommentar
-
Hallo
Da ich auch gerade das mit dem Nodered versuche, habe ich eine Frage. Und zwar wie machst du das das d next 3 oder next 6 herausbekommst. Zählst du einfach die zusammen? Wie bekomme ich den Wert zu einem HTTP Virtuellen Eingang. Wenn ich einen Texteingang nehme bekomme ich einen Wert sonst nicht.
DankeKommentar
Kommentar