Rpi GPIO not working

Have a whole lot of switches on the rpi_gpio platform and since latest update they are no longer recognized entities.

Is rpi_gpio discontinued and if so what is the replacement to use?

Thanks

Please read the release notes before upgrading.

https://www.home-assistant.io/blog/2022/06/01/release-20226/#farewell-to-the-following

This was first announced last year. There is a third party integration to replace it. You can find it in HACS.

This is the one:

Available in HACS and working fine over here!

Yea thanks, just installed it and working just as expected! Awesome Cheers!

1 Like

HI,

I have installed the third-party addon as mentioned above using HACS. I am now trying to implement a CPU cooling fan using the following code inside the configuration.yaml:

switch:
  - platform: rpi_gpio
    switches:
      - port: 17
        name: "RPI Cooling Fan"

climate:
  - platform: generic_thermostat
    name: RPI Cooling Fan Controller
    heater: switch.rpi_cooling_fan
    target_sensor: sensor.processor_temperature
    min_temp: 45
    max_temp: 80
    ac_mode: true
    target_temp: 50
    cold_tolerance: 0.1
    hot_tolerance: 0.1
    min_cycle_duration:
      seconds: 30
    keep_alive:
      minutes: 5
    initial_hvac_mode: "cool"

I then connect the red wire to the 3v3 pin (board pin 1) and the black wire to GPIO 17 (board pin11), yet the fan does not spin, even when I turn the switch on manually without climate control.

I have also tried reversing the wires as well as connecting the black wire to ground (board pin 9) and the red wire to GPIO 17 with no luck.

The fan does spin when I connect the red wire to 3v3 (board pin 1) and the black wire to ground (board pin 9) yet this obviously means that HA cannot control the fan.

TIA,
Neil

1 Like

Hello all,

I had same problem since latest update.

In my case, I have solved the issue using remote_rpi_gpio pointing to localhost. So, my code change from this:

to:

Using the same pigpio add-on.

1 Like

I have been dead in the water on this situation since the change took place. The only thing I use this for is to monitor power outages on a battery backed up Rpi4 running HA. At this point, I cannot update because of this missing feature, and the inability to make HACS work properly.

I have installed HACS but still cannot make it work. I added the code to /config/custom_components/ha-rpi_gpio-main but still get this

The system cannot restart because the configuration is not valid: Invalid config for [binary_sensor.remote_rpi_gpio]: required key not provided @ data['host']. Got None. (See ?, line ?).

Not very helpful but the HACS apparently doesn’t support Add-ons. Very fscking confusing. Is the rpi_gpio NOT an add-on to HACS?

This is what I added to configuration.yaml originally and it worked:

binary_sensor:
  - platform: rpi_gpio
    ports:    
      18: Home Power Monitor
    pull_mode: DOWN

When adding this code instead, as mentioned above, I get on the badge, “Entity not Found”, but the configuration file passes the acid test.

switch:
  - platform: remote_rpi_gpio
    host: localhost
    ports:
      18: Home Power Monitor

If anyone can shed some light on this to a stupid old man I would gratefully appreciate it. This is the only thread I could find regarding this matter and the info I have gathered has not worked.

I can relate to being frustrated with HA sometimes. I find it helps to walk away for a while, then come back and start at the beginning.

Personally, I gave up on HACS. I found it easier to just follow the manual installation instructions. HACS seems like unnecessary overhead; one more thing to monitor for breaking changes and bugs at every update. I know others will disagree with me on this. Many people use it without issue. Let’s just leave that as a personal preference. But still something you might want to consider.

If you go the manual install route, the files and instructions you need are here.

Next, review your config file. Do you have more than one binary_sensor: line? Could there be a spacing problem or typo somewhere? This is what I use, and it’s been working flawlessly:

binary_sensor:
# ... [other sensors] ...

# GPIO: rpi_gpio platform
  - platform: rpi_gpio
    ports:
      5: Heat Zone 1
      18: Heat Zone 2
      22: Heat Zone 3
      23: Heat Future
      25: Boiler Burner
    invert_logic: true
    bouncetime: 500

Obviously not exactly what you need, but it’s proof that it can work.

Thank you Tom, very much! I did edit my post to remove my signs of frustration. It was late last night and I had been working on this most of the entire day, getting nowhere fast.

It is really good to know that a HACS install is not necessary to make this work. I will attempt to completely remove HACS immediately. I did however do the manual installation, not realizing that HACS was not required with a manual install. The guides are sparse, at best and the dependencies on the cloud via github and API keys is just way too much!

The zip file I downloaded decompressed to a folder named ha-rpi_gpio-main. Originally I just put this into the custom_components folder as it was, but have since renamed it to just rpi-gpio. Not sure if this is right or not, as the documentation does not match the results by any means. I will try this again once I get HACKS (sic) removed and see how it goes.

Again, thank you for clearing up some of this confusion.

Okay, removed HACS (wow, three restarts required to remove it…crazy). I also made another discovery during this process. The problem is the instructions are (kinda) wrong for the manual installation. Originally, following the instructions, I downloaded the .zip file, decompressed and moved it into the custom_components folder. Problem is, this is not the correct folder. INSIDE the ha-rpi_gpio-main folder, which is what the zip file decompresses too, there is a custom_components/rpi-gpio folder. THIS is the folder that needs copied to the /config/custom_components folder. I had blindly followed the instructions to a tee and this created my issue.

All is working again, and without HACS. Thankfully! Thank you again, Tom. HACS is indeed an unneeded addition and this would seem to be something that is intentionally withheld, or rather just not made clear by any means.

How can I add the addon manully?
HACS is also not working for me.

See post #8 in this thread.

1 Like

Thanks a lot!

I get it and i’ve tried several times but i cannot do those commands, im using the Terminal & SSH addon but when i do the comands like “sudo” or “pip” its says to me bash: sudo: command not found

What directions are you reading? Nothing in his posts points to requiring those commands.

I was trying to install the RPi.GPIO addon by itself, but now coping the command from the instalation of hacs solve it all ty

Anybody got a working alternative?
Can’t get the remote GPIO or MQTT IO to work.
I’m currently running version 2023.9.3

the pigpio HACS add on works just fine, I just replaced my dumb RPI fan for a PWM fan and it works fine. The only thing I don’t like is you have to set it up as a light. I’m pretty sure you can set up a template fan in HA that controls it and then it would appear as a fan.

After many hours of struggling with binary sensors, I found that it was hidden and had to be enabled as an entity. Then it works perfectly.

Had to be enabled as an entity? What do you mean? Are we still talking aboit Pi gpio’s?