Power Forecasts and Data-Tuning for Solar Installations (Node-Red / solcast-API / InfluxDB / Grafana)

Hi folks,

at home, I have a freshly installed solar power plant and now wanted to do some information gathering and analysis with its data.

As I can already collect various energy based information in my home to mqtt and influx, including the current solar power, I wanted to compare these to the solar power forecast for my site.

Part I - Introduction

I found a nice service at solcast (https://solcast.com/rooftop-solar/) where you can define your solar power plant (as a hobbyist for free in a so called rooftop-site) and it comes with a well documented API (https://docs.solcast.com.au/#rooftop-sites).

There is also a so called "PV-Tuning" feature, which will allow you to feed back real power measurements from your installation to solcast and these will be used to adjust/tune the forecasts specifically for your installation.
This does include compensation of azimuth/angle of your setup, in case your real installation is different from a single rooftop with a fixed azimuth and angle, which is the only way to define your setup in the solcast rooftop account.

For example, my site has actually two orientations, where the first batch of the solar modules is facing East and the second is facing West, with a different number of modules in East and West orientation.
So I defined a single rooftop, facing South and tried their algorithm.

This is the solcast UI, before tuning:

...and after approx. 10 days of feeding measurements to solcast, it looks like this:

The forecasts have become incredibly accurate, as you can see from my chart yesterday:

Part II - using the solcast API with Node-Red (flows and how its done)

...see next post

3 Likes

Part II - using the solcast API with Node-Red (flows and how its done)

....using the solcast API is faily uncomplicated.

I've created two flows, one for posting measurements and one for collecting forecast data.

As data source for measurements, as well as data destination for solcast estimates, I've used an influxDB, which I already populate with data from my infrastructure.
If you want to use other means to manage your data, your mileage may vary and you will have to adopt to your specific setup, of course.

flow A) sending measurements from influxDB to your solcast rooftop acount

Originally the data for measurements is coming from my solar inverter.
As I have a quite sophisticated EV-Charging station that is capable of charging the vehicle optimized to the current flow of solar power available, the data is already collected there, including some more information.
Therefore I refrained from directly accessing my inverter (via modbus-tcp) but integrated with my EV charging station to collect the data and transfer this to influxDB (via mqqt-telegraf-influxDB toolchain).

The destination is described in the solcast API, here: Solcast API
This is a simple HTTP(S) request to the API, sending the data as an array in JSON format.
You can invoke the API-service as often as you want (it is not counting against the number of 20 allowed API calls per day with your free hobbyist rooftop account). Also re-sending measurements already sent earlier is not a problems, as these will simply be overridden.
I finally resorted to collect and send data for from the last 25hours in an interval once every 24hours.
The flow offers some predefined injection-nodes with dataseries from other time-spans, that can be invoked manually.

My flow for posting measurements to solcast looks like this:


The different influxDB queries are defined manually inside the change-nodes.
The minimum intervall that can be given for a measurement is 5minutes, which is what I choose in the queries.

This is the influxDb query for the 25hrs recurring collection interval:

SELECT mean("value") / -1000 FROM "autogen"."mqtt_consumer" WHERE ("topic" = 'openWB/pv/W') AND (time >= now()-25h AND time <= now()-7m) GROUP BY time(5m) fill(0)

As my data is stored in W, but measurements are expected in kW units, notice the "* 1000" math operation inside the query. Also non existing data in that interval (when its dark, normally no solar data will be captured from the inverter) will be filled with "0" (number zero).
My data/influx measurements is stored via telegraf from mqtt topics, so in my example the measurement from influxDB is "openWB/pv/W". You will need to select the correct measurement in your own query.

I noticed, that the solcast API-Service can be sometimes "flaky", so an API invocation might fail occasionally . I catched the HTTP-response and if not a status 200, the message gets recreated after 5mins....works every time so far.

Inside the HTTP-Request node, you will have to specify the URL and credentials.
The URL is based on/comprised of your rooftop account ID and you can use basic identification with the use of your solcast API-Token as Username. Both information you can easily get from your solcast account info.

This is what the setup of the node looks like:

...and here's the flow:

solcast-measurements-flow.json (7.1 KB)

flow B) retrieving solcast estimates/forecasts and storing in influxDB

The flow for retrieving the forecasts is similar.
This is what the flow looks like:

