NOTE: This plugin is under revision due to issues with newer python versions. It is temporarily not included in the release versions of XTension. Let me know if this needs to be a priority for you and I can move it up the list.
version 0.1 (alpha 1)
This plugin is based on the hbmqtt broker source.
This alpha version is as of yet very simple and not feature complete. Only numeric values work at the moment.
Any string that is simply a number will work so just 15.6 works also “15.6”
Any string that contains letters before or after the number will also work, with the limitation that only the first range of numbers that are found will be sent to XTension.
Values that are dates will be parsed but will not currently yield any useful values in their XTension units. “Friday August 27, 2021 12:18:40” will become just 27 as that is the first valid number in the string.
For any message for which a numerical value can be found a Unit in XTension will be created automatically. If a numeric value cannot be parsed out of the message then no unit will be created and the message will be ignored. In the future I plan to build in ways to parse string values into usable values or states but this is not included in this alpha version.
This alpha version supports incoming data only. Subscriptions will not return errors to the clients, but no data will be sent. If you make changes in XTension to the units that information will not yet be forwarded on to the connected clients.
This is a broker not a client. This plugin does not support sharing other XTension units to a separate broker elsewhere. That is something else I can do a plugin for so please let me know if this is something you would find useful and I will move it up the list of projects.
As of this alpha version the address of the unit is an all uppercase version of the topic path of the mqtt item as sent. It may be necessary to also add the client id to the beginning of the path to make sure they are unique across all possibilities so this may change when it’s done being alpha and you may have to edit your units.
The name of the unit is built by taking the client id and appending the topic path to it. Once the unit is created you can edit the unit and give it a more descriptive name or anything you wish as long as you do not change the address.
Setting up the broker in XTension requires only setting a unique port. The default port for an mqtt server is 1883. Though many devices can connect to a single broker you can also run multiple brokers on different ports if you wish.
There is currently no way to stop XTension from creating a unit for every message that it can find a numerical value in the message. I will be adding the standard “create units automatically” checkbox to the interface setup in an upcoming version so you can turn that off.