Fibaro ZWave Keyfob - press/hold mode

Tags: #<Tag:0x00007fc42ce9dc28> #<Tag:0x00007fc42ce9da98>

fibaro

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

This blueprint can be used for creation of a single automatization for controlling whole keyfob. Each of six buttons has three actions - press/hold/release. All actions are optional - if no action is defined, default one is used (log the event).

This blueprint is made for press/hold mode only. Feel free to post modifications of this blueprint to other modes.

Import from Gist URL above and enjoy :slight_smile:

blueprint:
  name: Fibaro Keyfob (press/hold mode)
  description: >-
    This blueprint can be used for creation of a single automatization for controlling whole keyfob. Each of six buttons has three actions - press/hold/release.
    All actions are optional - if no action is defined, default one is used (log the event).
    This blueprint is made for press/hold mode only.
  domain: automation
  input:
    keyfob:
      name: Keyfob entity ID
      selector:
        entity:
          domain: zwave
    square_press:
      name: Square button press action
      selector:
        action:
      default:
      - service: logbook.log
        data:
          name: Fibaro keyfob
          message: Square button pressed
    square_hold:
      name: Square button hold action
      selector:
        action:
      default:
      - service: logbook.log
        data:
          name: Fibaro keyfob
          message: Square button held
    square_release:
      name: Square button release (after holding) action
      selector:
        action:
      default:
      - service: logbook.log
        data:
          name: Fibaro keyfob
          message: Square button released after being held
    circle_press:
      name: Circle button press action
      selector:
        action:
      default:
      - service: logbook.log
        data:
          name: Fibaro keyfob
          message: Circle button pressed
    circle_hold:
      name: Circle button hold action
      selector:
        action:
      default:
      - service: logbook.log
        data:
          name: Fibaro keyfob
          message: Circle button held
    circle_release:
      name: Circle button release (after holding) action
      selector:
        action:
      default:
      - service: logbook.log
        data:
          name: Fibaro keyfob
          message: Circle button released after being held
    x_press:
      name: X button press action
      selector:
        action:
      default:
      - service: logbook.log
        data:
          name: Fibaro keyfob
          message: X button pressed
    x_hold:
      name: X button hold action
      selector:
        action:
      default:
      - service: logbook.log
        data:
          name: Fibaro keyfob
          message: X button held
    x_release:
      name: X button release (after holding) action
      selector:
        action:
      default:
      - service: logbook.log
        data:
          name: Fibaro keyfob
          message: X button released after being held
    triangle_press:
      name: Triangle button press action
      selector:
        action:
      default:
      - service: logbook.log
        data:
          name: Fibaro keyfob
          message: Triangle button pressed
    triangle_hold:
      name: Triangle button hold action
      selector:
        action:
      default:
      - service: logbook.log
        data:
          name: Fibaro keyfob
          message: Triangle button held
    triangle_release:
      name: Triangle button release (after holding) action
      selector:
        action:
      default:
      - service: logbook.log
        data:
          name: Fibaro keyfob
          message: Triangle button released after being held
    minus_press:
      name: Minus button press action
      selector:
        action:
      default:
      - service: logbook.log
        data:
          name: Fibaro keyfob
          message: Minus button held
    minus_hold:
      name: Minus button hold action
      selector:
        action:
      default:
      - service: logbook.log
        data:
          name: Fibaro keyfob
          message: Minus button held
    minus_release:
      name: Minus button release (after holding) action
      selector:
        action:
      default:
      - service: logbook.log
        data:
          name: Fibaro keyfob
          message: Minus button released after being held
    plus_press:
      name: Plus button press action
      selector:
        action:
      default:
      - service: logbook.log
        data:
          name: Fibaro keyfob
          message: Plus button pressed
    plus_hold:
      name: Plus button hold action
      selector:
        action:
      default:
      - service: logbook.log
        data:
          name: Fibaro keyfob
          message: Plus button held
    plus_release:
      name: Plus button release (after holding) action
      selector:
        action:
      default:
      - service: logbook.log
        data:
          name: Fibaro keyfob
          message: Plus button released after being held

