A simple button widget that sends ON commands to an item.
Typical use case is that a rule gets triggered when the item state changes to ON and at the end of the rule, the item state will be set back to OFF.
The label on the button can be configured, as well as the TITLE.
I use this to control the roller shutter automation in my house:
No idea - I am new to this and just started to create my own widget. I just put online a version derived from yours where the command can be specified, since I needed the widget to be able to send different commands for different scenarios. But I do not know yet how to update a published widget once it is on the market place.
Regarding the previous issue. There’s a stupid reason why this happens…
The YAML 1.1 spec thought a good idea to say that ON is a valid representation of the true boolean.
See Boolean Language-Independent Type for YAML™ Version 1.1
As you can see the same is true for all these:
When you install the widget from the marketplace the library that does the parsing complies with this so your actionCommand: ON will be transformed to "actionCommand": true in JSON.
This doesn’t happen in the UI because the client-side library doesn’t honor this part of the spec.
So when using the above in marketplace entries make sure you use quotes i.e. commandAction: "ON" (which the UI will happily remove… so you can use for instance commandAction: ="ON")