Page 1 of 1

Feature request > Get other devices data (not plugin managed devices)

Posted: Thursday 07 January 2021 17:29
by Masure
Hi,

I'm developing a plugin which needs "external" device value. By "external", I mean a device which has not been created by the plugin.

I usualy access to the plugin devices like this

Code: Select all

Devices[unit]
Now I need to access another device nvalue. By idx, ID or name looping in an array, whatever.

Did not find anything in the documentation. I'm afraid the only way will be with the Domoticz web API. If it's the only way, I'll use it but going through the web API from the core plugin engine would be so sad.

edit : I turn this question into a feature request in the plugin system.

Re: Python plugin, how to get a device not handled by the plugin ?

Posted: Friday 08 January 2021 16:34
by Masure
Before I can find a real solution, I implemented the sensor data retrieval from the web api. As I had assumed, this is really ugly .

I have to re specify the connection details to the domoticz server (username, password, port, ...) for the plugin to work. Whereas the plugin is running inside Domoticz, this is pure nonsense and will be confusing for the user when he will have to specify those in the plugin parameters.

Do I miss something big ? Please tell me so.

Re: Feature request > Get other devices data (not plugin managed devices)

Posted: Monday 27 December 2021 10:36
by Masure
I up this thread and hope Dnpwwo will read ;)

This may sound weird but I really have the need.

My plugin manage Mitsubishi air conditionner units (https://github.com/Masurov/Domoticz-Mit ... QTT-Plugin). To make the regulation, the AC unit takes current temperature value from internal sensor by default. But it also allows to take another temperature value. I send the value to the AC interface from a better located temperature sensor I have in Domoticz.

My plugin allows the user to give the device idx he wants to use as the alternative temperature sensor.

Technically I have no other way to query this value from the http json interface. I'd like to have a more straightforward in the plugin system. Another dictionary "OtherDevices" alongside the plugin managed "Devices" dictionary.