I have a device handler that has some added text attributes and a boolean attribute.
If I select one of the text attributes when creating a rule I get offered a string field as you would expect.
When I select the boolean attribute I do not get offered a comparison field although the screen seems to think that I should be. See attached screenshot.
@Gary_Milne can you please post the link to the custom device handler so I can take a look? For the Switch attribute, there should be enum of “on”, “off” defined so rule engine knows what to be displayed as the options.
Thanks for the update. I just verified and found the boolean problem. I’ve added this to my short list. Meanwhile, please use enum before the fix is released. Thanks for reporting.
There aren’t any official Capabilities which implement BOOLEAN and it was ultimately deprecated so we did not include support for it. There was a proposed capability with it.
Keep in mind that the Switch capability defines a single attribute called switch which is an ENUM with values ['on', 'off'] and commands on() and off().
You could use multiple custom attributes and commands on a single device, but there are compatibility concerns. The common practice would be to stick with the same style of attribute definition as the core capability you are mirroring. eg. attribute "switchN", "enum", ["on", "off"]. You can use these custom attributes and commands in the SharpTools Rule Engine, but you’re better off sticking with parent-child devices if you want to use them in the SharpTools dashboards.