Get domoticz settings from script

Moderator: leecollings

Post Reply
digdug3
Posts: 19
Joined: Monday 03 August 2015 22:35
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Get domoticz settings from script

Post by digdug3 »

Is it possible to read the Domoticz settings from a script? (Longitude, Latitude maybe even the Domoticz ip/port)
As these are used in many scripts.
User avatar
lonebaggie
Posts: 86
Joined: Tuesday 31 January 2017 13:21
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: England
Contact:

Re: Get domoticz settings from script

Post by lonebaggie »

Yes

you can get the settings by using a json call to Domoticz. Unfortunately to use json you need to know the IP address ( if using script on same box you can use 127.0.0.1)

use json call http://ip:port/json.htm?type=settings

if using lua you can use json.lua to parse results into tables

https://www.domoticz.com/wiki/Lua_-_json.lua

hope this helps
digdug3
Posts: 19
Joined: Monday 03 August 2015 22:35
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Re: Get domoticz settings from script

Post by digdug3 »

Thank you lonebaggie! Tried it and was able to get the info!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest