Recap
Let's recap what we just accomplished:
- Created a new plugin project.
- Implemented metrics.
We created three different metrics and registered them with MoBro. - Scheduled dynamic metric updates.
We used the scheduler to periodically update the values of our dynamic metrics. - Added a plugin setting.
We made the update frequency configurable by the user. - Published the plugin.
We packed the plugin into a single.zipfile. - Installed the plugin.
Finally, we installed the plugin in MoBro and verified its metrics.
The resulting code is concise: the SDK handles the complex tasks, such as scheduling, managing settings, and communicating with MoBro. This allows us to focus on providing the actual data.
Template
Missed a step in this guide or ran into issues along the way?
A ready-to-use plugin similar to the one created in this guide is available on GitHub. Feel free to use it as a starting
point for your own plugins:
Plugin.Template
Next Steps
Wondering what to explore next? Here are some suggestions:
- In-depth: IMoBroPlugin
Understand the plugin lifecycle, e.g. what happens when settings change or the plugin is stopped. - In-depth: Error Handling
Learn how to handle errors, such as failing sensor reads or missing external dependencies, without stopping the plugin. - In-depth: Plugin Configuration
Discover all available fields of themobro_plugin_config.jsonfile, including the execution mode and dependencies. - In-depth: Registering Items
Dive into registering metrics, metric types, units, custom categories, actions, and more. - In-depth: Testing
Learn how to test settings changes and actions locally, and how to debug an installed plugin. - Example Plugins
Check out existing open-source plugins for inspiration and best practices.