In the Domoticz settings, my home longitude/lattitude values are filled in.
How can i access these settings from LUA (so nót dzvents!)?
I would like to use these values to com[are with the values as returned from my car API, so I can see if the car is actually on the driveway or not!
access longitude/lttitude
Moderator: leecollings
- waltervl
- Posts: 5844
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: access longitude/lttitude
Perhaps check globalvariables table?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
- habahabahaba
- Posts: 233
- Joined: Saturday 18 March 2023 14:44
- Target OS: Windows
- Domoticz version: 2024.4
- Contact:
Re: access longitude/lttitude
By using API request - /json.htm?type=settings ?
- jvdz
- Posts: 2328
- Joined: Tuesday 30 December 2014 19:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.107
- Location: Netherlands
- Contact:
Re: access longitude/lttitude
Just an example script that uses the url provided by habahabahaba :
Code: Select all
JSON = require 'JSON'
local url = "http://127.0.0.1:8080/json.htm?type=settings"
local handle=assert(io.popen('curl -s ' .. url))
local Dom_Data = handle:read('*all')
handle:close()
local decoded_response = JSON:decode(Dom_Data)
print(os.date("%X").." Latitude="..decoded_response["Location"]["Latitude"] .." Longitude="..decoded_response["Location"]["Longitude"] )
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
-
- Posts: 748
- Joined: Saturday 27 February 2016 12:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: NL
- Contact:
Re: access longitude/lttitude
Thank you! That is exactly what I was looking for!!! 
Makes me wonder, is there a list of data elements in that settings table?

Makes me wonder, is there a list of data elements in that settings table?
Hans
- jvdz
- Posts: 2328
- Joined: Tuesday 30 December 2014 19:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.107
- Location: Netherlands
- Contact:
Re: access longitude/lttitude
Just use the link in a browser and you can see the complete Returned json and its content.
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
-
- Posts: 748
- Joined: Saturday 27 February 2016 12:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: NL
- Contact:
Who is online
Users browsing this forum: No registered users and 1 guest