Door and Lock Combo

A combo list widget that shows the open/closed state of a door, locked/unlocked state of the door lock, and allows one to lock/unlock the door. The locked/unlocked state is represented with a lock icon and color: unlocked orange, locked green. The door’s open/closed state is represented with a badge: open orange, closed green. Clicking on the widget will cause the lock to unlock.

Changelog

Version 0.1

  • initial release

Resources

uid: rlk_lock_list
tags:
  - list
  - lock
props:
  parameters:
    - description: Door name
      label: Name
      name: name
      required: false
      type: TEXT
    - context: item
      description: Control Item
      label: Control Item
      name: control_item
      required: false
      type: TEXT
    - context: item
      description: Sensor Item
      label: Sensor Item
      name: sensor_item
      required: false
      type: TEXT
  parameterGroups: []
component: oh-list-item
config:
  icon: '=(items[props.control_item].state == "ON") ? "f7:lock" : "f7:lock_open"'
  iconColor: '=(items[props.control_item].state == "ON") ? "green" : "orange"'
  title: =props.name
  subtitle: '=(items[props.sensor_item].state == "OPEN") ? "open" : (items[props.control_item].state == "ON") ? "closed and locked" : "closed and unlocked"'
  action: toggle
  actionCommand: ON
  actionCommandAlt: OFF
  actionItem: =props.control_item
  badgeColor: '=(items[props.sensor_item].state == "OPEN") ? "orange" : "green"'
  badge: '=(items[props.sensor_item].state == "OPEN") ? "open" : "closed"'
3 Likes