Homematic - Actions for HmIP-BSM

Hey,

I just like the Idea of getting Automations in one place with blueprints.

So, I just used the perfect work from @AndrejDelany (Homematic - Actions for HmIP-WRC6 / HM-PB-6-WM55 and changed it a little bit to fit it to HmIP-BSM devices. Nothing special.

As @AndrejDelany s Work, you need to use the Homematic device name. And if it’s still not working, please keep in mind, you need to extract the keypress events (see: homematic.keypress events for Homematic IP devices. By the way: If you like to debug this, just head to “Developer Tools” --> “Events” in your Home Assistant and subscribe “homematic.keypress” (without quote signs) in the bottom " Listen to events" Box.

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

blueprint:
  name: Actions for HmIP-BSM
  description: When a button is pressed, the defined actions will be executed. Please keep in mind, that long-press actions might be executed multiple times, according to your configured minimum duration for long press. This can be configured in your CCU.
  domain: automation
  input:
    switch:
        name: HmIP-BSM Device
        description: Please select a HmIP-BSM entity of your Homematic (not Homematic Cloud) integration by typing in the name of the device which was set in your CCU.
        
    action_top_short:
        name: Action
        description: Top-Button, Short Press
        default: []
        selector:
            action: {}
    action_top_long:
        name: Action
        description: Top-Button, Long Press
        default: []
        selector:
            action: {}
    action_bottom_short:
        name: Action
        description: Bottom-Button, Short Press
        default: []
        selector:
            action: {}
    action_bottom_long:
        name: Action
        description: Bottom-Button, Long Press
        default: []
        selector:
            action: {}

trigger:
  - platform: event
    event_type: homematic.keypress
    event_data:
      name: !input 'switch'
      
condition: []
    
action:
  - choose:
      - conditions:
          - condition: template
            value_template: >-
              {{ trigger.event.data.channel == 2 and trigger.event.data.param == 'PRESS_SHORT' }}
        sequence: !input 'action_top_short'
      - conditions:
          - condition: template
            value_template: >-
              {{ trigger.event.data.channel == 2 and trigger.event.data.param == 'PRESS_LONG' }}
        sequence: !input 'action_top_long'
      - conditions:
          - condition: template
            value_template: >-
              {{ trigger.event.data.channel == 1 and trigger.event.data.param == 'PRESS_SHORT' }}
        sequence: !input 'action_bottom_short'
      - conditions:
          - condition: template
            value_template: >-
              {{ trigger.event.data.channel == 1 and trigger.event.data.param == 'PRESS_LONG' }}
        sequence: !input 'action_bottom_long'

mode: parallel
max: 10

Hope, it’s useful for someone.

2 Likes

Thanks for the blueprint. I can’t make it work though. I imported this blueprint, set up new automation. It works if I run it manually. I have a problem with trigger (long press or even short one, I tried that and nothing).

hmip-bsm works (I can turn on/off other led I have via home assistant, not using this blueprint but just normal on/off change status. I want to use long press trigger).

- id: 'xxxx'
  alias: Turn on kitchen bar + wall
  description: ''
  use_blueprint:
    path: jesc/homematic-actions-for-hmip-bsm.yaml
    input:
      switch: switch.hmip-bsm-kitchen
      action_top_short: []
      action_bottom_long:
      - type: turn_on
        device_id: xxxxy
        entity_id: switch.kitchen_bar
        domain: switch
      - type: turn_on
        device_id: xxxxyy
        entity_id: light.shelly
        domain: light

I am not getting any homematic.keypress events even short or long ones. I created empty program in homematic, for long press one button. Still nothing, strange