Page 3 of 9

Re: dzVents version of the Solar Data Script

Posted: Thursday 07 September 2017 12:58
by BakSeeDaa
EddyG wrote: Thursday 07 September 2017 11:34 Perfect, 2.0.6 is running. Tnx.
I wonder if this data could be incorporated in the script to get a better fine tuning of the graph?
8NCCC -- Cloud type information
Especially the: N -- Amount of low clouds covering sky, if no low clouds, the amount of the middle clouds
This might be used to get a float for Octa.
This SYNOP information comes from http://weather.unisys.com/wxp/Appendice ... SYNOP.html
And my station 06260 supports this.
That's actually the value that the script is using. It's an integer.

I will release an update of the script introducing a Cloud Cover sensor (Domoticz dummy device type PERCENTAGE). Then you can have a graph of the cloud cover or automate some things on that. I make it as a percentage sensor.

Re: dzVents version of the Solar Data Script

Posted: Thursday 07 September 2017 13:08
by EddyG
OK fine, looking forward to it. 8-)

dzVents version of the Solar Data Script (V 2.1.0 Released)

Posted: Thursday 07 September 2017 13:27
by BakSeeDaa
Version 2.1.0 is released.

Please read the Change Log and Release Notices.

New features for the enthusiasts... :lol:

Re: dzVents version of the Solar Data Script

Posted: Thursday 07 September 2017 13:38
by EddyG
Unfortunately this formula does not smooth things for me, because okta is fixed with some 9 (or 10?) different values.

Code: Select all

local oktaPercent = round(okta*100/8)
My whole intention is to get a better/smoother Lux value/graph

Re: dzVents version of the Solar Data Script

Posted: Thursday 07 September 2017 14:03
by BakSeeDaa
EddyG wrote: Thursday 07 September 2017 13:38 Unfortunately this formula does not smooth things for me, because okta is fixed with some 9 (or 10?) different values.

Code: Select all

local oktaPercent = round(okta*100/8)
My whole intention is to get a better/smoother Lux value/graph
Unfortunately there is nothing that I can do about that. The octa value is the fraction of the sky that is obscured by clouds, in eighths (one octa means that one eighth of the sky is obscured, two octas that one quarter is obscured, and so on). So it will be 0-8 converted to procent. The synop report doesn't provide better resolution than that. Otherwise I would have used a higher resolution and a higher update frequency if that would have been available. I guess the graph will look a bit better over time.

Re: dzVents version of the Solar Data Script

Posted: Thursday 07 September 2017 16:34
by EddyG
My idea is that the number of cloud layers and the kind of clouds have impact on the Lux value as an extra.
I will investigate further how that could be an part of okta and oktaPercent.
I will let you know if I found some logic.

Re: dzVents version of the Solar Data Script

Posted: Thursday 07 September 2017 16:37
by Bishop
EddyG wrote: Thursday 07 September 2017 16:34 My idea is that the number of cloud layers and the kind of clouds have impact on the Lux value as an extra.
I will investigate further how that could be an part of okta and oktaPercent.
I will let you know if I found some logic.
If I understand you correctly this will result in a more accurate measurement to use with awnings/sunscreens/curtains?

Re: dzVents version of the Solar Data Script

Posted: Thursday 07 September 2017 17:05
by EddyG
Yes, that's my goal.
The current LUX is quit 'jumpy' due to the integer range of octa.
And such a 'jump' could be near twilight.

Re: dzVents version of the Solar Data Script

Posted: Thursday 07 September 2017 19:33
by BakSeeDaa
Version 2.1.1 is released.

Please read the Change Log and Release Notices.

Just a cosmetic fix this time. No need to update if you are at version 2.1.0 already... :lol:

Re: dzVents version of the Solar Data Script

Posted: Saturday 23 September 2017 13:16
by Luigi87
Hi guys,

Edit: seems to work fine, i was impatient.
Thanks for the nice work on the script!

Re: dzVents version of the Solar Data Script

Posted: Tuesday 03 October 2017 17:22
by Luigi87
I now have the script running for a couple of weeks. and it's running very smooth.

But i see also in the data an output for the solar radiation.
As seen in my output below.

Is there a way to get this data also in a Virtual device? i would like to use this data in how strong the sunlight is (for my sunscreens)

Code: Select all

 2017-10-03 17:16:00.211 dzVents: Info: SOLAR 2.1.1: ------ Start internal script: Zonscript:, trigger: every minute
2017-10-03 17:16:00.222 dzVents: Info: SOLAR 2.1.1:
2017-10-03 17:16:00.222 dzVents: Info: SOLAR 2.1.1: ============== SUN LOG ==================
2017-10-03 17:16:00.222 dzVents: Info: SOLAR 2.1.1: Pijnacker, latitude: xxxxx, longitude: xxxxx
2017-10-03 17:16:00.223 dzVents: Info: SOLAR 2.1.1: WU Location WMO = 06200
2017-10-03 17:16:00.223 dzVents: Info: SOLAR 2.1.1: Altitude of the sun = 18.060286588609°
2017-10-03 17:16:00.223 dzVents: Info: SOLAR 2.1.1: Azimuth of the sun = 237.4177969458°
2017-10-03 17:16:00.223 dzVents: Info: SOLAR 2.1.1:
2017-10-03 17:16:00.223 dzVents: Info: SOLAR 2.1.1: SYNOP Station = 06215
2017-10-03 17:16:00.223 dzVents: Info: SOLAR 2.1.1: Okta = 5

