I wanted to have a common button that had the following features:
- Not be triggered easily, but was easy to use (the standard openHAB prompts can get tiresome on a lot of buttons)
- could be used to connect to the backend device supporting it
- could show the power consumed buy the switch (both via text and easy visual)
- supported both normal (tablet/PC) and Mobile devices
- had a validation that it had been tested
- supported all openHAB icon formats
- optionally could support energy meters(which do not have a relay)
So i have this “Safety Button” that you click the safety cover (and it lifts) and then because your finger is already there you can press the button (and not have to read a message and find the button) , I have thought about adding a “double safety” message - if thats interesting let me know) ) or if you were scrolling you can close the Safety Cover) All safety covers are closed when the page starts again (unless the safety is false)
If the Icon is clicked and the settingsUrl is defined then it will launch a webpage to that device
If the “userValidated” is NOT set there is a red (pink because it displays on Dark and Light mode) Title Text to remind you that you may need to test that the button actually does what you meant it to before letting loose in the wiild.
Features:
The switch supports the following:
itemSwitch: The ON/FF Item for the Switch
itemPower: The Power measured by the switch (or a different item)
itemPowerMin: The minimum power to determine if the switch shows active) it will display ligh blue when there is power flowing , green when now (or less that itemMinPower) or red when off
title: The Name of the switch
safetyText: (the text to display on the Button safety Shield)
safety: Use the Safety Shield (or not)
iconVisible: If the Switch displays an icon
userValidated: Have you tested this is production???
configOnly: If there is no ON/OFF component but you want/need to display alongside other switches
iconName: the icon name - e.g. energy, oh:energy, iconify:arcticons:homewizard-energy, etc
settingsUrl: this launches to the URL for managine the switch - e.g. Tasmota or shelly ip address (http://192.168.1.54)
iconSize: self explanatory
compact: Standard Widget Size or something supporting a Mobile Phone
Screenshots
Standard View(blurred effect on button) The Lifted Safety Screen (blurred effect on title) The Compact View Unvalidated SwitchChangelog
Version 1.1.6
- initial release



