Page 5 of 9

Re: dzVents version of the Solar Data Script

Posted: Saturday 23 December 2017 22:43
by McMelloW
I try to create the Solar Altitude & Azimuth custom sensors. At this moment the web interface does not work for creating virtual devices. The JSON command does not work either.

Code: Select all

http://192.168.1.xx:xxxx/json.htm?type=createvirtualsensor&idx=5&sensorname=Altitude&sensortype=1004
I guess it it missing the y-axis value. Does anyone know how this works in JSON?

Re: dzVents version of the Solar Data Script

Posted: Friday 05 January 2018 10:05
by poudenes
Hi All,

Since couple of weeks i see this error. Not always but within minutes or hours.

Code: Select all

2018-01-04 19:06:00.414 Error: dzVents: Error: SOLAR 2.2.0.....................: An error occured when calling event handler Solar Data
2018-01-04 19:06:00.414 Error: dzVents: Error: SOLAR 2.2.0.....................: ...omoticz/scripts/dzVents/generated_scripts/Solar Data.lua:145: attempt to perform arithmetic on a nil value
2018-01-04 19:11:00.451 Error: dzVents: Error: SOLAR 2.2.0.....................: An error occured when calling event handler Solar Data
2018-01-04 19:11:00.451 Error: dzVents: Error: SOLAR 2.2.0.....................: ./scripts/lua/JSON.lua:660: html passed to JSON:decode():
Not Found
The requested URL /api/40c1f27581c80568/conditions/q/NL/Amsterdam.json was not found on this server.
2018-01-04 19:16:00.492 Error: dzVents: Error: SOLAR 2.2.0.....................: An error occured when calling event handler Solar Data
2018-01-04 19:16:00.493 Error: dzVents: Error: SOLAR 2.2.0.....................: ./scripts/lua/JSON.lua:660: html passed to JSON:decode():
Now using v3.8798 Beta, but before this beta got this error as well.

Re: dzVents version of the Solar Data Script

Posted: Thursday 25 January 2018 15:57
by gajotnt
After latest beta (V3.8841) getting some warnings, easily fixed, just wanted y'all to know.

Code: Select all

2018-01-25 13:51:00.539 dzVents: Info: SOLAR 2.2.0: ------ Start internal script: Solar:, trigger: every minute 

 2018-01-25 13:51:00.548 dzVents: Info: SOLAR 2.2.0: domoticz.round deprecated. Please use domoticz.utils.round. 

 2018-01-25 13:51:00.548 dzVents: Info: SOLAR 2.2.0: domoticz.round deprecated. Please use domoticz.utils.round. 

 2018-01-25 13:51:00.548 dzVents: Info: SOLAR 2.2.0:  

 2018-01-25 13:51:00.548 dzVents: Info: SOLAR 2.2.0: ============== SUN LOG ================== 

 2018-01-25 13:51:00.548 dzVents: Info: SOLAR 2.2.0: pws:IAORESAN3, latitude: 38.656319, longitude: -27.224287 

 2018-01-25 13:51:00.548 dzVents: Info: SOLAR 2.2.0: WU Location WMO = 08511 

 2018-01-25 13:51:00.548 dzVents: Info: SOLAR 2.2.0: Altitude of the sun = 30.65029531842° 

 2018-01-25 13:51:00.549 dzVents: Info: SOLAR 2.2.0: Azimuth of the sun = 197.12143891202° 

 2018-01-25 13:51:00.549 dzVents: Info: SOLAR 2.2.0: domoticz.round deprecated. Please use domoticz.utils.round. 

 2018-01-25 13:51:00.549 dzVents: Info: SOLAR 2.2.0: domoticz.round deprecated. Please use domoticz.utils.round. 

 2018-01-25 13:51:00.549 dzVents: Info: SOLAR 2.2.0:  

 2018-01-25 13:51:00.549 dzVents: Info: SOLAR 2.2.0: SYNOP Station = 08509 

 2018-01-25 13:51:00.549 dzVents: Info: SOLAR 2.2.0: Okta = 7 

 2018-01-25 13:51:00.549 dzVents: Info: SOLAR 2.2.0: domoticz.round deprecated. Please use domoticz.utils.round. 

 2018-01-25 13:51:00.549 dzVents: Info: SOLAR 2.2.0: Direct Radiation = 262.12 W/m² 

 2018-01-25 13:51:00.549 dzVents: Info: SOLAR 2.2.0: domoticz.round deprecated. Please use domoticz.utils.round. 

 2018-01-25 13:51:00.549 dzVents: Info: SOLAR 2.2.0: domoticz.round deprecated. Please use domoticz.utils.round. 

 2018-01-25 13:51:00.549 dzVents: Info: SOLAR 2.2.0: domoticz.round deprecated. Please use domoticz.utils.round. 

 2018-01-25 13:51:00.549 dzVents: Info: SOLAR 2.2.0: domoticz.round deprecated. Please use domoticz.utils.round. 

 2018-01-25 13:51:00.549 dzVents: Info: SOLAR 2.2.0: Total weighted lux = 25116.93 Lux 

 2018-01-25 13:51:00.568 dzVents: Info: SOLAR 2.2.0: domoticz.round deprecated. Please use domoticz.utils.round. 

 2018-01-25 13:51:00.568 dzVents: Info: SOLAR 2.2.0: domoticz.round deprecated. Please use domoticz.utils.round. 

 2018-01-25 13:51:00.569 dzVents: Info: SOLAR 2.2.0: domoticz.round deprecated. Please use domoticz.utils.round. 

 2018-01-25 13:51:00.570 dzVents: Info: SOLAR 2.2.0: domoticz.round deprecated. Please use domoticz.utils.round. 

 2018-01-25 13:51:00.570 dzVents: Info: SOLAR 2.2.0: domoticz.round deprecated. Please use domoticz.utils.round. 

 2018-01-25 13:51:00.575 dzVents: Info: SOLAR 2.2.0: ------ Finished Solar 

Re: dzVents version of the Solar Data Script

Posted: Thursday 25 January 2018 20:22
by EddyG
@ BakSeeDaa
Will there be a dzVents 2.4 version (where asynchron communication is implemented) of the script?

Re: dzVents version of the Solar Data Script

Posted: Friday 26 January 2018 9:05
by BakSeeDaa
EddyG wrote: Thursday 25 January 2018 20:22 @ BakSeeDaa
Will there be a dzVents 2.4 version (where asynchron communication is implemented) of the script?
Yes. I've released a new script version. See initial post. Don't use the script version found in the wiki. For some reason I can not login to the wiki to maintain it.

Cheers!

Re: dzVents version of the Solar Data Script

Posted: Friday 26 January 2018 9:20
by BakSeeDaa
*************** IMPORTANT NOTE ***************
                                                                                             
This script will be retired. I'm migrating away from Domoticz to another automation
solution. It requires some effort to maintain it and I won't have the time to do it in the future.

If you'd like to become the maintainer of this script, please let me know. (Post here)

Re: dzVents version of the Solar Data Script

Posted: Friday 26 January 2018 10:12
by globalassist
To what automation solution are you migrating if I might ask?

Re: dzVents version of the Solar Data Script

Posted: Friday 26 January 2018 11:20
by supergroover
Unfortunately is the script retired but i'm getting a error with the new version of the script.

Can somebody help me?

Code: Select all

2018-01-26 11:15:11.165 dzVents: Error (2.4.0): solarData 2.4.0: An error occured when calling event handler script_time_dzventsolarV2
2018-01-26 11:15:11.165 dzVents: Error (2.4.0): solarData 2.4.0: .../dzVents/generated_scripts/script_time_dzventsolarV2.lua:280: attempt to perform arithmetic on field 'lux' (a nil value)

Re: dzVents version of the Solar Data Script

Posted: Friday 26 January 2018 13:35
by BakSeeDaa
supergroover wrote: Friday 26 January 2018 11:20 Unfortunately is the script retired but i'm getting a error with the new version of the script.

Can somebody help me?

Code: Select all

2018-01-26 11:15:11.165 dzVents: Error (2.4.0): solarData 2.4.0: An error occured when calling event handler script_time_dzventsolarV2
2018-01-26 11:15:11.165 dzVents: Error (2.4.0): solarData 2.4.0: .../dzVents/generated_scripts/script_time_dzventsolarV2.lua:280: attempt to perform arithmetic on field 'lux' (a nil value)
Maybe you have uncommented line 33 to use a Lux device with the script (that''s optional) but some way you have set the device idx to a non existent device or a device that is not of type "Lux"?

Code: Select all

local idxLux = 630 -- (Integer) Domoticz virtual Lux device ID
Cheers!

Re: dzVents version of the Solar Data Script

Posted: Friday 26 January 2018 13:57
by NuNca
supergroover wrote: Friday 26 January 2018 11:20 Unfortunately is the script retired but i'm getting a error with the new version of the script.

Can somebody help me?

Code: Select all

2018-01-26 11:15:11.165 dzVents: Error (2.4.0): solarData 2.4.0: An error occured when calling event handler script_time_dzventsolarV2
2018-01-26 11:15:11.165 dzVents: Error (2.4.0): solarData 2.4.0: .../dzVents/generated_scripts/script_time_dzventsolarV2.lua:280: attempt to perform arithmetic on field 'lux' (a nil value)
I had the same problem and found why it was going wrong.
You probably copied the variables at the top of the script from the old to the new version. But the variables have changed a bit.

change this line at the top:

Code: Select all

local fetchIntervalMins = 5						-- (Integer) (Minutes, Range 5-60) How often Wunderground API is called
to:

Code: Select all

local fetchIntervalDayMins = 5 -- Day time scraping interval. Never set this below 4 if you have a free WU API account.
local fetchIntervalNightMins = 30 -- Night time scraping interval. 
this solved the problem for me.

Re: dzVents version of the Solar Data Script

Posted: Friday 26 January 2018 14:50
by supergroover
BakSeeDaa wrote: Friday 26 January 2018 13:35
supergroover wrote: Friday 26 January 2018 11:20 Unfortunately is the script retired but i'm getting a error with the new version of the script.

Can somebody help me?

Code: Select all

2018-01-26 11:15:11.165 dzVents: Error (2.4.0): solarData 2.4.0: An error occured when calling event handler script_time_dzventsolarV2
2018-01-26 11:15:11.165 dzVents: Error (2.4.0): solarData 2.4.0: .../dzVents/generated_scripts/script_time_dzventsolarV2.lua:280: attempt to perform arithmetic on field 'lux' (a nil value)
Maybe you have uncommented line 33 to use a Lux device with the script (that''s optional) but some way you have set the device idx to a non existent device or a device that is not of type "Lux"?

Code: Select all

local idxLux = 630 -- (Integer) Domoticz virtual Lux device ID
Cheers!
Thanks, i have made a new dummy lux device what is exactly the same as previous lux device and problem solved... :o

Re: dzVents version of the Solar Data Script

Posted: Tuesday 30 January 2018 16:35
by Arie
Anyone have any idea what could be the issue here?
The Cloud Cover device is at 100%, whereas there are almost no clouds at the moment.
The Lux device value seems to be very low, not corresponding with the time of day.
The Azimuth and Altitude values seem OK?

Utilities Tab
Utilities Tab
2018-01-30 16_23_06-Domoticz.png (55.28 KiB) Viewed 5598 times

The PWS which I use is working fine.
ID numbers are all correct, just double checked.
WMOID taken from the Ogimet website; 06340: Woensdrecht (Netherlands).

LUA Script
LUA Script
2018-01-30 16_27_33-script_time_solarsensor.lua.png (118.84 KiB) Viewed 5597 times

What is causing this issue with the Cloud Cover and Lux devices?

Re: dzVents version of the Solar Data Script

Posted: Tuesday 30 January 2018 16:47
by Arie
Below a screenshot of the log.

Log
Log
2018-01-30 16_41_04-Log.png (40.14 KiB) Viewed 5591 times

Re: dzVents version of the Solar Data Script

Posted: Tuesday 30 January 2018 17:24
by McMelloW
What is the distance of woensdrecht and your weatherstaion pws:xxxx In my situation it is over 16km. It can be 100% cloud cover at the Ogimet and a bright sky at my weatherstation.

Re: dzVents version of the Solar Data Script

Posted: Tuesday 30 January 2018 19:19
by Arie
60 KM... You've got a point.

Re: dzVents version of the Solar Data Script

Posted: Tuesday 30 January 2018 19:51
by McMelloW
I discovered the same difference in my situation. Ogimet is taken from Lelystad Airport. pws is at Harderwijk, only 600m from my house. The distance in direct line is only 16km. Still there can be large differences in local weather.

Re: dzVents version of the Solar Data Script

Posted: Friday 02 February 2018 10:40
by TacticalLeader
Hi guys,

I have the following issue with this solar data script. I installed the latest beta an hour ago and setup this script. The problem is the solar data script triggers other script, named "kulcs_haromszog_1". The triggered script is a blockly script and the solar data is dzvents.. What can cause this? Please find the log I attached:

Code: Select all

2018-02-02 10:30:00.440 dzVents: Info: solarData 2.4.0: ------ Start internal script: nap_az_egen:, trigger: every 15 minutes at daytime
2018-02-02 10:30:00.443 dzVents: Info: solarData 2.4.0: ------ Finished nap_az_egen
2018-02-02 10:30:00.631 EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2018-02-02 10:30:06.163 dzVents: Info: Handling httpResponse-events for: "solarDataOgimet
2018-02-02 10:30:06.163 dzVents: Info: solarData 2.4.0: ------ Start internal script: nap_az_egen: HTTPResponse: "solarDataOgimet"
2018-02-02 10:30:06.166 dzVents: Info: solarData 2.4.0: ------ Finished nap_az_egen
2018-02-02 10:30:06.178 EventSystem: Event triggered: kulcs_haromszog_1
2018-02-02 10:30:06.178 log: meg lett nyomva a kulcson a háromszög
2018-02-02 10:30:11.291 dzVents: Info: Handling httpResponse-events for: "solarDataWU
2018-02-02 10:30:11.291 dzVents: Info: solarData 2.4.0: ------ Start internal script: nap_az_egen: HTTPResponse: "solarDataWU"
2018-02-02 10:30:11.310 dzVents: Info: solarData 2.4.0:
2018-02-02 10:30:11.310 dzVents: Info: solarData 2.4.0: ============== NAP - NAPLÓ ==================
2018-02-02 10:30:11.310 dzVents: Info: solarData 2.4.0: mycity, lati: XX.329299, lon: XX.204867
2018-02-02 10:30:11.310 dzVents: Info: solarData 2.4.0: WU locat WMO = 12982
2018-02-02 10:30:11.310 dzVents: Info: solarData 2.4.0: Altitude of the sun = 25.04806524171°
2018-02-02 10:30:11.310 dzVents: Info: solarData 2.4.0: Azimuth of the sun = 161.68215874726°
2018-02-02 10:30:11.310 dzVents: Info: solarData 2.4.0:
2018-02-02 10:30:11.311 dzVents: Info: solarData 2.4.0: SYNOP Station = 12HH2
2018-02-02 10:30:11.311 dzVents: Info: solarData 2.4.0: Okta = 7
2018-02-02 10:30:11.311 dzVents: Info: solarData 2.4.0: Direct Radiation = 176.88 W/m²
2018-02-02 10:30:11.311 dzVents: Info: solarData 2.4.0: Total weighted lux = 18926.14 Lux
2018-02-02 10:30:11.355 dzVents: Info: solarData 2.4.0: ------ Finished nap_az_egen
2018-02-02 10:30:11.356 EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2018-02-02 10:30:11.369 EventSystem: Event triggered: kulcs_haromszog_1
2018-02-02 10:30:11.369 log: meg lett nyomva a kulcson a háromszög

Re: dzVents version of the Solar Data Script

Posted: Saturday 10 February 2018 20:39
by nalesnikizdzemem
Hi,
recently I installed the script but I am getting some error:

2018-02-10 20:24:05.886 dzVents: Info: solarData 2.4.0: ------ Start internal script: solarData: HTTPResponse: "solarDataOgimet"
2018-02-10 20:24:05.887 dzVents: Debug: solarData 2.4.0: Ogimet data has been received
2018-02-10 20:24:05.889 dzVents: Debug: solarData 2.4.0: Using the saved Okta value: 0 with UTC timestamp: 198001010000
2018-02-10 20:24:05.889 dzVents: Error (2.4.1): solarData 2.4.0: We've got no cloud data from WMOID: 12550 for more than 334099 hours. Maybe you should look for a more reliable weather station to query. Read the Wiki how to do that.
2018-02-10 20:24:05.890 dzVents: Info: solarData 2.4.0: ------ Finished solarData

Does anyone know what is that and how to fix it?

Re: dzVents version of the Solar Data Script

Posted: Sunday 11 February 2018 0:34
by Arie
The weather station which you have selected did not supply cloud data for a very long time. Simply select a different weather station from the Ogimet website and add that to the script instead.

Re: dzVents version of the Solar Data Script

Posted: Sunday 11 February 2018 7:04
by nalesnikizdzemem
Thanks!
I did what you suggested and it works fine.
Unfortunately the previous station was located in my city and the new one is 65km away from me.

Thanks a lot for support.