First, start logging enocean message :
logger:
default: error
logs:
homeassistant.components.enocean: debug
Then, press a button of your wall switch.
In the log you’ll have something like:
2021-10-18 11:44:09 DEBUG (Thread-3) [homeassistant.components.enocean.dongle] Received radio packet: FE:F0:75:70->FF:FF:FF:FF (-70 dBm): 0x01 [‘0xf6’, ‘0x0’, ‘0xfe’, ‘0xf0’, ‘0x75’, ‘0x70’, ‘0x20’] [‘0x0’, ‘0xff’, ‘0xff’, ‘0xff’, ‘0xff’, ‘0x46’, ‘0x0’] OrderedDict()
2021-10-18 11:44:10 DEBUG (Thread-3) [homeassistant.components.enocean.dongle] Received radio packet: FF:E8:0D:09->FF:FF:FF:FF (-70 dBm): 0x01 [‘0xf6’, ‘0x50’, ‘0xff’, ‘0xe8’, ‘0xd’, ‘0x9’, ‘0x30’] [‘0x0’, ‘0xff’, ‘0xff’, ‘0xff’, ‘0xff’, ‘0x46’, ‘0x0’] OrderedDict()
The id is FE:F0:75:70
,indeed the second message is the callback from my Eltako gateway confirming reception.
Then, add a binary sensor:
binary_sensor:
- platform: enocean
id: [0xFF,0xF0,0x75,0x70]
name: Bathroom switch
And finally an automation to do something when the switch is pressed:
- id: '1634550680537'
alias: Bathroom switch
description: ''
trigger:
- platform: event
event_type: button_pressed
event_data:
id:
- 254
- 240
- 117
- 112
pushed: 0
condition: []
action:
- service: '{% if trigger.event.data.onoff %} switch.turn_off {% else %} switch.turn_on
{%endif %}'
data:
entity_id: switch.tz3000_pnzfdr9y_ts0101_fab024fe_on_off
mode: single