Skip to main content

Recap

Let's recap what we just accomplished:

  1. Created a new plugin project.
  2. Implemented metrics.
    We created three different metrics and registered them with MoBro.
  3. Scheduled dynamic metric updates.
    We used the scheduler to periodically update the values of our dynamic metrics.
  4. Added a plugin setting.
    We made the update frequency configurable by the user.
  5. Published the plugin.
    We packed the plugin into a single .zip file.
  6. 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 the mobro_plugin_config.json file, 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.