2017-10-03 17:16:00.223 dzVents: Info: SOLAR 2.1.1: Direct Radiation = 90.41 W/m²

2017-10-03 17:16:00.223 dzVents: Info: SOLAR 2.1.1: Total weighted lux = 19147.62 Lux
2017-10-03 17:16:00.247 dzVents: Info: SOLAR 2.1.1: ------ Finished Zonscript 

Re: dzVents version of the Solar Data Script

Posted: Wednesday 04 October 2017 8:03
by BakSeeDaa
Luigi87 wrote: Tuesday 03 October 2017 17:22 I now have the script running for a couple of weeks. and it's running very smooth.

But i see also in the data an output for the solar radiation.
As seen in my output below.

Is there a way to get this data also in a Virtual device? i would like to use this data in how strong the sunlight is (for my sunscreens)
...
I'm not the person who originally created the logic behind the calculations of this script.

To support a sensor using the value of "Direct Radiation" wouldn't be hard to implement but isn't that what the Lux sensor is supposed to be used for?

Weighted Lux (Which is used for the Lux sensor) is totalRadiation expressed as W/m² and compensated with the current cloud layer.
totalRadiation = scatteredRadiation + directRadiation

Code: Select all

			directRadiation = RadiationAtm * math.pow(0.6,M) * sinusSunAltitude
			scatteredRadiation = RadiationAtm * (0.271 - 0.294 * math.pow(0.6,M)) * sinusSunAltitude
			totalRadiation = scatteredRadiation + directRadiation
			Lux = totalRadiation / 0.0079  -- Radiation in Lux. 1 Lux = 0,0079 W/m²
			weightedLux = Lux * Kc   -- radiation of the Sun with the cloud layer
A Direct Radiation sensor wouldn't take the cloud layer into calculation and makes no sense to use such a value for anything unless we like to know how bright it theoretically would be if there was no cloud layer.

Re: dzVents version of the Solar Data Script

Posted: Wednesday 04 October 2017 8:34
by Luigi87
BakSeeDaa wrote: Wednesday 04 October 2017 8:03
Luigi87 wrote: Tuesday 03 October 2017 17:22 I now have the script running for a couple of weeks. and it's running very smooth.

But i see also in the data an output for the solar radiation.
As seen in my output below.

Is there a way to get this data also in a Virtual device? i would like to use this data in how strong the sunlight is (for my sunscreens)
...
I'm not the person who originally created the logic behind the calculations of this script.

To support a sensor using the value of "Direct Radiation" wouldn't be hard to implement but isn't that what the Lux sensor is supposed to be used for?

Weighted Lux (Which is used for the Lux sensor) is totalRadiation expressed as W/m² and compensated with the current cloud layer.
totalRadiation = scatteredRadiation + directRadiation

Code: Select all

			directRadiation = RadiationAtm * math.pow(0.6,M) * sinusSunAltitude
			scatteredRadiation = RadiationAtm * (0.271 - 0.294 * math.pow(0.6,M)) * sinusSunAltitude
			totalRadiation = scatteredRadiation + directRadiation
			Lux = totalRadiation / 0.0079  -- Radiation in Lux. 1 Lux = 0,0079 W/m²
			weightedLux = Lux * Kc   -- radiation of the Sun with the cloud layer
A Direct Radiation sensor wouldn't take the cloud layer into calculation and makes no sense to use such a value for anything unless we like to know how bright it theoretically would be if there was no cloud layer.
Thanks BakSeeDaa, sounds very logical. i didn't see the calculation made by the script, indeed without the cloud layer in the calculation the data will be useless.
the reason is asked is, i am searching for the sweet spot when I have to block the sun from entering the windows. and the data output from the lux sensor are very smooth hills with very less variations. maybe I have to wait till the next summer to see the sweet spot in the data :P

Re: dzVents version of the Solar Data Script

Posted: Thursday 05 October 2017 12:15
by Mace
Script has been working fine for a couple of days, but today I started having the following error:
dzVents: Error: SOLAR 2.1.1: Could not read wuAPIData from file: /tmp/log/wuData.json
When I look at the file, it is 0kb...
What is going on?

Re: dzVents version of the Solar Data Script

Posted: Thursday 05 October 2017 12:40
by EdwinK
Not a clue. Working like a charm overhere.

Re: dzVents version of the Solar Data Script

Posted: Thursday 05 October 2017 12:43
by Mace
Thanks for your answer, dorpsgenoot! ;)
I've changed weather station, now it get's data again!

Re: dzVents version of the Solar Data Script

Posted: Thursday 05 October 2017 12:51
by EdwinK
:)

Re: dzVents version of the Solar Data Script

Posted: Saturday 07 October 2017 12:50
by BakSeeDaa
Version 2.2.0 released. Nothing new really (see initial post) but the script now requires dzVents version 2.3.0.

If You upgrade, be sure to save your old configuration part of the script first.

Re: dzVents version of the Solar Data Script

Posted: Saturday 07 October 2017 15:03
by EdwinK
Will do :) Thanks

Re: dzVents version of the Solar Data Script

Posted: Tuesday 10 October 2017 7:17
by EddyG
Mace wrote: Thursday 05 October 2017 12:15 Script has been working fine for a couple of days, but today I started having the following error:
dzVents: Error: SOLAR 2.1.1: Could not read wuAPIData from file: /tmp/log/wuData.json
When I look at the file, it is 0kb...
What is going on?
I get these errors sometimes too.
Perhaps the script could be changed to first save at an other tmp file and if that file is 0 bytes, the old file could be in place.
If the bytes are close to the previous file the file could be copied over the old one.