Help with door sensors and relay

im new to home assistant and i have been trying to find a way to add a switch and 2 sensors using another rpi’s gpio pins i am trying to add 2 of these https://www.ryansouthgate.com/2015/08/10/raspberry-pi-door-sensor/ and i also want to control `a 4chanel relay as
any help wouldbe great

Is the other RPi running Home Assistant?

Continuing the discussion from Help with door sensors and relay:

i have one with hassio installed this will be places in the data cabinet and i have rpi to place in the garage it has raspbian on it the now

For the RPi in the garage, you simply need an application that monitors the GPIO pins and publishes their states to an MQTT topic. The application also subscribes to MQTT topics that are used to control GPIO pins. This “application” I’m describing comes in many forms and you’ll have to decide which one is best suited for your needs. Here are a few resources to investigate:

http://www.steves-internet-guide.com/mqtt-raspberry-pi-gpio/

Once you’ve selected, installed, and tested the preferred application, you can create MQTT Switch, Binary Sensor, Sensor, etc entities in Home Assistant that publish/subscribe to the topics created by the application running on the RPi in the garage.

thank you i will it it a go