MAIN PRINCIPLE OF THIS PLUGIN
I am using many IoT devices using MQTT, currently over 120. I have tried several existing MQTT plugins, and they are all great except for one thing; reusability. I found myself spending many hours configuring the same device type over and over, and depending on how precisely I duplicated all steps I would get more or less the same results. When adding functionality or improving existing functions, I needed to redo that again to many devices. So instead of making MQTT Topics the basis for this plugin, I choose the actual device as a starting point.
It is probably not the most flexible MQTT plugin looking at the numbers of features. But it is simple, predictable, stable and extremely fast. And keeps maintaining my devices to a minimum. Also, since Device and Feature templates are reusable, it would be great if we could create a community where we share our templates for others as well.
DEVICE AND FEATURES TEMPLATES
Simply put, a Device template is a reference to a MQTT device type. For instance, a Shelly 2.5. If defines basic characteristics like name and the features it holds. The definition of the features are in a separate template called Feature template. There all characteristics of that specific feature is defined. A feature often refers to a single MQTT topic, but it can also be used to listen to multiple topics, each holding multiple value and status information. If a MQTT device can also be controlled, it can also be configured in the Feature template, using multiple controls like buttons and sliders, and can use multiple MQTT commands.
When assigning a Device template to an actual device, a HS4 device will be created. The Device template should have one or more Feature templates assigned to it, and for each Feature template a HS4 feature (child device) below the HS4 device will be created as well.
You can use the "Device templates" and "Feature templates" tabs in the MQTT IoT setup for easy editing. You can also edit the JSON files directly if you prefer. Make sure to adhere to the JSON standards when editing JSON files, so either use a good JSON editor or an online one like this: https://jsonformatter.org/json-editor. The plugin also allows for direct editing the JSON (raw) templates, and basic JSON formatting checking will be performed before it can be saved.
I am using many IoT devices using MQTT, currently over 120. I have tried several existing MQTT plugins, and they are all great except for one thing; reusability. I found myself spending many hours configuring the same device type over and over, and depending on how precisely I duplicated all steps I would get more or less the same results. When adding functionality or improving existing functions, I needed to redo that again to many devices. So instead of making MQTT Topics the basis for this plugin, I choose the actual device as a starting point.
It is probably not the most flexible MQTT plugin looking at the numbers of features. But it is simple, predictable, stable and extremely fast. And keeps maintaining my devices to a minimum. Also, since Device and Feature templates are reusable, it would be great if we could create a community where we share our templates for others as well.
DEVICE AND FEATURES TEMPLATES
Simply put, a Device template is a reference to a MQTT device type. For instance, a Shelly 2.5. If defines basic characteristics like name and the features it holds. The definition of the features are in a separate template called Feature template. There all characteristics of that specific feature is defined. A feature often refers to a single MQTT topic, but it can also be used to listen to multiple topics, each holding multiple value and status information. If a MQTT device can also be controlled, it can also be configured in the Feature template, using multiple controls like buttons and sliders, and can use multiple MQTT commands.
When assigning a Device template to an actual device, a HS4 device will be created. The Device template should have one or more Feature templates assigned to it, and for each Feature template a HS4 feature (child device) below the HS4 device will be created as well.
You can use the "Device templates" and "Feature templates" tabs in the MQTT IoT setup for easy editing. You can also edit the JSON files directly if you prefer. Make sure to adhere to the JSON standards when editing JSON files, so either use a good JSON editor or an online one like this: https://jsonformatter.org/json-editor. The plugin also allows for direct editing the JSON (raw) templates, and basic JSON formatting checking will be performed before it can be saved.
Comment