Real-time solar data : azimuth, Altitude, Lux sensor... [closed]

Moderator: leecollings

Derik
Posts: 1602
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

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

Post by Derik »

multinet wrote: Saturday 30 March 2019 11:07 I found the last version of the script on GitHub running well using dark sky
And that is working?

Why is no one using open weather map??
https://openweathermap.org/
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
Toulon7559
Posts: 849
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: mixed
Location: Hengelo(Ov)/NL
Contact:

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

Post by Toulon7559 »

Since 2016 running the script on 2 Raspberries (under application of air pressure from local BMP180 in Domoticz, and with read-out of Ogimet with fixed input for location).
On October 15th, 2019 both processors stuck due to LAN-breakdown & later rebooted with latest beta-upgrade of Domoticz, and to my surprise the script is not running anymore on both processors.

If 'normally' running the script, then the error report in the Log refers to component 'pow' in this line
M0 = math.sqrt(1229 + math.pow(614 * sinusSunAltitude,2)) - 614 * sinusSunAltitude
This error report only appears once after een reboot.

If running the lua-script from the CLI, then either
no error (= just blank cli after command-input), or
the error report refers to the scriptline
if (uservariables['octa'] == nil) then print("Error : Did you create the Uservariable octa ?") end

Puzzled, because nothing changed in the script, and the uservariable 'octa' is not nil

Anybody seeing similar effects? Any explanation for this effect? Possible remedy?
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

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

Post by waaren »

Toulon7559 wrote: Saturday 30 November 2019 13:03 If 'normally' running the script, then the error report in the Log refers to component 'pow' in this line
M0 = math.sqrt(1229 + math.pow(614 * sinusSunAltitude,2)) - 614 * sinusSunAltitude
Puzzled, because nothing changed in the script, and the uservariable 'octa' is not nil
Could it be related to the switch from Lua 5.2 to Lua 5.3 in domoticz ?
If so have a look at this
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Toulon7559
Posts: 849
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: mixed
Location: Hengelo(Ov)/NL
Contact:

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

Post by Toulon7559 »

@waaren

Probably right that the upgrade to Lua5.3 is the culprit.
Have adapted the script at 4 places for math.pow(x,y) => x^y and at one machine the output immediately flipped to realistic value (= 0 during this nighttime) without errors: next morning in daytime the values seem practical as well.
Application at second machine first stubbornly refused, but followed next morning at start of daytime.

Had missed the thread related to that Lua_upgrade:
;-) consequence of going on holiday ...........
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
reneklomp
Posts: 30
Joined: Monday 20 February 2017 23:07
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by reneklomp »

I am confused... I copied the script (that is now using darksky but I believe that is irrelevant for my observation) to my Domoticz instance.
The values for Solar Altitude and Azimuth seem to be very realistic. However, from the graphs I observed Azimuth was going through 0 degrees sometime between 7:00 and 7:05 this morning whereas both Domoticz and Google tell me Sunrise was at 6:45 today. So it seems there is something wrong in the calculation of at least the Solar Azimuth...? Or am I missing something? (I am using consistent longitude, latitude for both).
dheuts
Posts: 65
Joined: Monday 25 March 2019 15:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Brunssum, Netherlands
Contact:

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

Post by dheuts »

Seems the wiki is offline. Where to find it?
jmleglise wrote: Tuesday 19 January 2016 22:23 This script is documented in the wiki : http://www.domoticz.com/wiki/Real-time_ ... _sensor...

Edit 19 March 2016 - V1.4 - Take the last version of this script in the wiki. http://www.domoticz.com/wiki/Real-time_ ... structions

Edit 3 sept 2017 - V2 - The script is now translated in dzevent framework http://www.domoticz.com/forum/viewtopic ... 59&t=19220

------
Hi everyone,

This LUA script calculates in real-time a lot of usefull solar data without any hardware sensor. The result is very satisfactory. I hope you will enjoy it.

Data :
Azimuth : Angle between the Sun and the north, in degree. (north vector and the perpendicular projection of the sun down onto the horizon)
Altitude : Angle of the Sun with the horizon, in degree.
Lux : radiation of the sun with real time cloud layer
and many more

The calculation is based on the theoretical radiations of the sun according to its location in the sky, calculated according to the time and the number of day in the year, plus the real-time cloud layer and the real-time weather (pressure) :
- Geographical address
- Altitude of the geographical point
- Atmospheric pressure of the place / from api.wunderground.com
- The cloudiness in Octa (1/8) / from ogimet.com

-- What is it For ? ------------------------------------------------------
Manage exactly roller blinds and venetian blind. both to optimise the heating and to prevent dazzle.
Manage your light according to the Luminosity
Use civil twilight dawn and dusk (-6 deg altitude) instead of sunrise and sunset.
Some calculation about photovoltaic production ?
Automate the heating of swimming pool
Personally I use a roller blind to wake up instead of an alarm clock, with a progressive opening of the roller blind to prevent dazzle.

-- History ------------------------------------------------------
I have improved the huge work of Sébastien Joly (on an another automation system) that Neutrino has migrated to Domoticz.

I deeply encourage you to visit the very interesting, original post in French : http://www.domotique-info.fr/2015/09/ou ... ecenter-2/
And the others documentations and source of the formulae :
http://www.plevenon-meteo.info/techniqu ... ement.html
http://herve.silve.pagesperso-orange.fr/solaire.htm
https://en.wikipedia.org/wiki/Azimuth
https://en.wikipedia.org/wiki/Dawn
There was even already a first implementation of these formulae here http://www.domoticz.com/forum/viewtopic.php?f=23&t=6793, but I choose to complete the other implementation.
Raspberry Pi 4 With Domoticz - RFXCom - Tuya Wifi LED lights - Chuango Alarm - Zwave+ - Zigbee2MQTT - Anna Thermostat - Broadlink IR, P1 - Eufy Robo Vacuum - Worx Robo Mower
Locked

Who is online

Users browsing this forum: No registered users and 0 guests