Page 9 of 13

Re: Real-time solar data : azimuth, Altitude, Lux sensor...

Posted: Saturday 05 November 2016 12:21
by manu663
Thank you Xces and Merci Toulon7559 to come to my rescue !

In order to clarify my previous message which was clear as mud,
Here's my "Hardware tab":

Image

my "device tab":

Image

and the device "Lux Calculated" in the Utility tab:

Image

I've tried to create a new "custom" one but by looking at the one provided by Xces in the posts above, it's a "type: lux" so I did the same. (Monkey see, monkey do ! :roll: )

Do you think that my mistake should be having 2 items "virtual sensor" IDX 8 and "Je dors" IDX 4 in the Hardware tab ?
Maybe I should create the virtual sensor needed for the solar data under "Je Dors! " ?

Toulon7559- Remark2: the lines displayed were coming from the "user variables" tab (setup/more option).

Re: Real-time solar data : azimuth, Altitude, Lux sensor...

Posted: Saturday 05 November 2016 13:58
by xces
Did you also follow the procedures to setup your local domoticz url and allow local updates without password (via options screen?)

Re: Real-time solar data : azimuth, Altitude, Lux sensor...

Posted: Saturday 05 November 2016 14:44
by manu663
OMG, shame on me ! :oops:

I made a noob's mistake ! (which I am indeed)
During the local domoticz url setting, I only focused on the URL in the user variables but I missed the option screen info.

I 've been too fast on that step and I left a blank URL...

Fixed ! At least this mistake led me to dig into the entire script to try to understand.
( I won't swear I've understood everything :? but I'm on the right path !)

Thank a lot to both of you to have spent your time to help me and congrats for this nice script !

Re: Real-time solar data : azimuth, Altitude, Lux sensor...

Posted: Wednesday 09 November 2016 2:11
by darmokusumo
Can also send me a pm in Dutch. Perhaps I can help you, although the wiki is very clear. Only problem I encountered was to put JSON.lua in scriptfolder on my Pi3. After that all went right.

Re: Real-time solar data : azimuth, Altitude, Lux sensor...

Posted: Wednesday 09 November 2016 2:18
by darmokusumo
i just setup weatherunderdround...I gonna find out,
in the mean time does it run with 1012 as relativePressure instead of the sensor...??

Re: Real-time solar data : azimuth, Altitude, Lux sensor...

Posted: Monday 26 December 2016 16:34
by DrMacabre
hello,

i'm trying to make this work on freenas but i get this error when the script runs :

2016-12-26 16:25:00.513 Error: EventSystem: in /usr/home/domoticz/domoticz/scripts/lua/script_time_SolarSensor.lua: ...omoticz/domoticz/scripts/lua/script_time_SolarSensor.lua:65: 'popen' not supported

what did i miss ?

thanks

Re: Real-time solar data : azimuth, Altitude, Lux sensor...

Posted: Monday 26 December 2016 17:02
by trixwood
I think a good lua version!

viewtopic.php?t=9904

Re: Real-time solar data : azimuth, Altitude, Lux sensor...

Posted: Monday 26 December 2016 17:08
by DrMacabre
I've read this topic but since its related to mac osx, i'm not sure i fully understand how to translate this to my freenas install.

I tried running Lua in the shell but it is not a valid command on my system. Any idea how to set it up ?

EDIT : installed package for lua52 but i still got the error

Re: Real-time solar data : azimuth, Altitude, Lux sensor...

Posted: Monday 26 December 2016 17:56
by trixwood
I think lua is included in the domoticz package, at least I can see it in the Domoticz source and it's not an external package.
You could try to compile the lastes version of Domoticz.Or maybe somebody else has a better idea ;-)

Re: Real-time solar data : azimuth, Altitude, Lux sensor...

Posted: Monday 26 December 2016 18:04
by DrMacabre
The install is a couple of days old, haven't seen any error during compiling.

I guess i'll wait for my rasperry to arrive to check this out.

Thanks.

Re: Real-time solar data : azimuth, Altitude, Lux sensor...

Posted: Saturday 31 December 2016 0:39
by Nautilus
Ogimet is not available where I live however, I can get the cloudiness as percentage. For now I just calculate "Octa = Cloudiness(0-100) / 12.5". But would there be a more accurate way to calculate Kc from cloudiness percentage?

Re: Real-time solar data : azimuth, Altitude, Lux sensor...

Posted: Thursday 05 January 2017 18:23
by Quax1507
Hi,

