I wanted a single, momentary pushbutton to appear in BasicUI. When pressed it would trigger a spoken report of today’s events; its appearance should be stateless (i.e. does not indicate on or off). BasicUI does not appear to offer a momentary pushbutton. A Switch (indicating on/off) is not the appropriate UI control for my purpose.
I cobbled together something that produces the effect I want. I doubt it’s an original idea and there may be a more elegant way to do it; I’m open to suggestions.
To create a solitary, momentary pushbutton, I used the following:
Switch
Mappings
Expire Binding
The Item is defined like so (this is an abbreviated version of it) using “expire”:
The best way to accomplish something is the first way that works, IMO - don’t fix it until it doesn’t
I like it! Perfect use for the expire binding to implement a momentary pushbutton.
The only other way I can think of (and the way I implement my scene logic, is to use the rule that’s fired to set the state back to “OFF” on a toggle switch, after it’s done. But, this is actually cleaner and better-looking
To take it to the next level you can use the visibility tag when you want a momentary button that says something different based on the state of some other Item. I use this for my garage door openers.
I won’t scar my wife by opening them right now but the button name changes to Close when the door sensor says the door is open and the icon changes to an opened garage door.
OK, I’ll run with what I’ve got; it seems to do the trick. Thanks for the example using “visibility”. I’ve been mining ThomDietrich’s repo for examples and this will also help me get my garage door into BasicUI.
Red Green: And men, remember, if the women don’t find you handsome, they should at least find you handy!