Homematic Keypress trigger

I am working on some details of my homematic integration. I have following setup:

  • HASS on a RPi 4
  • Raspberrymatic on an ELV RPi3 Kit

All is working fine, but I am trying to build an automation based on a keypress of a HmIP WRCC2 wall button. I do seem to get the keypress in HASS (according to debug log) but the trigger I defined, does not seem to respond to it.
I did find some threads on this topic and tried several things (including creating programs on the Raspberrymatic like in these threads:

But it does not seem to trigger. The relevant log lines:

2020-12-26 09:13:41 DEBUG (Thread-3) [pyhomematic._hm] RPCFunctions.event: interface_id = homeassistant-ip, address = 002C1BE9997B9C:1, value_key = PRESS_SHORT, value = True
2020-12-26 09:13:41 INFO (Thread-3) [pyhomematic.devicetypes.generic] HMGeneric.event: address=002C1BE9997B9C:1, interface_id=homeassistant-ip, key=PRESS_SHORT, value=True

My automation:

alias: New Automation
description: ''
trigger:
  - platform: event
    event_type: homematic.keypress
    event_data:
      name: 002C1BE9997B9C
      channel: 1
      param: PRESS_SHORT
condition: []
action:
  - service: switch.turn_off
    data: {}
    entity_id: switch.licht_baum
mode: single

Anyone any idea what I am doing wrong? I also tried with using names instead of the ID, using my channel names instead of numbers, but it does not seem to trigger…

Dug around a bit more and think I am narrowing it down. I do get the pyhomematic debug messages in the log, but it seems like homeassistant.core is not picking it up. According to the documentation it should look like this:

2018-01-27 11:51:32 INFO (Thread-12) [pyhomematic.devicetypes.generic] HMGeneric.event: address=MEQ1234567:6, interface_id=homeassistant-CCU2, key=PRESS_SHORT, value=True
2018-01-27 11:51:32 INFO (MainThread) [homeassistant.core] Bus:Handling <Event homematic.keypress[L]: param=PRESS_SHORT, name=your_nice_name, channel=6>

So I do get the pyhomematic line, but not the MainThread one. I did set homeassistant.core logging level to debug as well.
Overall the integration does work well, it also updates changed states of entities like motion detection etc. so that seems to be ok. I somehow just cannot “catch the event” so to say.

Anyone with an idea?

The HmIP-WRCC2 device is currently not supported by pyhomematic. It will probably be sufficient to just add it here. But it needs to be verified to be working. In case you can spin up a development environment which allows you to modify the file, feel free to submit a pull request to get the support merged into pyhomematic.

Hmm… I have only started with HASS a couple of week ago and in the meantime managed quite a lot (I think at least) by integrating basically everything in my house, including pv system, full Alexa integration, build my own ELV Kit, Doorbel sensor, actionable notifications and all, but have not worked on pyhomematic development.

I did do coding in the past but am really completely new to these environments so would need some help or guides to get this started.
I mean…the file is pretty easy to read and as you said, the modification probably is only adding one line , but I do not really know where to start that or how the process works…

Have a look at this Wiki article. :+1:

Oh oh…Here I was just a couple of months ago, totally happy with Alexa and a few Wifi Plugs and now…here I am…I have entered the rabbit hole. I was living in this world controlled by predefined apps, which all do their jobs perfectly, but then I have this one idea which does not work: control my AC based on my power generated by my PV System.
And that is where I stumbled upon HASS…now everything is linked, almost no cloud dependencies anymore and yes…a bit of configuration and automations and I am happy again…

And now, here I am…one device (which I actually do not even need that bad, I can just setup a simple program on my Raspberrymatic) does not work. So…what are the options…let it be…and just live with it or…

Well I have already made up my mind…I started down this slippery slope…and setting up a dev environment seems easy enough with all the documentation, so…I will give it a try. If I get stuck somewhere down the path I might send you a message…:wink:

Thanks for pointing me in the right direction.

OK…it actually was easier than I thought. I managed to set up the dev environment, modified the file you mentioned and got it all to work in the dev environment.

HASS then reacts to my keypress so that is good.

Now my next question…how do I submit this change and when could I expect it to get pushed?

EDIT: I think I managed to do so. I modified the file on git and created a commit of the change and a pull request.