Open lock for 1 second

Hello everyone,

Currently I control a lock over a remote pi zero-W the 3.3V opens a relais, which in turn opens the 5V lock.
Currently this is a switch, so the lock stays open until I close it, however the lock can only be opened for under a second, so I fried the lock.

Any suggestions on how to make the lock open for only 1 second?

Currently this is in the lovelace card:
show_name: true
show_icon: true
type: button
tap_action:
action: toggle
entity: switch.lock_state
icon: mdi:lock-open
icon_height: 48px
name: Open door

This is the actual code I use:

GPIO-Doorlock-control

switch:

  • platform: remote_rpi_gpio

    host: 192.168.1.#

    ports:

    12: Door Lock

    6: Lock State

C’mon no one ? :frowning:

You can go with an automation. As trigger use the open state of the lock. As condition use a timespan from 1 second. As action set the state of the lock again to locked.

Currently i am not at home to give you an exact example how to set this up.

If more help is needed i can show you when i’m home again.

Ng