Hi,
am trying to find any info regarding access (read/update) existing devices from a python plugin without success.
Has anyone any clue about that?
thanks
Access other devices from a python plugin
Moderator: leecollings
- emme
- Posts: 909
- Joined: Monday 27 June 2016 11:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest
- Location: Milano, Italy
- Contact:
Re: Access other devices from a python plugin
I think you cannot....
Python plugins has granted access to a restricted sets of devices: theirs!
and some settings option
The reason is simple: by design, interaction between devices form different hardware MUST be performed by the server, not by hardware (or plugins)
If you want to interact between different hardward devices, use an external script... or LUA
ciao
M
Python plugins has granted access to a restricted sets of devices: theirs!

and some settings option

The reason is simple: by design, interaction between devices form different hardware MUST be performed by the server, not by hardware (or plugins)
If you want to interact between different hardward devices, use an external script... or LUA
ciao
M
The most dangerous phrase in any language is:
"We always done this way"
"We always done this way"
- ycahome
- Posts: 248
- Joined: Sunday 12 February 2017 10:55
- Target OS: Linux
- Domoticz version: lat Beta
- Contact:
Re: Access other devices from a python plugin
Hello emme.
Although, what you said seems reasonable, I can now interact with the rest of the hardware via API calls. But, If I do that, what's the difference from a plugin? Both can cause the problems you mentioned.
+ would be better to use internal functions than unmanaged API http calls.
My intention was to build a plugin that will time when a switch device is on (and give day, week , month, year usage), something that is missing from native code.
Although, what you said seems reasonable, I can now interact with the rest of the hardware via API calls. But, If I do that, what's the difference from a plugin? Both can cause the problems you mentioned.
+ would be better to use internal functions than unmanaged API http calls.
My intention was to build a plugin that will time when a switch device is on (and give day, week , month, year usage), something that is missing from native code.
--------
https://www.youtube.com/siakavelisgr
https://www.youtube.com/siakavelisgr
- Dnpwwo
- Posts: 820
- Joined: Sunday 23 March 2014 9:00
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Melbourne, Australia
- Contact:
Re: Access other devices from a python plugin
@ycahome,
I believe that would be done much easier in Lua. You can write a script that is notified of all device events which sounds perfect for what you want to do.
As emme has said, the plugin framework is designed for interfacing external hardware to Domoticz. Plugins only see their own devices as a control to stop bugs impacting other devices and trashing a user's system
I believe that would be done much easier in Lua. You can write a script that is notified of all device events which sounds perfect for what you want to do.
As emme has said, the plugin framework is designed for interfacing external hardware to Domoticz. Plugins only see their own devices as a control to stop bugs impacting other devices and trashing a user's system
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw
Who is online
Users browsing this forum: Bing [Bot], boum and 1 guest