Plugins leveraging other Plugins


Another newbie question.

Can someone tell me the "current state of things" (or point me at a doc or thread) for plugins calling functionality from other plugins?

So in this example, what if a plugin wanted to send customized SMS messages on certain events? There are already a handful of SMS related plugins. It would be easy enough to copy some of that code into my plugin, but that's not very clean. It would be nice to check if the user already had Plugin X installed and then reuse that functionality.

Conversely, if I wrote a plugin with generalized functionality, how would I make that functionality available to other plugins?

I'm reaching out now because I can see a few ways I might be able to re-use other plugin code without copy-pasting, but I'd like to know what "best practices" are before spending a lot of time.

It all depends on if the plugin you're trying to leverage has helpers defined.

My TasmotoMQTT plugin utilizes helpers available in the MQTT plugin. It's also possible to leverage API calls of other plugins if they have Blueprint of SImpleAPI plugin implementations.


I think you can also import other plugins because they are all Python packages, just make sure to use the package name of the plugin (i.e. the name of the directory that has the in the import statement.