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.
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.