Page 4 of 4

Re: Script for Airplanes.live api

Posted: Tuesday 21 January 2025 17:17
by WBeulink
Got it all working. Very good work!
There were 2 things:

1. I'm running on the latest Beta of Domoticz. Ever since mid december this is not working in the Beta:
local lat = dz.settings.location.latitude
local long = dz.settings.location.longitude
Gives two times a zero!
So I added right below:
lat = 52.15603148339703
long = 5.372035503387451
[I found this problem with your "Dutch Stookwijzer" script. So I was prepared.]
2. In Global Data I Added under data:
airplanes = { initial = {} },
Has to be:
ap_table = { initial = {} },
Found the first name somewhere higher up in the posts.

But I'm very glad now. Everything is working.
Although I have some doubles in the list and CSV.
Maybe I hve to narrow down the distance

Willem
Thanks.

Re: Script for Airplanes.live api

Posted: Tuesday 21 January 2025 17:38
by waltervl
WBeulink wrote: Tuesday 21 January 2025 17:17 Got it all working. Very good work!
There were 2 things:

1. I'm running on the latest Beta of Domoticz. Ever since mid december this is not working in the Beta:
local lat = dz.settings.location.latitude
local long = dz.settings.location.longitude
Gives two times a zero!
When I put this in my domoticz script is is working and logging normal values:

Code: Select all

	execute = function(domoticz, device)
		domoticz.log('Device ' .. device.name .. ' was changed', domoticz.LOG_INFO)
		domoticz.log('Location lat ' .. domoticz.settings.location.latitude .. ' longitude: ' .. domoticz.settings.location.longitude , domoticz.LOG_INFO)
	end

Re: Script for Airplanes.live api

Posted: Tuesday 21 January 2025 19:37
by janpep
WBeulink wrote: Tuesday 21 January 2025 17:17 Got it all working. Very good work!
There were 2 things:
1. About the lat & long
No need to say that the dz.settings.location.latitude amd dz.settings.location.longitude are working here.
waltervl was first. ( I guess he is here day and night :-) ) He also confirms this.
Curious to know: Are Latitude and Longitude entered in your Setup - Settings - System under Location?
Also look at other earlier post about the 0,0.


2. About the table,
I remember that I changed this in de beginning. May be I did not rename it in all places, but I am glad you found the solution.
Found and changed this in my earlier posts and publications of the script, where it is also present.
NB. You might not have ran into it, but change also the line

Code: Select all

_d.initialize('airplanes') -- Re-initialize the table
into

Code: Select all

_d.initialize('ap_table') -- Re-initialize the table

Re: Script for Airplanes.live api

Posted: Wednesday 22 January 2025 13:54
by WBeulink
_d.initialize('ap_table') -- Re-initialize the table
This was OK in my script ('ap-table') but the line was commented out.
Now it isn't anymore. Let's see .......

Re: Script for Airplanes.live api

Posted: Wednesday 22 January 2025 17:29
by janpep
WBeulink wrote: Wednesday 22 January 2025 13:54 _d.initialize('ap_table') -- Re-initialize the table
This was OK in my script ('ap-table') but the line was commented out.
Now it isn't anymore. Let's see .......
No. That line was indeed correct and commented out and only used for reset, when table was mixed up to clean up (old records that are not deleted properly).Should not be needed anymore.
Futher down you can find the line that I mentioned.

Re: Script for Airplanes.live api

Posted: Wednesday 22 January 2025 18:51
by WBeulink
Found indeed. Thanks.