Script for Airplanes.live api

In this subforum you can show projects you have made, or you are busy with. Please create your own topic.

Moderator: leecollings

WBeulink
Posts: 26
Joined: Monday 21 December 2020 18:29
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: NL
Contact:

Re: Script for Airplanes.live api

Post 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.
--
RP5 - Bookworm - Domoticz 2024.7 and Latest Beta - Z-Wave JS UI. On Docker
Willem
--
User avatar
waltervl
Posts: 5361
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Script for Airplanes.live api

Post 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
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
janpep
Posts: 225
Joined: Thursday 14 March 2024 10:11
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: Script for Airplanes.live api

Post 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
Domoticz in Ubuntu virtual machine on Synology DS718+ behind FRITZ!Box.
Using: EvoHome; MELCloud; P1 meter; Z-Stick GEN5; Z-Wave-js-ui; MQTT; Greenwave powernodes 1+6; Fibaro switch, plugs, smoke; FRITZ!DECT 200. Scripts listed in profile interests.
WBeulink
Posts: 26
Joined: Monday 21 December 2020 18:29
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: NL
Contact:

Re: Script for Airplanes.live api

Post 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 .......
--
RP5 - Bookworm - Domoticz 2024.7 and Latest Beta - Z-Wave JS UI. On Docker
Willem
--
janpep
Posts: 225
Joined: Thursday 14 March 2024 10:11
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: Script for Airplanes.live api

Post 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.
Domoticz in Ubuntu virtual machine on Synology DS718+ behind FRITZ!Box.
Using: EvoHome; MELCloud; P1 meter; Z-Stick GEN5; Z-Wave-js-ui; MQTT; Greenwave powernodes 1+6; Fibaro switch, plugs, smoke; FRITZ!DECT 200. Scripts listed in profile interests.
WBeulink
Posts: 26
Joined: Monday 21 December 2020 18:29
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: NL
Contact:

Re: Script for Airplanes.live api

Post by WBeulink »

Found indeed. Thanks.
--
RP5 - Bookworm - Domoticz 2024.7 and Latest Beta - Z-Wave JS UI. On Docker
Willem
--
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest