Page 1 of 1
How to access settings
Posted: Saturday 25 February 2017 23:03
by gerardvs
Hi all,
At the moment I'm a bit lost in what api's are available from Python. I know there is a (limited) description of json calls but want to know what I can call directly from Python.
For now I want to access the settings without having to call /json.htm?type=settings.
Please let me know if/where to find this information.
Thanks,
--Gerard
Re: How to access settings and more
Posted: Thursday 02 March 2017 9:01
by gerardvs
Sorry to bump this question. Additionally to my previous post I also want to create and access user variables from the python plugin. Is that possible and if so, how?
Thanks,
--Gerard
Re: How to access settings
Posted: Thursday 02 March 2017 13:44
by Dnpwwo
@gerardvs,
When "Add Settings collection #1289" pull request gets merged you will be able to Domoticz settings via a Setting dictionary from within a plugin.
What are you trying to achieve by accessing User Variables? These are designed for users to access during events from Lua and I can't think why you would access them from a plugin that interfaces to an external device.
Re: How to access settings
Posted: Thursday 02 March 2017 14:06
by gerardvs
Thanks for the great news about the settings collection! I will pull it out of the Python-Plugins branch and test it asap.
About the uservariables, well, its more a dirty mind (from a programming point of view

) in the sense of an easy way of communicating with the plugin from the outside world via the json api. Of course pulling data is no problem but pushing data to the plugin, if needed, is fairly easy that way.
May be I should think about is a bit more and if I can find some real world benefits I will start a new topic on this.
Thanks again,
--Gerard
Re: How to access settings
Posted: Thursday 02 March 2017 17:04
by gerardvs
Update: Just did a quick test and I can access all settings/preferences now from my plugin!
Thanks again,
--Gerard
Re: How to access settings
Posted: Thursday 02 March 2017 17:07
by ffes
Dnpwwo wrote:When "Add Settings collection #1289" pull request gets merged you will be able to Domoticz settings via a Setting dictionary from within a plugin.
\o/
I see it is already merged!!! Looking forward to this very much. I don't have to ask the users for their location and retrieve it from the settings. Hope to have some time soon to update my plugin to use this!
Re: How to access settings
Posted: Thursday 02 March 2017 18:36
by gerardvs
Indeed, I already removed the lat/lon settings and retrieve them now from the system settings.
