Adafruit AM2302 (wired DHT22) with remote_rpi_gpio

Hello - long time HA user, first time poster - hoping you all can help me with a new project…

I run HA via docker (the official image). I have a raspberry pi 3B with a few DHT22 Temperature/Humidity sensors elsewhere on my network. I want to add those DHT22 sensors, connected to my pi to HA via remote_rpi_gpio - is that something I should be able to do?

It looks like most people use this integration with the GPIOs as switches/relays. Is there anything special in my config (my HA configuration.yaml OR on my pi) that I would need to do so that HA can see those as (dual, i.e. temperature + humidity) sensors?

my setup to test this is pretty straight forward:

binary_sensor:
  - platform: remote_rpi_gpio
    host: 172.17.0.210
    ports:
      22: Environment1
      23: Environment2

From the logs, I would say it looks like it is expecting a switch…

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 292, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 461, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/remote_rpi_gpio/binary_sensor.py", line 104, in update
    self._state = remote_rpi_gpio.read_input(self._button)
  File "/usr/src/homeassistant/homeassistant/components/remote_rpi_gpio/__init__.py", line 63, in read_input
    return button.is_pressed
AttributeError: 'NoneType' object has no attribute 'is_pressed'

Any thoughts would be appreciated!

From the docs, both rPi’s need to be set up for this to work.

Instructions here :

https://www.home-assistant.io/integrations/remote_rpi_gpio/

Thanks for the reply! I have set this up on both sides. I added the “binary sensor” config above to my configuration.yaml file and enabled remote GPIO on the rpi per the docs that are linked to in the HA integration instructions.

Any other thoughts?

Not sure if this applies to your docker setup or not :thinking:

A bit late, I’ve seen this topic before, worked with it, but later realized a binary sensor is a 0 1 sensor. So temperature/humidity sensors can’t be used this way. My solution was to perform a script call from HA to the remote Pi to read the values from the sensor. I just created an account here, will start to be more active, not only leeching.

1 Like

@NeNuntiumNecare
I’m fairly new to this. So, if you could expand on how you got the analog sensor in to your home assistant from the remote Pi (or even some code) it would be greatly appreciated. Thanks

1 Like