ButtonON: button widget to send ON commands to an item

ButtonOn

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.

Screenshots

I use this to control the roller shutter automation in my house:

Changelog

Version 0.1

  • initial release

Resources

uid: ButtonOn
tags: []
props:
  parameters:
    - context: item
      description: Item to use with this button.
      label: Item
      name: item
      required: true
      type: TEXT
      groupName: general
    - description: Text to show on the button.
      label: Button
      name: Button
      required: false
      type: TEXT
    - description: Text to show as title.
      label: Title
      name: Title
      required: false
      type: TEXT
  parameterGroups:
    - name: general
      label: Display options
timestamp: May 13, 2021, 9:25:53 AM
component: f7-card
config:
  title: '=(props.Title) ? props.Title : "Title"'
slots:
  default:
    - component: f7-block
      config:
        class: bog
        style:
          display: flex
          flex-wrap: wrap
          justify-content: space-between
          align-content: space-between
          padding: 20px
      slots:
        default:
          - component: oh-button
            config:
              text: '=(props.Button) ? props.Button : "Start"'
              outline: true
              actionItem: =(props.item)
              actionCommand: ON
              action: command
              active: =(items[props.item].state === 'ON')
              style:
                width: 100px