Using 12v remote with gpio to add keyfob to automations

So here is the idea, using [This Device](Solidremote 12V - 24V Secure Wireless RF Remote Control Relay Switch Universal 2-Channel 433Mhz Receiver with 2 FCC ID Transmitters for Garage Door Openers, Cars, LED Lights & More (KIT-1) to add a input to do various things.

For example, click 1 to unlock entity lock.front_door and click 2 to lock that same entity. My question is how to set this up with the GPIO header on rpi3. I know the configuration.yaml add in but I’m not sure what options I need to add to make this work.

I do it by connecting the relays to one of the gpio and the ground on the pi. I can then read whether the relay is open or closed using this.

  - platform: rpi_gpio
      17: relay1
      22: relay2
    pull_mode: "DOWN"