Using Domoticz API from inside a plugin

Python and python framework

Moderator: leecollings

Post Reply
pipiche
Posts: 2035
Joined: Monday 02 April 2018 20:33
Target OS: Linux
Domoticz version:
Contact:

Using Domoticz API from inside a plugin

Post by pipiche »

I'm looking to call domoticz API from inside a plugin writen with the Python Framework.

While I think it is easy to call http://127.0.0.1/json.htm I'm looking for way to get the port where the Domoticz server is listening too ?
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Using Domoticz API from inside a plugin

Post by waaren »

pipiche wrote: Tuesday 11 June 2019 21:32 I'm looking to call domoticz API from inside a plugin writen with the Python Framework.
While I think it is easy to call http://127.0.0.1/json.htm I'm looking for way to get the port where the Domoticz server is listening too ?
I have no clue whatsoever how the Python Framework interact with the main domoticz code but dzVents calls m_webservers.our_listener_port from main/WebServerHelper.cpp and this helper gets it from web_settings.listening_port;
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
pipiche
Posts: 2035
Joined: Monday 02 April 2018 20:33
Target OS: Linux
Domoticz version:
Contact:

Re: Using Domoticz API from inside a plugin

Post by pipiche »

Thanks waaren, but unfortunatly not available inside the Framework.
Post Reply