mode: parallel

trigger:
  - platform: event
    event_type: zwave.scene_activated
    event_data:
      entity_id: !input keyfob

action:
- choose:

  # Square
  - conditions:
    - condition: template
      value_template: '{{ trigger.event.data.scene_id == 1 and trigger.event.data.scene_data == 7680 }}'
    sequence: !input square_press
  - conditions:
    - condition: template
      value_template: '{{ trigger.event.data.scene_id == 1 and trigger.event.data.scene_data == 7800 }}'
    sequence: !input square_hold
  - conditions:
    - condition: template
      value_template: '{{ trigger.event.data.scene_id == 1 and trigger.event.data.scene_data == 7740 }}'
    sequence: !input square_release

  # Circle
  - conditions:
    - condition: template
      value_template: '{{ trigger.event.data.scene_id == 2 and trigger.event.data.scene_data == 7680 }}'
    sequence: !input circle_press
  - conditions:
    - condition: template
      value_template: '{{ trigger.event.data.scene_id == 2 and trigger.event.data.scene_data == 7800 }}'
    sequence: !input circle_hold
  - conditions:
    - condition: template
      value_template: '{{ trigger.event.data.scene_id == 2 and trigger.event.data.scene_data == 7740 }}'
    sequence: !input circle_release

  # X
  - conditions:
    - condition: template
      value_template: '{{ trigger.event.data.scene_id == 3 and trigger.event.data.scene_data == 7680 }}'
    sequence: !input x_press
  - conditions:
    - condition: template
      value_template: '{{ trigger.event.data.scene_id == 3 and trigger.event.data.scene_data == 7800 }}'
    sequence: !input x_hold
  - conditions:
    - condition: template
      value_template: '{{ trigger.event.data.scene_id == 3 and trigger.event.data.scene_data == 7740 }}'
    sequence: !input x_release

  # Triangle
  - conditions:
    - condition: template
      value_template: '{{ trigger.event.data.scene_id == 4 and trigger.event.data.scene_data == 7680 }}'
    sequence: !input triangle_press
  - conditions:
    - condition: template
      value_template: '{{ trigger.event.data.scene_id == 4 and trigger.event.data.scene_data == 7800 }}'
    sequence: !input triangle_hold
  - conditions:
    - condition: template
      value_template: '{{ trigger.event.data.scene_id == 4 and trigger.event.data.scene_data == 7740 }}'
    sequence: !input triangle_release

  # Minus
  - conditions:
    - condition: template
      value_template: '{{ trigger.event.data.scene_id == 5 and trigger.event.data.scene_data == 7680 }}'
    sequence: !input minus_press
  - conditions:
    - condition: template
      value_template: '{{ trigger.event.data.scene_id == 5 and trigger.event.data.scene_data == 7800 }}'
    sequence: !input minus_hold
  - conditions:
    - condition: template
      value_template: '{{ trigger.event.data.scene_id == 5 and trigger.event.data.scene_data == 7740 }}'
    sequence: !input minus_release

  # Plus
  - conditions:
    - condition: template
      value_template: '{{ trigger.event.data.scene_id == 6 and trigger.event.data.scene_data == 7680 }}'
    sequence: !input plus_press
  - conditions:
    - condition: template
      value_template: '{{ trigger.event.data.scene_id == 6 and trigger.event.data.scene_data == 7800 }}'
    sequence: !input plus_hold
  - conditions:
    - condition: template
      value_template: '{{ trigger.event.data.scene_id == 6 and trigger.event.data.scene_data == 7740 }}'
    sequence: !input plus_release
1 Like

You don’t use zwave scenes for this? Nice idea for logbook sniffing :slight_smile:

Zwave-JS version can be found here (same author as the above BluePrint):

Mvg