Blueprint to easily work with Enocean switches – how to use id of Enocean switch

Hi there, I am setting up a lot of Enocean switches, i.e. the typical EnOcean PTM 215 module based switches such as the FT55 from Eltako. I followed the Enocean guide and created the switches in the configuration.yaml file as:

# EnOcean setup
binary_sensor:
  - platform: enocean
    name: Light Switch
    id: [0xFE,0xF4,0xD0,0x25]
  - platform: enocean
    name: Roller Shutter Switch
    id: [0x00,0x2D,0x5B,0xD4]

I took the blueprint SmartHomeForDummies/HA_Blueprint_EnOcean_Eltako_FT55_DE.yaml and could get to work everything. Now I am trying to create my own blueprint and to adopt the work of SmartHomeForDummies for my use case (I need to control a lot of roller shutters, so I want to simplify it).

Now my issue is, that I do not know how to access the hex id defined as id: [0x00,0x2D,0x5B,0xD4] of the switch to be used in a button pressed event. The original blueprint requires it to be entered manually, but I would want to select an entity in the blueprint (such as “Light Switch” or “Roller Shutter Switch”) and the get to the hex id from configuration.yaml

My blueprint looks as follows (I added the important parts):

blueprint:
  name: Enocean Switch (bee)
  description: "Enocean Switch - 4 Button Pressed Events"
  domain: automation
  author: bee
  input:
    eno_switch:
      name: Enocean Switch
      selector:
        entity:
          filter:
            - integration: enocean

    button_top_left_push:
      name: Button 1
      description: Action Button 1 Press (top left)
      default: []
      selector:
        action: {}
... other buttons
trigger:
  - platform: event
    event_type: button_pressed
    event_data:
      id: !input "{{ eno_switch.id }}"

Obviously id: !input "{{ eno_switch.id }}" does not work. Anybody has a clue on how to do this?

Thanks, Bernd

You shouldn’t need to mess with that id at all? As your template entities converts whatever weirdness the EnOcean integration does inte a binary_sensor, should you not simply use a state trigger…?

triggers:
  - trigger: state
    entity_id: !input eno_switch

If that is not sufficient, I am afraid it probably isn’t possible, hence why the other blueprint you saw required the id to be entered manually. The event_data section is only allowed limited templates, so you cannot read a state attribute from an entity.