Hey,
I just like the Idea of getting Automations done in one place with blueprints - as I said already in my other HmIP-BSM Blueprint.
So, I just used, again, 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-KRCA 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-KRCA
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-KRCA Device
description: Please select a HmIP-KRCA (4 button keychain remote control) entity of your Homematic (not Homematic Cloud) integration by typing in the name of the device which was set in your CCU.
action_first_short:
name: Action
description: First Button (top, empty house symbol), Short Press
default: []
selector:
action: {}
action_first_long:
name: Action
description: First Button (top, empty house symbol), Long Press
default: []
selector:
action: {}
action_second_short:
name: Action
description: Second Button (person inside a house-symbol), Short Press
default: []
selector:
action: {}
action_second_long:
name: Action
description: Second Button (person inside a house-symbol), Long Press
default: []
selector:
action: {}
action_third_short:
name: Action
description: Third Button (on-off symbol), Short Press
default: []
selector:
action: {}
action_third_long:
name: Action
description: Third Button (on-off symbol), Long Press
default: []
selector:
action: {}
action_fourth_short:
name: Action
description: Fourth Button (bottom, lightbulb symbol), Short Press
default: []
selector:
action: {}
action_fourth_long:
name: Action
description: Fourth Button (bottom, lightbulb symbol), 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 == 1 and trigger.event.data.param == 'PRESS_SHORT' }}
sequence: !input 'action_second_short'
- conditions:
- condition: template
value_template: >-
{{ trigger.event.data.channel == 1 and trigger.event.data.param == 'PRESS_LONG' }}
sequence: !input 'action_second_long'
- conditions:
- condition: template
value_template: >-
{{ trigger.event.data.channel == 2 and trigger.event.data.param == 'PRESS_SHORT' }}
sequence: !input 'action_first_short'
- conditions:
- condition: template
value_template: >-
{{ trigger.event.data.channel == 2 and trigger.event.data.param == 'PRESS_LONG' }}
sequence: !input 'action_first_long'
- conditions:
- condition: template
value_template: >-
{{ trigger.event.data.channel == 3 and trigger.event.data.param == 'PRESS_SHORT' }}
sequence: !input 'action_fourth_short'
- conditions:
- condition: template
value_template: >-
{{ trigger.event.data.channel == 3 and trigger.event.data.param == 'PRESS_LONG' }}
sequence: !input 'action_fourth_long'
- conditions:
- condition: template
value_template: >-
{{ trigger.event.data.channel == 4 and trigger.event.data.param == 'PRESS_SHORT' }}
sequence: !input 'action_third_short'
- conditions:
- condition: template
value_template: >-
{{ trigger.event.data.channel == 4 and trigger.event.data.param == 'PRESS_LONG' }}
sequence: !input 'action_third_long'
mode: parallel
max: 10
Hope, it’s useful for someone.