I am using a special inject node from here: [ANNOUNCE] Ultimate (Swiss-Army-Knife) Node-Red Timer based flow control where I can run a number of events between dates (sunrise/sundown).
The hobbyist rooftop account will allow for 20 queries per day, so a counter-node is introduced to match/route this requirement, while events are created (using node-red-contrib-counter (node) - Node-RED).

Also other inject nodes are there to allow for manual injection and/or resetting the counter, which is nice for testing (during the first three month of your rooftop account, the limit will not be enforced until he first 1000 API-calls are used up).
Again, like in the measurement flow, of the API-call fails occasionally, a retry will be scheduled after 3mins. I found, that even when the call fails, the attempt will be counted against the number of calls, so the retry will increase the counter...just in case.

The API has two separate services, estimated actuals and forecasts.
The HTTP(S) node is configured similar, but with a GET Method and waiting/parsing a JSON response. using rooftop-id in the URL and API-Token as Username with basic authentication.

After a successful retrieval, the data (JSON array) gets re-formatted to be fed into the influxDB-node.
Here I opted to send each individual data point/message into the node. My current influxDB and node-Red instance would easily cope with the "stress", but generating a single bulk-message for influxDB is certainly possible. A single API-Call will create 336 data points.

Here's the flow:

solcast-estimates-flow.json (23.9 KB)

..and here are some pics from my grafana dashboards.

PV-Tuning kicks in only after some days (my site took 10 days) of feeding measurements, but the results are pretty impressive, I think.

...forecasts this week:

...values from last week:

...hope you enjoy it...feel free to ask questions or details I missed.

regards,
Fred

2 Likes

Fred

I was reinventing the wheel I think
As far as I understood your setup: you're reading out your inverters with another system and maybe also the in and out of the grid (use of or injection into) and put these information in openWB. With openWB you're commanding your wallbox and can choose to charge only with the excess of solar power.
The same setup for me: a PV installation, a go-echarger, for a long time vzlogger to read out my digital meter (in/out of the grid) that runs on a rpi0W. Lately a second rpi0W (to test first) with openWB and it workes fine. No readout at this moment of the SMA bluetooth inverters (2).
Previously the rpi0W to readout the meter was an old notebook with BT and SBFspot was running, Now I've to checkout why the raspbian doesn't want to find the BT hardware.
But instead of doing that I was looking for more flexibility of what I'd like to do with the follwing upcoming rules in mind (2021 or 2022)
The electricity distribution compagny want to change the billing and they will split the bill in 2 parts, one fix part and one part depending on the consumption.
And it's that fix part that bothers me. They want to bill it depending the max amount of grid use in a quarter of an hour. The max of each month will be used as an yearly average to calculate that fee with a minimum of 2,5kWh.
So with what I've now vzlogger and openWB I can't do a lot to reduce that bill especially in winter.
I should need a system where I can forecast the amount of sun a day and the next day will produce (solcast and your flows). Depending that forecast I've to use only sunpower or I can use sun and grid power but I want to limit the grid power (in) probabely 2,5kW, the minimum fee for the fix bill component.
Therefore I was looking to put everything in node-red, to be more flexible.
I already saw, not tested, a node for the digital meter, saw that SBFspot has the ability to send its info to MQTT.
Why are you still using openWB and did not put everything in node-red yet?

A small home battery will be needed in the future to help out the mentionned limit, but commandable battery inverters are rare at this moment.

BR

Hi,
that is an interesting setup and UseCase.

Yes, I am also gathering the Power flow at grid level with an MPM3PM meter (openWB EVU-Kit).
The reason I decided not to put everything in node-red is at the end risk based.

In order for EV charging to be based on available access power at grid level, openWB needs the data in any case.
However I am uncertain how many simultaneous connections the modbus devices would allow (and at what reading frequency - ie. SMA is very conservative in their docs)
So using both (node-red or openWB) simultaneously over modbus has a risk of overlaoding the inverter/grid-meter modbus readouts.

I have a test flow, based on integration via mqtt from openWB and with modbus-tcp for connecting my SMA inverter and grid meter directly and show these in parallel on the dashboard.
The results are showing that openWB is doing a good job, although only reading out the data in 10sec intervals (I can share it, if you want).
If using modbus with node-red alone, then feeding this back to openWB via mqtt is certainly possible, but I decided to not do that until I need better resolution, over the 10sec interval openWB provided.

