Real-time solar data : azimuth, Altitude, Lux sensor... [closed]
Moderator: leecollings
-
- Posts: 26
- Joined: Thursday 02 October 2014 14:35
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Real-time solar data : azimuth, Altitude, Lux sensor...
@derik: whats your question?
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.
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.
-
- Posts: 1601
- 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...
I did all the things in the wiki.
Only my script is not working.
I did not get the:
And my log error:
Only my script is not working.
I did not get the:
Code: Select all
Your home altitude : run once in debug = 1 to found your altitude in Log and write it here
Code: Select all
2016-08-20 12:55:00.557 Error: EventSystem: in /home/linaro/domoticz/scripts/lua/script_time_SolarSensor.lua: .../linaro/domoticz/scripts/lua/script_time_SolarSensor.lua:56: attempt to call a nil value
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
-
- Posts: 26
- Joined: Thursday 02 October 2014 14:35
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Real-time solar data : azimuth, Altitude, Lux sensor...
@Derik:
I noticed three different things in your setup:
- The names of the custom sensors should be :"Sun Azimuth" and "Sun Altitude" Exactly like in the wiki.
- In the box of these custom sensors (click on "aanpassen") Type at the field "Aslabel" the word 'degrees' at both custom sensors.
- The name of the Weather Underground location voor Nijmegen should be "Nijmegen" or try "Molukkenstraat" You used the Weather Underground codename of the station in your script. During installation I got the same failure message. Once I changed the name in the script, all went right.
(Molukkenstraat (INIJMEGE14)
Give it a try!
I noticed three different things in your setup:
- The names of the custom sensors should be :"Sun Azimuth" and "Sun Altitude" Exactly like in the wiki.
- In the box of these custom sensors (click on "aanpassen") Type at the field "Aslabel" the word 'degrees' at both custom sensors.
- The name of the Weather Underground location voor Nijmegen should be "Nijmegen" or try "Molukkenstraat" You used the Weather Underground codename of the station in your script. During installation I got the same failure message. Once I changed the name in the script, all went right.
(Molukkenstraat (INIJMEGE14)
Give it a try!
- capman
- Posts: 153
- Joined: Friday 12 July 2013 20:48
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Belgium
- Contact:
Re: Real-time solar data : azimuth, Altitude, Lux sensor...
Got the folowing error in my log
2016-08-20 16:35:00.788 Error: EventSystem: in /usr/local/domoticz/var/scripts/lua/script_time_SolarSensor.lua: /usr/local/domoticz/var/scripts/lua/json.lua:352: bad argument #1 to 'len' (string expected, got table)
A used the last beta version (v3.5523). And it runs on a synology , so a changed the line for json.lua in the script to the correct path.
Any idea ?
2016-08-20 16:35:00.788 Error: EventSystem: in /usr/local/domoticz/var/scripts/lua/script_time_SolarSensor.lua: /usr/local/domoticz/var/scripts/lua/json.lua:352: bad argument #1 to 'len' (string expected, got table)
A used the last beta version (v3.5523). And it runs on a synology , so a changed the line for json.lua in the script to the correct path.
Any idea ?
-
- Posts: 1601
- 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...
@ VMB [ From Nijmegen?? ]
I did what you say..
Only the wiki has some errors i think
The Wiki: And what you says:[ and i have ] Only i think i don not now how i run in debug for 1 time:
While i got this setting:
Changed my api.
I did what you say..
Only the wiki has some errors i think
The Wiki: And what you says:[ and i have ] Only i think i don not now how i run in debug for 1 time:
Code: Select all
local altitude = 27 -- Your home altitude : run once in debug = 1 to found your altitude in Log and write it here
local WMOID = '07145' -- Your nearest SYNOP Station for ogimet (to get Cloud layer). Run once with debug=1 to get it in the log. (or, better, choose it there : http://www.ogimet.com/gsynop_nav.phtml.en )
local DEBUG = 0 -- 0 , 1 for domoticz log , 2 for file log
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
-
- Posts: 1601
- 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...
And:
Only the error:
Is there
with this?
And i have:
Changed something.Only the error:
Code: Select all
2016-08-20 21:15:00.225 Error: EventSystem: in /home/linaro/domoticz/scripts/lua/script_time_SolarSensor.lua: .../linaro/domoticz/scripts/lua/script_time_SolarSensor.lua:56: attempt to call a nil value
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
-
- Posts: 26
- Joined: Thursday 02 October 2014 14:35
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Real-time solar data : azimuth, Altitude, Lux sensor...
@Derik
No, not from Nijmegen. From Alblasserwaard.
Guess you checked the Idx-numbers from all the sensors?
Only thing I can think of is changing "Molukkenstraat" in "Nijmegen". Perhaps you tried that already? Check Weather Underground for stations/names nearby.
Debug can be found in Domoticz-log when you set is to value '1'.
You did put JSON.lua in script directory?
Hope this helps, because my knowledge of this script is coming to an end.
Succes!
No, not from Nijmegen. From Alblasserwaard.
Guess you checked the Idx-numbers from all the sensors?
Only thing I can think of is changing "Molukkenstraat" in "Nijmegen". Perhaps you tried that already? Check Weather Underground for stations/names nearby.
Debug can be found in Domoticz-log when you set is to value '1'.
You did put JSON.lua in script directory?
Hope this helps, because my knowledge of this script is coming to an end.
Succes!
-
- Posts: 1601
- 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...
@vmb
Not working
Please some screendumps of your settings...
script, sensors etc,,
Not working
Please some screendumps of your settings...
script, sensors etc,,
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
-
- Posts: 26
- Joined: Thursday 02 October 2014 14:35
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Real-time solar data : azimuth, Altitude, Lux sensor...
@Derik,
Here is my script; only changed the WU-api
-- Variables to customize ------------------------------------------------
local city = "Liesveld" -- Your city for Wunderground API
local countryCode = "NL" -- Your country code for Wunderground API
local idxLux ='428' -- Your virtual Lux Device ID
local idxSolarAzimuth ='429' -- Your virtual Azimuth Device ID
local idxSolarAltitude ='430' -- Your virtual Solar Altitude Device ID
local idxUserVarOcta='7' -- Your user variable ID , named octa
local wuAPIkey = "6e4404XXX" -- Your Weather Underground API Key
local latitude = 51.885823 -- your home
local longitude = 4.662413 -- your home
local altitude = -2 -- Your home altitude : run once in debug = 1 to found your altitude in Log and write it here
local WMOID = '06344' -- Your nearest SYNOP Station for ogimet (to get Cloud layer). Run once with debug=1 to get it in the log. (or, better, choose it there : http://www.ogimet.com/gsynop_nav.phtml.en )
local DEBUG = 1 -- 0 , 1 for domoticz log , 2 for file log
-- and customize the URL of api.wunderground around line 104 according to your country.
-- Below , edit at your own risk ------------------------------------------
Here is my script; only changed the WU-api
-- Variables to customize ------------------------------------------------
local city = "Liesveld" -- Your city for Wunderground API
local countryCode = "NL" -- Your country code for Wunderground API
local idxLux ='428' -- Your virtual Lux Device ID
local idxSolarAzimuth ='429' -- Your virtual Azimuth Device ID
local idxSolarAltitude ='430' -- Your virtual Solar Altitude Device ID
local idxUserVarOcta='7' -- Your user variable ID , named octa
local wuAPIkey = "6e4404XXX" -- Your Weather Underground API Key
local latitude = 51.885823 -- your home
local longitude = 4.662413 -- your home
local altitude = -2 -- Your home altitude : run once in debug = 1 to found your altitude in Log and write it here
local WMOID = '06344' -- Your nearest SYNOP Station for ogimet (to get Cloud layer). Run once with debug=1 to get it in the log. (or, better, choose it there : http://www.ogimet.com/gsynop_nav.phtml.en )
local DEBUG = 1 -- 0 , 1 for domoticz log , 2 for file log
-- and customize the URL of api.wunderground around line 104 according to your country.
-- Below , edit at your own risk ------------------------------------------
-
- Posts: 26
- Joined: Thursday 02 October 2014 14:35
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Real-time solar data : azimuth, Altitude, Lux sensor...
And here is my JSON.lua in a rar file. Unrar it and place it in script-dir (same dir as where Solar script is placed)
- Attachments
-
- JSON.rar
- (9.48 KiB) Downloaded 139 times
-
- Posts: 1601
- 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...
mmm
How do you come to otca value 8?
And do i need to rename the JSON.lua to script_time_JSON.lua?
How do you come to otca value 8?
And do i need to rename the JSON.lua to script_time_JSON.lua?
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
- capman
- Posts: 153
- Joined: Friday 12 July 2013 20:48
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Belgium
- Contact:
Re: Real-time solar data : azimuth, Altitude, Lux sensor...
Okee, it's working now. Replace my original json.lua file with yours.
Thanks vmb
Thanks vmb
-
- Posts: 26
- Joined: Thursday 02 October 2014 14:35
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Real-time solar data : azimuth, Altitude, Lux sensor...
My octa is 7 because I use other variables. Thats why this is number 7.Derik wrote:mmm
How do you come to otca value 8?
And do i need to rename the JSON.lua to script_time_JSON.lua?
Json extract from rarfile. Leave name as it is.
-
- Posts: 26
- Joined: Thursday 02 October 2014 14:35
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Real-time solar data : azimuth, Altitude, Lux sensor...
Great nice to hear this helped you out.capman wrote:Okee, it's working now. Replace my original json.lua file with yours.
Thanks vmb
-
- Posts: 1601
- 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...
mmm
You guys run on Windows???
I see:
Change this to my cubieboard.
And this: Changed here my things
And here:
I removed the -- and set my Cubieboard IP:port
And here: Removed the -- and set my IP:Port
Only:
my dummy's are red..
You guys run on Windows???
I see:
Code: Select all
json = (loadfile "/home/linaro/domoticz/scripts/lua/JSON.lua")() -- For Linux
-- json = (loadfile "D:\\Domoticz\\scripts\\lua\\json.lua")() -- For Windows
And this:
Code: Select all
local config=assert(io.popen('curl http://api.wunderground.com/api/'..f4cf6d9992844b..'/conditions/q/'..NL..'/'..Nijmegen..'.json')) -- customize here !!
And here:
Code: Select all
--os.execute('curl "http://192.168.5.70:8080/json.htm?type=command¶m=updateuservariable&idx='..idxUserVarOcta..'&vname=octa&vtype=0&vvalue='..tostring(Octa)..'"')
And here:
Code: Select all
cmd='curl "http://192.168.5.70:8080/json.htm?type=command¶m=udevice&idx='..idxLux..'&svalue='..tostring(round(weightedLux,0))..'"'
Only:
my dummy's are red..
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
-
- Posts: 1601
- 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...
Code: Select all
-- and customize the URL of api.wunderground around line 104 according to your country.
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
-
- Posts: 26
- Joined: Thursday 02 October 2014 14:35
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Real-time solar data : azimuth, Altitude, Lux sensor...
Derik, I'm running on a Pi3.
I only changed the custumizable lines in the script. Nothing else, not even around line 104.
I only changed the custumizable lines in the script. Nothing else, not even around line 104.
-
- Posts: 1601
- 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...
please your total script without the api...
going creazy here..
Other error:
going creazy here..
Other error:
Code: Select all
2016-08-21 14:30:05.265 Error: EventSystem: in /home/linaro/domoticz/scripts/lua/script_time_SolarSensor.lua: .../linaro/domoticz/scripts/lua/script_time_SolarSensor.lua:97: attempt to perform arithmetic on global 'relativePressure' (a nil value)
2016-08-21 14:30:01.877 (D.M.: RFXcomE) Wind (D.M.: Wind)
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
-
- Posts: 1601
- 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...
i am not stupid...
Think there is something more wrong then my stupid actions..
Wiki step by step..
And no luck...
Please update the wiki so thing are correct....
Think there is something more wrong then my stupid actions..
Wiki step by step..
And no luck...
Please update the wiki so thing are correct....
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
Re: Real-time solar data : azimuth, Altitude, Lux sensor...
From the original wiki
without weathe underground you need to repalce that with:
or read it from a pressure sensor...
That yould fix your nil... now I am also stuck on the cloud coverage not coming in....
Code: Select all
-- API Wunderground
local config=assert(io.popen('curl http://api.wunderground.com/api/'..wuAPIkey..'/conditions/q/'..countryCode..'/'..city..'.json'))
local location = config:read('*all')
config:close()
local jsonLocation = json:decode(location)
if( DEBUG == 1) then
local latitude = jsonLocation.current_observation.display_location.latitude
local longitude = jsonLocation.current_observation.display_location.longitude
local altitude = jsonLocation.current_observation.display_location.elevation
print('Lat: '..latitude..'Long: '..longitude..'Alt: '..altitude)
end
relativePressure = jsonLocation.current_observation.pressure_mb -- if you have an another way to get the Pressure, (local barometer ...) then you may optimize the script and avoid the call to api.wunderground)
Code: Select all
relativePressure = 1012
That yould fix your nil... now I am also stuck on the cloud coverage not coming in....
Who is online
Users browsing this forum: No registered users and 1 guest