Homematic wired keypress

Hi,

i’am running hass.io and raspberrymatic with multiple HM wired devices (HMW-IO-12-Sw7-DR).

Is it possible to monitor the hardware switches connected to the wired devices? I’ve tried it with the following automation but with no luck:

- alias: wired test automation
  trigger:
platform: event
event_type: homematic.keypress
event_data:
  name: OEQ0482399
  channel: 4
  param: PRESS_SHORT
  action:
- service: switch.turn_on
  data:
    entity_id: 
    - switch.OEQ0482399:17

The switches should appear as switch-entities in HA. What you are doing is monitoring events, which applies to sensor-like devices.
Your device has been implemented only by reading the specification. So it might actually not work as intended. But at least our best guess was, that the channels 13-19 use the STATE parameter, which all typical switches use as well. So it all boils down to use the switch-entities and monitor their state (platform: state).

Thanks for the info.

My intend was that if i push a hardware switch that is connected to the inputs of the wired device i can start a scene or something else.

Are there any plans to integrate the inputs as sensor devices?

I think I didn’t phrase it correctly. What I have meant was, that the switch-channels are already implemented. It could be a sensor, a switch, cover, anything that makes sense for Home Assistant. Which for your device is the switch entity type. And this entity type has a so called state, which you can monitor in automations by using platform: state. When doing that the automation will fire as soon as the state of the switch changes (to either on or off).

So an automation could look something like this:

- alias: "Turn off switch if it has been on for 1 hour"
  trigger:
    platform: state
    entity_id: switch.meq1234567
    to: 'on'
    for:
      hours: 1
  action:
    service: switch.turn_off
    entity_id: switch.meq1234567

You should have entities like switch.oeq1234567_17, where the appended _17 corresponds to the channel that can be controlled. At least that’s how I remember it. Could have changed slightly.