dzVents version of the Solar Data Script  [SOLVED]

Moderator: leecollings

BakSeeDaa
Posts: 485
Joined: Thursday 17 September 2015 10:13
Target OS: Raspberry Pi / ODroid
Domoticz version:

Re: dzVents version of the Solar Data Script

Post 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.
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: dzVents version of the Solar Data Script

Post by EddyG »

OK fine, looking forward to it. 8-)
BakSeeDaa
Posts: 485
Joined: Thursday 17 September 2015 10:13
Target OS: Raspberry Pi / ODroid
Domoticz version:

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

Post by BakSeeDaa »

Version 2.1.0 is released.

Please read the Change Log and Release Notices.

New features for the enthusiasts... :lol:
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: dzVents version of the Solar Data Script

Post 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
BakSeeDaa
Posts: 485
Joined: Thursday 17 September 2015 10:13
Target OS: Raspberry Pi / ODroid
Domoticz version:

Re: dzVents version of the Solar Data Script

Post 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.
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: dzVents version of the Solar Data Script

Post 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.
Bishop
Posts: 22
Joined: Sunday 11 June 2017 14:06
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: dzVents version of the Solar Data Script

Post 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?
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: dzVents version of the Solar Data Script

Post 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.
BakSeeDaa
Posts: 485
Joined: Thursday 17 September 2015 10:13
Target OS: Raspberry Pi / ODroid
Domoticz version:

Re: dzVents version of the Solar Data Script

Post 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:
Luigi87
Posts: 79
Joined: Thursday 17 March 2016 14:58
Target OS: Linux
Domoticz version:
Location: Pijnacker, the Netherlands
Contact:

Re: dzVents version of the Solar Data Script

Post by Luigi87 »

Hi guys,

Edit: seems to work fine, i was impatient.
Thanks for the nice work on the script!
Luigi87
Posts: 79
Joined: Thursday 17 March 2016 14:58
Target OS: Linux
Domoticz version:
Location: Pijnacker, the Netherlands
Contact:

Re: dzVents version of the Solar Data Script

Post 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 
BakSeeDaa
Posts: 485
Joined: Thursday 17 September 2015 10:13
Target OS: Raspberry Pi / ODroid
Domoticz version:

Re: dzVents version of the Solar Data Script

Post 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.
Luigi87
Posts: 79
Joined: Thursday 17 March 2016 14:58
Target OS: Linux
Domoticz version:
Location: Pijnacker, the Netherlands
Contact:

Re: dzVents version of the Solar Data Script

Post 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
Mace
Posts: 65
Joined: Monday 21 August 2017 19:52
Target OS: Windows
Domoticz version: 3.8153
Location: Rhoon
Contact:

Re: dzVents version of the Solar Data Script

Post 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?
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: dzVents version of the Solar Data Script

Post by EdwinK »

Not a clue. Working like a charm overhere.
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
Mace
Posts: 65
Joined: Monday 21 August 2017 19:52
Target OS: Windows
Domoticz version: 3.8153
Location: Rhoon
Contact:

Re: dzVents version of the Solar Data Script

Post by Mace »

Thanks for your answer, dorpsgenoot! ;)
I've changed weather station, now it get's data again!
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: dzVents version of the Solar Data Script

Post by EdwinK »

:)
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
BakSeeDaa
Posts: 485
Joined: Thursday 17 September 2015 10:13
Target OS: Raspberry Pi / ODroid
Domoticz version:

Re: dzVents version of the Solar Data Script

Post 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.
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: dzVents version of the Solar Data Script

Post by EdwinK »

Will do :) Thanks
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: dzVents version of the Solar Data Script

Post 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.
Locked

Who is online

Users browsing this forum: No registered users and 1 guest