For integration with node-red, I would actually prefer using mqtt over anything else. This is the safest option, IMHO.
Therefore another integration option with node-red for you could be mbmd from volkszaehler.og.
Its a modbus deamon that can read many meter and inverter types, then pushing to mqtt (for influxdb, also telegraf has modbus plugin now). Also openhab and iobroker, FHEM have many integration option for meters and offer mqtt-support.
As for your SMA inverter running bluetooth only, I have no clue. Maybe upgrade with the webconnect module?

The challenge with solcast in your case, I see is pv-tuning.
You will need the PV measurements from your setup in order to do that and get a good result.

Edit: BTW, this is how my dashbord looks like while charging from PV:

Here`s a partial update, with a separate flow that would allow to create calls to the API (forecasts and estimated_actuals) between times at an equidistant interval.

[{"id":"1fd8cac4.8f5445","type":"tab","label":"solcast timer","disabled":false,"info":""},{"id":"313aadae.e6d532","type":"sun-position","z":"1fd8cac4.8f5445","name":"suncalc forecasts","positionConfig":"8c7609ce.dd5798","rules":[],"onlyOnChange":"true","topic":"suncalc-1","outputs":1,"start":"sunrise","startType":"pdsTime","startOffset":0,"startOffsetType":"none","startOffsetMultiplier":60000,"end":"sunset","endType":"pdsTime","endOffset":0,"endOffsetType":"none","endOffsetMultiplier":60000,"x":514,"y":100,"wires":[["5f40d18.f5a843"]]},{"id":"5551575d.3a2058","type":"time-inject","z":"1fd8cac4.8f5445","name":"","nameInt":"⏲ Sonnenaufgang Begin = Zeitpunkt","positionConfig":"8c7609ce.dd5798","payload":"","payloadType":"date","payloadTimeFormat":0,"payloadOffset":0,"payloadOffsetType":"none","payloadOffsetMultiplier":60000,"topic":"start","injectTypeSelect":"time","intervalCount":1,"intervalCountType":"num","intervalCountMultiplier":60000,"time":"sunrise","timeType":"pdsTime","offset":0,"offsetType":"none","offsetMultiplier":60000,"timeEnd":"","timeEndType":"entered","timeEndOffset":0,"timeEndOffsetType":"none","timeEndOffsetMultiplier":60000,"timeDays":"*","timeOnlyOddDays":false,"timeOnlyEvenDays":false,"timeMonths":"*","timedatestart":"","timedateend":"","property":"","propertyType":"none","propertyCompare":"true","propertyThreshold":"","propertyThresholdType":"num","timeAlt":"","timeAltType":"entered","timeAltDays":"*","timeAltOnlyOddDays":false,"timeAltOnlyEvenDays":false,"timeAltMonths":"*","timeAltOffset":0,"timeAltOffsetType":"none","timeAltOffsetMultiplier":60000,"once":false,"onceDelay":0.1,"addPayload1":"","addPayload1Type":"none","addPayload1Value":"","addPayload1ValueType":"date","addPayload1Format":"0","addPayload1Offset":0,"addPayload1OffsetType":"none","addPayload1OffsetMultiplier":60000,"addPayload1Next":true,"addPayload1Days":"*","addPayload2":"","addPayload2Type":"none","addPayload2Value":"","addPayload2ValueType":"date","addPayload2Format":"0","addPayload2Offset":0,"addPayload2OffsetType":"none","addPayload2OffsetMultiplier":60000,"addPayload2Next":true,"addPayload2Days":"*","addPayload3":"","addPayload3Type":"none","addPayload3Value":"","addPayload3ValueType":"date","addPayload3Format":"0","addPayload3Offset":0,"addPayload3OffsetType":"none","addPayload3OffsetMultiplier":60000,"addPayload3Next":true,"addPayload3Days":"*","recalcTime":2,"x":220,"y":220,"wires":[["132cc14d.35a44f","9354a22a.97b1","33de93bc.8926cc","8b30894a.3f0618"]]},{"id":"9729d616.48af08","type":"time-inject","z":"1fd8cac4.8f5445","name":"","nameInt":"⏲ Sonnenuntergang Ende↷ = Zeitpunkt","positionConfig":"8c7609ce.dd5798","payload":"","payloadType":"date","payloadTimeFormat":0,"payloadOffset":0,"payloadOffsetType":"none","payloadOffsetMultiplier":60000,"topic":"stop","injectTypeSelect":"time","intervalCount":1,"intervalCountType":"num","intervalCountMultiplier":60000,"time":"sunset","timeType":"pdsTime","offset":"15","offsetType":"num","offsetMultiplier":60000,"timeEnd":"","timeEndType":"entered","timeEndOffset":0,"timeEndOffsetType":"none","timeEndOffsetMultiplier":60000,"timeDays":"*","timeOnlyOddDays":false,"timeOnlyEvenDays":false,"timeMonths":"*","timedatestart":"","timedateend":"","property":"","propertyType":"none","propertyCompare":"true","propertyThreshold":"","propertyThresholdType":"num","timeAlt":"","timeAltType":"entered","timeAltDays":"*","timeAltOnlyOddDays":false,"timeAltOnlyEvenDays":false,"timeAltMonths":"*","timeAltOffset":0,"timeAltOffsetType":"none","timeAltOffsetMultiplier":60000,"once":false,"onceDelay":0.1,"addPayload1":"","addPayload1Type":"none","addPayload1Value":"","addPayload1ValueType":"date","addPayload1Format":"0","addPayload1Offset":0,"addPayload1OffsetType":"none","addPayload1OffsetMultiplier":60000,"addPayload1Next":true,"addPayload1Days":"*","addPayload2":"","addPayload2Type":"none","addPayload2Value":"","addPayload2ValueType":"date","addPayload2Format":"0","addPayload2Offset":0,"addPayload2OffsetType":"none","addPayload2OffsetMultiplier":60000,"addPayload2Next":true,"addPayload2Days":"*","addPayload3":"","addPayload3Type":"none","addPayload3Value":"","addPayload3ValueType":"date","addPayload3Format":"0","addPayload3Offset":0,"addPayload3OffsetType":"none","addPayload3OffsetMultiplier":60000,"addPayload3Next":true,"addPayload3Days":"*","recalcTime":2,"x":240,"y":300,"wires":[["9354a22a.97b1","33de93bc.8926cc"]]},{"id":"5b62f0eb.a59f","type":"inject","z":"1fd8cac4.8f5445","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"inject","payload":"0","payloadType":"str","x":150,"y":100,"wires":[["313aadae.e6d532"]]},{"id":"5f40d18.f5a843","type":"change","z":"1fd8cac4.8f5445","name":"set interval (forecasts)","rules":[{"t":"set","p":"iterations","pt":"msg","to":"8","tot":"num"},{"t":"set","p":"intervalLength","pt":"msg","to":"payload.endTime - payload.startTime","tot":"jsonata"},{"t":"set","p":"interval","pt":"msg","to":"$ceil(intervalLength / (iterations-1))","tot":"jsonata"},{"t":"move","p":"interval","pt":"msg","to":"payload","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"interval","tot":"str"},{"t":"delete","p":"iterations","pt":"msg"},{"t":"delete","p":"intervalLength","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":780,"y":100,"wires":[["9354a22a.97b1"]]},{"id":"d2a66d94.cdde6","type":"link out","z":"1fd8cac4.8f5445","name":"timer estimates","links":["26296625.2bcada"],"x":1415,"y":400,"wires":[]},{"id":"b2c4ddba.9457d","type":"link out","z":"1fd8cac4.8f5445","name":"timer forecasts","links":["fd68fcd0.4f817"],"x":1415,"y":100,"wires":[]},{"id":"6bc9fd1b.c3df54","type":"inject","z":"1fd8cac4.8f5445","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"inject","payload":"0","payloadType":"num","x":170,"y":400,"wires":[["d3131449.ea8408"]]},{"id":"d3131449.ea8408","type":"sun-position","z":"1fd8cac4.8f5445","name":"suncalc estimates","positionConfig":"8c7609ce.dd5798","rules":[],"onlyOnChange":"true","topic":"suncalc-2","outputs":1,"start":"sunrise","startType":"pdsTime","startOffset":"-2","startOffsetType":"num","startOffsetMultiplier":"3600000","end":"sunset","endType":"pdsTime","endOffset":0,"endOffsetType":"none","endOffsetMultiplier":60000,"x":510,"y":400,"wires":[["ab80d6ae.e5ecf8"]]},{"id":"8c4daa98.397c78","type":"change","z":"1fd8cac4.8f5445","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"date"},{"t":"set","p":"topic","pt":"msg","to":"forecasts","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1240,"y":100,"wires":[["b2c4ddba.9457d"]]},{"id":"2dce9a6.1fbc666","type":"change","z":"1fd8cac4.8f5445","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"date"},{"t":"set","p":"topic","pt":"msg","to":"estimated_actuals","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1240,"y":400,"wires":[["d2a66d94.cdde6"]]},{"id":"9354a22a.97b1","type":"dsm","z":"1fd8cac4.8f5445","name":"interval","sm_config":"{\n    \"stateOutput\": \"state\",\n    \"currentState\": \"stopped\",\n    \"states\": {\n        \"stopped\": {\n            \"start\": \"started\"\n        },\n        \"started\": {\n            \"run\": \"running\",\n            \"stop\": \"stopped\"\n        },\n        \"running\": {\n            \"run\": \"running\",\n            \"stop\": \"stopped\"\n        }\n    },\n    \"data\": {\n        \"interval\": 2000\n    },\n    \"methods\": {\n        \"interval\": {\n            \"name\": \"setData\"\n        },\n        \"start\":  [\n            \"if (sm.currentState === 'started') {\",\n            \"   node.send(msg);\",\n            \"   resume('run',msg);\",\n            \"}\"\n        ],\n        \"run\": [\n            \"timeout.interval = setTimeout(function() {\",\n            \"   node.send(msg);\",\n            \"   resume('run',msg);\",\n            \"}, sm.data.interval);\"\n        ],\n        \"stop\": [\n            \"if (timeout.interval) {\",\n            \"   clearTimeout(timeout.interval);\",\n            \"}\"\n        ],\n        \"onAfterTransition\": \"output = false;\",\n        \"status\": {\n            \"fill\": {\n                \"get\": \"sm.currentState === 'running' ? 'green' : 'grey'\"\n            },\n            \"shape\": \"dot\",\n            \"text\": {\n                \"get\": \"sm.currentState === 'running' ? 'interval ' + sm.data.interval : sm.currentState\"\n            }\n        }\n    }\n}","x":1020,"y":220,"wires":[["8f1bbf80.3c69f","8c4daa98.397c78"]]},{"id":"33de93bc.8926cc","type":"dsm","z":"1fd8cac4.8f5445","name":"interval","sm_config":"{\n    \"stateOutput\": \"state\",\n    \"currentState\": \"stopped\",\n    \"states\": {\n        \"stopped\": {\n            \"start\": \"started\"\n        },\n        \"started\": {\n            \"run\": \"running\",\n            \"stop\": \"stopped\"\n        },\n        \"running\": {\n            \"run\": \"running\",\n            \"stop\": \"stopped\"\n        }\n    },\n    \"data\": {\n        \"interval\": 2000\n    },\n    \"methods\": {\n        \"interval\": {\n            \"name\": \"setData\"\n        },\n        \"start\":  [\n            \"if (sm.currentState === 'started') {\",\n            \"   node.send(msg);\",\n            \"   resume('run',msg);\",\n            \"}\"\n        ],\n        \"run\": [\n            \"timeout.interval = setTimeout(function() {\",\n            \"   node.send(msg);\",\n            \"   resume('run',msg);\",\n            \"}, sm.data.interval);\"\n        ],\n        \"stop\": [\n            \"if (timeout.interval) {\",\n            \"   clearTimeout(timeout.interval);\",\n            \"}\"\n        ],\n        \"onAfterTransition\": \"output = false;\",\n        \"status\": {\n            \"fill\": {\n                \"get\": \"sm.currentState === 'running' ? 'green' : 'grey'\"\n            },\n            \"shape\": \"dot\",\n            \"text\": {\n                \"get\": \"sm.currentState === 'running' ? 'interval ' + sm.data.interval : sm.currentState\"\n            }\n        }\n    }\n}","x":1020,"y":280,"wires":[["8f1bbf80.3c69f","2dce9a6.1fbc666"]]},{"id":"ab80d6ae.e5ecf8","type":"change","z":"1fd8cac4.8f5445","name":"set interval (estimates)","rules":[{"t":"set","p":"iterations","pt":"msg","to":"8","tot":"num"},{"t":"set","p":"intervalLength","pt":"msg","to":"payload.endTime - payload.startTime","tot":"jsonata"},{"t":"set","p":"interval","pt":"msg","to":"$ceil(intervalLength / (iterations-1))","tot":"jsonata"},{"t":"move","p":"interval","pt":"msg","to":"payload","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"interval","tot":"str"},{"t":"delete","p":"iterations","pt":"msg"},{"t":"delete","p":"intervalLength","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":800,"y":400,"wires":[["33de93bc.8926cc"]]},{"id":"132cc14d.35a44f","type":"delay","z":"1fd8cac4.8f5445","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":320,"y":160,"wires":[["313aadae.e6d532"]]},{"id":"8b30894a.3f0618","type":"delay","z":"1fd8cac4.8f5445","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":380,"y":347,"wires":[["d3131449.ea8408"]]},{"id":"8f1bbf80.3c69f","type":"debug","z":"1fd8cac4.8f5445","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1330,"y":240,"wires":[]},{"id":"8c7609ce.dd5798","type":"position-config","z":"","name":"DACH-1","isValide":"true","longitude":"0","latitude":"0","angleType":"deg","timeZoneOffset":"99","timeZoneDST":"0","stateTimeFormat":"3","stateDateFormat":"12"}]

...it makes use of the sun-position (https://flows.nodered.org/node/node-red-contrib-sun-position) node, as well as dsm node with interval configuration (https://github.com/cflurin/node-red-contrib-dsm/wiki/Interval).

Combine it with a slightly modified version of flow B, from above.

[{"id":"32266837.fdbe88","type":"tab","label":"solcast API","disabled":false,"info":""},{"id":"21f2593a.771e66","type":"http request","z":"32266837.fdbe88","name":"Solcast API - get Live+Forecast JSON","method":"GET","ret":"obj","paytoqs":false,"url":"https://api.solcast.com.au/rooftop_sites/<your-rooftop-id-here>/forecasts?format=json","tls":"","persist":false,"proxy":"","authType":"basic","x":922,"y":460,"wires":[["a6c53186.54f16"]]},{"id":"6abdc0ec.b0703","type":"debug","z":"32266837.fdbe88","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1370,"y":520,"wires":[]},{"id":"ba47e82d.894b58","type":"http request","z":"32266837.fdbe88","name":"Solcast API - get Past + Estimated Actuals","method":"GET","ret":"obj","paytoqs":false,"url":"https://api.solcast.com.au/rooftop_sites/<your-rooftop-id-here>/estimated_actuals?format=json","tls":"","persist":false,"proxy":"","authType":"basic","x":720,"y":320,"wires":[["a6c53186.54f16"]]},{"id":"a6c53186.54f16","type":"switch","z":"32266837.fdbe88","name":"StatusCode","property":"statusCode","propertyType":"msg","rules":[{"t":"eq","v":"200","vt":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1199,"y":460,"wires":[["be5f401f.66f5c"],["6abdc0ec.b0703","e6e348ec.18b858"]]},{"id":"de74762b.088578","type":"split","z":"32266837.fdbe88","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":867,"y":160,"wires":[["b7a911ed.41d26"]]},{"id":"5df49bf4.59df34","type":"join","z":"32266837.fdbe88","name":"","mode":"auto","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1234,"y":159,"wires":[["5afa3e4e.b475f","cbb479d8.451368"]]},{"id":"b7a911ed.41d26","type":"change","z":"32266837.fdbe88","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"[[\t{\"value\": $.payload.pv_estimate * 1000,\t\"time\": $toMillis($.payload.period_end) - 1800000},\t{\"topic\": \"pv_estimate\"}\t],\t[\t{\"value\": $.payload.pv_estimate10 * 1000,\t\"time\": $toMillis($.payload.period_end) - 1800000},\t{\"topic\": \"pv_estimate10\"}\t],\t[\t{\"value\": $.payload.pv_estimate90 * 1000,\t\"time\": $toMillis($.payload.period_end) - 1800000},\t{\"topic\": \"pv_estimate90\"}\t]\t]","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1027,"y":160,"wires":[["5df49bf4.59df34","264bbb44.61e064"]]},{"id":"264bbb44.61e064","type":"influxdb out","z":"32266837.fdbe88","influxdb":"e07787.cd769878","name":"solcast","measurement":"solcast","precision":"ms","retentionPolicy":"","x":1224,"y":103,"wires":[]},{"id":"e6e348ec.18b858","type":"change","z":"32266837.fdbe88","name":"timestamp","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"date"},{"t":"delete","p":"statusCode","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":380,"wires":[["ae447bdd.ffe208"]]},{"id":"ae447bdd.ffe208","type":"delay","z":"32266837.fdbe88","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":640,"y":460,"wires":[["c59bea9b.7ae128","becb3de9.218db"]]},{"id":"21b9fd1e.1b65b2","type":"within-time-switch","z":"32266837.fdbe88","name":"neuer Tag?","nameInt":"","positionConfig":"8c7609ce.dd5798","startTime":"sunrise","startTimeType":"pdsTime","startOffset":"-15","startOffsetType":"num","startOffsetMultiplier":60000,"endTime":"sunset","endTimeType":"pdsTime","endOffset":"30","endOffsetType":"num","endOffsetMultiplier":60000,"timeDays":"*","timeOnlyOddDays":false,"timeOnlyEvenDays":false,"timeMonths":"*","timedatestart":"","timedateend":"","propertyStart":"","propertyStartType":"none","propertyStartCompare":"true","propertyStartThreshold":"","propertyStartThresholdType":"num","startTimeAlt":"","startTimeAltType":"entered","startOffsetAlt":0,"startOffsetAltType":"none","startOffsetAltMultiplier":60000,"propertyEnd":"","propertyEndType":"none","propertyEndCompare":"true","propertyEndThreshold":"","propertyEndThresholdType":"num","endTimeAlt":"","endTimeAltType":"entered","endOffsetAlt":0,"endOffsetAltType":"none","endOffsetAltMultiplier":60000,"tsCompare":"0","x":304,"y":422,"wires":[["c59bea9b.7ae128"],["5a6a78b2.1bb548"]]},{"id":"5f5faa37.8a57a4","type":"inject","z":"32266837.fdbe88","name":"forecasts","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"forecasts","payload":"","payloadType":"date","x":126,"y":735,"wires":[["c59bea9b.7ae128"]]},{"id":"5a6a78b2.1bb548","type":"change","z":"32266837.fdbe88","name":"reset counter","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"},{"t":"set","p":"topic.reset","pt":"msg","to":"reset","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":470,"y":619,"wires":[["c59bea9b.7ae128","cbb479d8.451368","42c07bc5.59caa4","becb3de9.218db"]]},{"id":"c59bea9b.7ae128","type":"counter","z":"32266837.fdbe88","name":"Counter","init":"0","step":"1","lower":"","upper":"","mode":"increment","outputs":"1","x":739,"y":619,"wires":[["65b9dc96.ae3184","dfaff625.bb0808"]]},{"id":"42b74548.b7641c","type":"switch","z":"32266837.fdbe88","name":"counter","property":"count","propertyType":"msg","rules":[{"t":"btwn","v":"1","vt":"num","v2":"20","v2t":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1109,"y":619,"wires":[["6b7ba7c6.8cd608"],["6abdc0ec.b0703"]]},{"id":"65b9dc96.ae3184","type":"change","z":"32266837.fdbe88","name":"","rules":[{"t":"delete","p":"reset","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":927,"y":619,"wires":[["42b74548.b7641c"]]},{"id":"be5f401f.66f5c","type":"switch","z":"32266837.fdbe88","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"estimated_actuals","vt":"str"},{"t":"eq","v":"forecasts","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":370,"y":100,"wires":[["2d9205e4.b6f57a"],["686ddd2f.0bcc64"]]},{"id":"5e3c32f5.6a245c","type":"split","z":"32266837.fdbe88","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":870,"y":41,"wires":[["7aca0184.04cd8"]]},{"id":"7aca0184.04cd8","type":"change","z":"32266837.fdbe88","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"[\t{\"value\": $.payload.pv_estimate * 1000,\t\"time\": $toMillis($.payload.period_end) - 1800000},\t{\"topic\": \"pv_estimate\"}\t]","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1032,"y":41,"wires":[["ac93c718.446698","264bbb44.61e064"]]},{"id":"383e8c45.6f01e4","type":"inject","z":"32266837.fdbe88","name":"tägl. 02:00Uhr","repeat":"","crontab":"00 02 * * *","once":false,"onceDelay":0.1,"topic":"Counter_Reset","payload":"","payloadType":"date","x":147,"y":581,"wires":[["21b9fd1e.1b65b2"]]},{"id":"6b7ba7c6.8cd608","type":"switch","z":"32266837.fdbe88","name":"topic","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"estimated_actuals","vt":"str"},{"t":"eq","v":"forecasts","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":490,"y":372,"wires":[["ba47e82d.894b58"],["21f2593a.771e66"]]},{"id":"5a8f1cb1.deed44","type":"inject","z":"32266837.fdbe88","name":"estimated_actuals","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"estimated_actuals","payload":"","payloadType":"date","x":155,"y":793,"wires":[["c59bea9b.7ae128"]]},{"id":"7f1c965b.e60e98","type":"comment","z":"32266837.fdbe88","name":"Manuelle Abfragen","info":"","x":146,"y":695,"wires":[]},{"id":"73a068c2.669b08","type":"comment","z":"32266837.fdbe88","name":"Zeitgesteuerte Abfragen","info":"","x":160,"y":300,"wires":[]},{"id":"2a3f1855.356228","type":"comment","z":"32266837.fdbe88","name":"API abfragen","info":"","x":970,"y":380,"wires":[]},{"id":"64b0e77c.d73928","type":"comment","z":"32266837.fdbe88","name":"InfluxDB füllen","info":"","x":370,"y":60,"wires":[]},{"id":"a5d6bcfd.2549e","type":"comment","z":"32266837.fdbe88","name":"1-20 API-Calls pro Tag möglich","info":"","x":895,"y":580,"wires":[]},{"id":"ac93c718.446698","type":"join","z":"32266837.fdbe88","name":"","mode":"auto","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1234,"y":41,"wires":[["5afa3e4e.b475f","42c07bc5.59caa4"]]},{"id":"5afa3e4e.b475f","type":"debug","z":"32266837.fdbe88","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1389,"y":120,"wires":[]},{"id":"686ddd2f.0bcc64","type":"change","z":"32266837.fdbe88","name":"","rules":[{"t":"move","p":"payload.forecasts","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":160,"wires":[["de74762b.088578"]]},{"id":"2d9205e4.b6f57a","type":"change","z":"32266837.fdbe88","name":"","rules":[{"t":"move","p":"payload.estimated_actuals","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":41,"wires":[["5e3c32f5.6a245c"]]},{"id":"ab24add7.baf8","type":"comment","z":"32266837.fdbe88","name":"API-Call Counter rücksetzen","info":"","x":159,"y":541,"wires":[]},{"id":"d8311a4.20934e8","type":"inject","z":"32266837.fdbe88","name":"Counter_Reset","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"Counter_Reset","payload":"","payloadType":"date","x":146,"y":618,"wires":[["5a6a78b2.1bb548"]]},{"id":"dfaff625.bb0808","type":"debug","z":"32266837.fdbe88","name":"total requests","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"count","targetType":"msg","x":1060,"y":500,"wires":[]},{"id":"42c07bc5.59caa4","type":"counter","z":"32266837.fdbe88","name":"Counter","init":"0","step":"1","lower":"","upper":"","mode":"increment","outputs":"1","x":1260,"y":220,"wires":[["657c722f.c5c9bc"]]},{"id":"657c722f.c5c9bc","type":"debug","z":"32266837.fdbe88","name":"estimated actuals timed","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"count","targetType":"msg","x":1510,"y":220,"wires":[]},{"id":"cbb479d8.451368","type":"counter","z":"32266837.fdbe88","name":"Counter","init":"0","step":"1","lower":"","upper":"","mode":"increment","outputs":"1","x":1260,"y":280,"wires":[["29137b10.8d3bd4"]]},{"id":"29137b10.8d3bd4","type":"debug","z":"32266837.fdbe88","name":"forecasts timed","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"count","targetType":"msg","x":1540,"y":280,"wires":[]},{"id":"da6427ef.e69458","type":"debug","z":"32266837.fdbe88","name":"total retries","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"count","targetType":"msg","x":850,"y":520,"wires":[]},{"id":"becb3de9.218db","type":"counter","z":"32266837.fdbe88","name":"Counter","init":"0","step":"1","lower":"","upper":"","mode":"increment","outputs":"1","x":680,"y":520,"wires":[["da6427ef.e69458"]]},{"id":"26296625.2bcada","type":"link in","z":"32266837.fdbe88","name":"from timer estimates","links":["d2a66d94.cdde6"],"x":115,"y":360,"wires":[["21b9fd1e.1b65b2"]]},{"id":"fd68fcd0.4f817","type":"link in","z":"32266837.fdbe88","name":"from timer forecasts","links":["b2c4ddba.9457d"],"x":115,"y":460,"wires":[["21b9fd1e.1b65b2"]]},{"id":"e07787.cd769878","type":"influxdb","z":"","hostname":"192.168.10.44","port":"8086","protocol":"http","database":"openWB","name":"openWB","usetls":false,"tls":""},{"id":"8c7609ce.dd5798","type":"position-config","z":"","name":"DACH-1","isValide":"true","longitude":"0","latitude":"0","angleType":"deg","timeZoneOffset":"99","timeZoneDST":"0","stateTimeFormat":"3","stateDateFormat":"12"}]

This topic was automatically closed after 60 days. New replies are no longer allowed.