I am getting following error in log file sometimes:
2017-01-05 18:10:00.990 LUA: Station SYNOP = 10729
2017-01-05 18:10:00.990 LUA: 4 Octa
2017-01-05 18:10:00.990 LUA: Kc = 0.92895078594483
2017-01-05 18:10:00.990 LUA: Direct Radiation = 0 W/m²
2017-01-05 18:10:00.990 LUA: Scattered Radiation = 0 W/m²
2017-01-05 18:10:00.991 LUA: Total radiation = 0 W/m²
2017-01-05 18:10:00.991 LUA: Total Radiation in lux = 0 Lux
2017-01-05 18:10:00.991 LUA: and at last, Total weighted lux = 0 Lux
2017-01-05 18:10:10.152 Error: EventSystem: Warning!, lua script /home/pi/domoticz/scripts/lua/script_time_SolarSensor.lua has been running for more than 10 seconds
Any idea where to search?

Quax1507

Re: Real-time solar data : azimuth, Altitude, Lux sensor...

Posted: Monday 09 January 2017 0:04
by phoenixblue
Is it possible to calculate based on the solar radiation of the day before and the weather forecast for the next day to calculate how much w/m2 total can be suspected for the next day?

Re: Real-time solar data : azimuth, Altitude, Lux sensor...

Posted: Thursday 19 January 2017 3:06
by trixwood
Just found out. if you loose your internet connection, then you get no domoticz frontpage when this script is active... :-(

Re: Real-time solar data : azimuth, Altitude, Lux sensor...

Posted: Sunday 22 January 2017 19:27
by Toulon7559
@phoenixblue

Don't know an algorithm to answer you question, but some meteo-site may give the forecast information you need; e.g. http://api.buienradar.nl/image/1.0/sunpowereu?forc=32
One level higher the website-entry is by http://www.buienradar.nl/nederland/zon- ... nkracht-uv

Re: Real-time solar data : azimuth, Altitude, Lux sensor...

Posted: Wednesday 01 February 2017 8:08
by ikariya
Hi guys,

quite new at domoticz, however i have some question about this script for solar radiation. I'm interested in it as i'd like to drive motorized sunshaders on windows according to sun position.

First, i'd like to thank the authors for the script. After various test i managed to run it properly (first steps on domoticz for me !).

however, how could theoritical sunposition calculation drive to so broken curves ? It must looks like an ellipsoid, continuous curve (as far as yo dont deal with radiation limitation such as clouds or walls/trees on the path). If there's some broken parts in the curves there must be an error on the WUnderground infos, or in the model you use for Lux calculation.

second part is : why bothering to compute Lux values involving approximate calculation and Wunderground API interrogations ? Sun tables exists, they are established for millenaries, and available to anyone. Moreover, accurate models of sun position prediction are available for free (see Pysolar that gives altitude, azimuth and radiance, model established by NREL)

simply run a script every 1,5 or 10 minute, asking pysolar get_altitude, get_azimuth, get_radiance using, then update virtualdevice with the values

hope it helps

Re: Real-time solar data : azimuth, Altitude, Lux sensor...

Posted: Wednesday 01 February 2017 10:54
by Toulon7559
@ijariya

Short response to your remarks.

First to your 'second part'.
You are right that the calculations exist since ages for nominal conditions.
But jmleglise included in the approximation the effects of actual local weather, and that makes the difference!

That is also the reason for the broken curves you mention in your 'first part'.
The reading for barometric pressure may be frequent (depending on the information source you apply), but the read-out from Ogimet-station does not change very frequent and dynamic. Sometimes the octa-value is provided only once per hour, and then with sometimes significant steps in the octa-value, as a consequence causing major jumps in the curves.
;-) But those curves are then representing the actual conditions, and not the nominal conditions!

Re: Real-time solar data : azimuth, Altitude, Lux sensor...

Posted: Wednesday 01 February 2017 11:56
by ikariya
ok, understood, didnt saw the correction for barometric level.

However, i already used METAR datas for external conditions and they are very approximative to specific condition as they are usually set on airports. using this data at home for me injects lots of discrepancies, as airport is 50 km away.

i'll try to implement PySolar in my own script to get only azimuth and angle witch is my personnal interest to drive the sunshades during summer. give you feedback if i success.

thanks for the help

Re: Real-time solar data : azimuth, Altitude, Lux sensor...

Posted: Wednesday 01 February 2017 13:39
by Toulon7559

Re: Real-time solar data : azimuth, Altitude, Lux sensor...

Posted: Wednesday 01 February 2017 15:54
by Toulon7559
Small lightsensor might be very useful as addon for your desired functionality. Simplest: look in this form for ldr attached to domoticz. Better: bh1750 by i2c to esp8266, or similar .....
But always discussion on optimal position for measurement.