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: 6678
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2025.1
- 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: 266
- 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: 2441
- 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"] )
-
manjh
- Posts: 859
- 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: 2441
- 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.
-
manjh
- Posts: 859
- Joined: Saturday 27 February 2016 12:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: NL
- Contact:
Re: access longitude/lttitude
Yes, of course. Thanks!jvdz wrote: Wednesday 09 April 2025 8:26 Just use the link in a browser and you can see the complete Returned json and its content.
Hans
Who is online
Users browsing this forum: No registered users and 1 guest