RPI-GPIO Integration

Hi, I updated to Home Assistant version * Core2024.2.1

  • Supervisor2024.01.1
  • Operating System11.5

Using HACS I’ve tried to get rpi-gpio integration to work, but the only entity that I manage to get visible is “Raspberry Pi GPIO update”. Not the actual rpi-gpio integration.
I would like to build automation based on that can’t figure out how to make this entity visible (if entity is the right term here). This is a little frustrating as I had been using this integration since the core support was dropped 2022, but now don’t seem to be able to make it work after update to latest HASSIO version.
Any help as what I’m missing here would be appreciated.

Edit 240229: Eventually I found out that something was wrong with my HomeAssistant installation. Probably had broken the configuration files myself as I could not save any automations whatsoever. Did a clean install and now everything seems to work. Meanwhile moved from HACS to MQTT to get the job done (and tried ESP32 in between :slight_smile:). I believe my struggle with HACS was due broken installation of HomeAssistant, not with HACS itself. Thanks for everyone for your kind support.

I haven’t used HACS, but the source is at GitHub - thecode/ha-rpi_gpio: Home Assistant Raspberry Pi GPIO Integration.

which is the place to ask!

OK thanks, I thought that maybe someone else is having the same issue that’s why asked here. But will try directly from the source. In GitHub someone was reporting a bit similar issue https://github.com/thecode/ha-rpi_gpio/issues/231 but the developer didn’t think there was anything broken.
Thank you for your replies.

And asked you to revert and see if it still works, and you didn’t bother replying.

Wasn’t me. That bug was raised by another person. I just referred to that one. Be nice.

Sorry, my mistake. But you could follow the suggestion and contribute to that thread.

Eventually I went back to HACS and rpi_gpio integration as it felt foolish to have two Rpis next to each other communicating using MQTT while all I wanted was set and observe couple of Rpi GPIO pins! (MQTT though seems to work OK). I thought to share as it took me some time and effort so may be of help to someone.

Here is how I got my simple set-up controlling the alarm system work (basically setting two Rpi GPIO pins and reading one. Once the one that I’m reading goes high it will send me a Telegram message (alarm). That’s the automation. Some of the re-starts might not be needed but most of the are :-).

• Installed SSH: http://homeassistant.local:8123/hassio/addon/a0d7b954_ssh/info
re-start HA
• Home assistant Add-on: File editor added (Add On from settings) for editing configuration.yaml
re-start HA
• Installed HACS as described below:
○ Download HACS: Download | HACS
○ First ssh to your raspberry pi and run this command from command line:
$wget -O - https://get.hacs.xyz | bash -
re-start HA
○ Then follow the configuration instructions from here:
§ Initial Configuration | HACS
re-start HA
• Install rpi_gpio from HACS (and to see the integrations use the search function at the top of HACS panel, not the integrations from the settings)!
GitHub - thecode/ha-rpi_gpio: Home Assistant Raspberry Pi GPIO Integration
re-start HA
• Installed telegram add-on
re-start HA

Use file editor to edit your ‘configuration.yaml’. Here’s what I’ve got.
Configuration.yaml

Configuration.yaml entry

binary_sensor:
  -platform: rpi_gpio
    sensors:
      - port: 24
        name: "Gripo Alarm sensor"
        unique_id: "gripo_alarm_port_24"
        bouncetime: 50
        invert_logic: false
        pull_mode: "DOWN"

switch:
  - platform: rpi_gpio
    switches:
      - port: 9
        name: "Gripo Alarm switch"
        unique_id: "gripo_alarm_switch_9"
      - port: 10
        name: "Gripo Arm switch"
        unique_id: "gripo_arm_switch_10"


telegram_bot:
  - platform: polling
    api_key: "Here your secret key"
    allowed_chat_ids:
      - 123456789 (here your chat ID)

notify:
  - platform: telegram
    name: "my_home"
    chat_id: 123456789 (here your chat id)

Save the ‘configuration.yaml’ and re-start HA.

Then create automation by using the ‘platform’ that we just configured as ‘rpi_gpio’. It will appear as an ‘Entity’ in the list …

Settings - Automations & Scenes - Create Automation - Create New Automation - ‘Add Trigger’ - ‘Entity’ - ‘When Something Changes State or any attributes’ and select from the list the sensor you just created in configuration.yaml. In my case the automation triggers when the sensor goes ‘On’. Then send a notification by using telegram notification platform that was created above.

1 Like

Same issue here:

Logger: homeassistant.components.binary_sensor
Quelle: helpers/entity_platform.py:356
Integration: Binärsensor (Dokumentation, Probleme)
Error while setting up rpi_gpio platform for binary_sensor
[…]
RuntimeError: Failed to add edge detection

See: