dzVents version of the Solar Data Script  [SOLVED]

Moderator: leecollings

Locked
User avatar
McMelloW
Posts: 427
Joined: Monday 20 November 2017 17:01
Target OS: Raspberry Pi / ODroid
Domoticz version: V2024.1
Location: Harderwijk, NL
Contact:

Re: dzVents version of the Solar Data Script

Post 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?
Greetings McMelloW
poudenes
Posts: 667
Joined: Wednesday 08 March 2017 9:42
Target OS: Linux
Domoticz version: 3.8993
Location: Amsterdam
Contact:

Re: dzVents version of the Solar Data Script

Post 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.
RPi3 B+, Debain Stretch, Domoticz, Homebridge, Dashticz, RFLink, Milight, Z-Wave, Fibaro, Nanoleaf, Nest, Harmony Hub, Now try to understand pass2php
gajotnt
Posts: 70
Joined: Monday 06 February 2017 12:48
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.9700
Location: Azores
Contact:

Re: dzVents version of the Solar Data Script

Post 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 
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 »

@ BakSeeDaa
Will there be a dzVents 2.4 version (where asynchron communication is implemented) of the script?
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 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!
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 »

*************** 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)
globalassist
Posts: 25
Joined: Monday 09 December 2013 16:51
Target OS: Windows
Domoticz version: Beta
Location: Netherlands
Contact:

Re: dzVents version of the Solar Data Script

Post by globalassist »

To what automation solution are you migrating if I might ask?
User avatar
supergroover
Posts: 23
Joined: Friday 12 July 2013 19:37
Target OS: Linux
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: dzVents version of the Solar Data Script

Post 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)
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 »

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!
NuNca
Posts: 4
Joined: Wednesday 07 June 2017 23:01
Target OS: NAS (Synology & others)
Domoticz version: beta
Contact:

Re: dzVents version of the Solar Data Script

Post 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.
User avatar
supergroover
Posts: 23
Joined: Friday 12 July 2013 19:37
Target OS: Linux
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: dzVents version of the Solar Data Script

Post 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
Arie
Posts: 12
Joined: Saturday 27 January 2018 21:20
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: The Netherlands
Contact:

Re: dzVents version of the Solar Data Script

Post 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 5593 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 5592 times

What is causing this issue with the Cloud Cover and Lux devices?
Arie
Posts: 12
Joined: Saturday 27 January 2018 21:20
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: The Netherlands
Contact:

Re: dzVents version of the Solar Data Script

Post by Arie »

Below a screenshot of the log.

Log
Log
2018-01-30 16_41_04-Log.png (40.14 KiB) Viewed 5586 times
User avatar
McMelloW
Posts: 427
Joined: Monday 20 November 2017 17:01
Target OS: Raspberry Pi / ODroid
Domoticz version: V2024.1
Location: Harderwijk, NL
Contact:

Re: dzVents version of the Solar Data Script

Post 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.
Greetings McMelloW
Arie
Posts: 12
Joined: Saturday 27 January 2018 21:20
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: The Netherlands
Contact:

Re: dzVents version of the Solar Data Script

Post by Arie »

60 KM... You've got a point.
User avatar
McMelloW
Posts: 427
Joined: Monday 20 November 2017 17:01
Target OS: Raspberry Pi / ODroid
Domoticz version: V2024.1
Location: Harderwijk, NL
Contact:

Re: dzVents version of the Solar Data Script

Post 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.
Greetings McMelloW
TacticalLeader
Posts: 13
Joined: Tuesday 19 January 2016 13:19
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Szeged, Hungary
Contact:

Re: dzVents version of the Solar Data Script

Post 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
nalesnikizdzemem
Posts: 4
Joined: Sunday 07 January 2018 17:22
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Poland
Contact:

Re: dzVents version of the Solar Data Script

Post 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?
Arie
Posts: 12
Joined: Saturday 27 January 2018 21:20
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: The Netherlands
Contact:

Re: dzVents version of the Solar Data Script

Post 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.
nalesnikizdzemem
Posts: 4
Joined: Sunday 07 January 2018 17:22
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Poland
Contact:

Re: dzVents version of the Solar Data Script

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

Who is online

Users browsing this forum: No registered users and 1 guest