Homematic Switch - "on for" timer

I’m using a HM-LC-Sw1-Ba-PCB on my garage door, to trigger open/close the garage.

What I need here is a short keypress to start the motor (external switch input like a button) and lift the garage door. If i turn on the switch in the UI, it stays the whole time in status “ON” and i have to turn it off and on again to trigger the motor the second time.

Is it possible to trigger a switch with an on-for timer (got that one in FHEM) to simulate a 1 second keypress of the switch button?

The cleaner solution would be to check if your switch can be configured to work like this on its own. Have a look at the settings with the configuration utility where it looks something like this:

I assume “Verweildauer im Zustand “ein”” would be what you need.

If that doesn’t solve your problem you can use an automation to do this. I have something similar for an MQTT relay switch which looks like this:

- alias: "Türbuzzer aus nach 5 Sekunden"
  trigger:
    platform: state
    entity_id: switch.eingangstuer
    to: 'on'
    for:
      seconds: 5
  action:
    service: switch.turn_off
    entity_id: switch.eingangstuer

The HM-LC-Sw1-BA-PCB does not support that kind of configuration:

So I’m going to use an automation to handle that.

Thx!

I guess I need further help, because I’m not sure where to add your example lines. What I’ve added to my automation.yaml is the following code:

  • alias: “Garagentor betaetigen”
    trigger:
    platform: state
    entity_id: switch.gragentor_rechts
    to: ‘on’
    for:
    seconds: 1
    action:
    service: switch.turn_off
    entity_id: switch.gragentor_rechts

The entity is shown in HASS but not sure what to do with that. If I add that to one of my views and trigger the “button”, nothings happens.

Log file says:

2017-10-30 15:58:23 INFO (MainThread) [homeassistant.components.http] Serving /api/states/automation.garagentor_betaetigen to 192.168.21.1 (auth: True)
2017-10-30 15:58:23 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: new_state=<state automation.garagentor_betaetigen=on; friendly_name=Garagentor betaetigen, last_triggered=2017-10-30T14:32:23.691519+00:00 @ 2017-10-30T15:58:23.231743+01:00>, entity_id=automation.garagentor_betaetigen, old_state=<state automation.garagentor_betaetigen=off; friendly_name=Garagentor betaetigen, last_triggered=2017-10-30T14:32:23.691519+00:00 @ 2017-10-30T15:58:10.850149+01:00>>

You don’t have to do anything with that automation-UI-element. When you turn on the switch (the one you want to automatically turn off again), it should flip back to off a second later automatically. If I understood correctly you only want to trigger the switch for a short time, and everytime it is turned on the garage-motor gets activated.