Relay control from home assistant

Dear forum
I have just started working with home assistant on a rasberry pi 4 it has managed to add sensors with integrations but want to start building controls but how do the control the gio pins in home assistant for relays or a usb relay and what hardware can work together with home assistant
Greetings jurgen

I have github but how does that irrigation work thanks for the quick response I had read that but just started and still understand those hence the question

Dear forum
Is this relay board suitable for a raspberrypi 4 and home assistant
Greetings jurgen

Hi @Jurgen2003, have you heard of ESPHome, it’s for programming ESP8266/ESP32’s and more for whatever purpose you like, be it sensors, relays, lights and many more.

Thanks I’m going to look into that
So a relias board on the. Giopinnn can so also with that

From what I’ve seen searching, it’s possible, but unwise due to change of state during pi booting etc.

The rasberry stays running in a home assistant situation toxh continuously but what is a better plan a usb relay or ethernet relay or wifi

Dear forum
I am trying to understand how home assistant sends a relay. With some searching I find that this is about a start but it does not work
Via studio code server I added the conguration yml this
What am I doing wrong
Can anyone help
It is the relias on the gio pins.

Loads default set of integrations. Do not remove.

default_config:

Load frontend themes from the themes folder

frontend:
themes: !include_dir_merge_named themes

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
switches:

  • platform: rpi_gpio
    switches:
    • port: 21
      name: “CM4 relay1”
    • port: 22
      name: “CM4 relay2”
    • port: 23
      name: “CM4 relay3”
    • port: 27
      name: “CM4 relay4”
    • port: 24
      name: “CM4 relay5”
    • port: 28
      name: “CM4 relay6”
    • port: 29
      name: “CM4 relay7”
    • port: 25
      name: “CM4 relay8”

Did you install the custom integration I linked above? The configuration won’t do anything if the integration doesn’t exist.

Through hacs I downloaded the integration that was understandable , but I don’t understand it anymore

Dear forum
it worked the relay switches but relay is switched on at position off and on in home assisntent it switches off is this normal it is a changeover contact so doesn’t make much difference but it was noticeable
greetings jurgen