home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.65k stars 30.41k forks source link

remote_rpi_gpio Gets upset with port 0 #127255

Open jc508 opened 2 weeks ago

jc508 commented 2 weeks ago

The problem

using port 00 causes the following error to appear in the log. I changed the port to 12 and the problem went away.

What version of Home Assistant Core has the issue?

2024.9.01

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

remote_rpi_gpio

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

# one that fails
binary_sensor:
  - platform: remote_rpi_gpio
    host: localhost
    pull_mode: DOWN
    ports:
    # port                          # pin      wire
      00: Alarm Triggered OUT0      # 27    C3 C-Yellow
      07: Security OFF/ON           # 26    C2 C-White 
      08: PIR Office                # 24    C1 C-Blue  

# one that works
binary_sensor:
  - platform: remote_rpi_gpio
    host: localhost
    pull_mode: DOWN
    ports:
    # port                          # pin      wire
      12: Alarm Triggered OUT0      # 27    C3 C-Yellow
      07: Security OFF/ON           # 26    C2 C-White 
      08: PIR Office                # 24    C1 C-Blue

Anything in the logs that might be useful for us?

2024-10-01 15:48:10.824 ERROR (MainThread) [homeassistant.components.binary_sensor] remote_rpi_gpio: Error on device update!
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/entity_platform.py", line 724, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/entity.py", line 1302, in async_device_update
await hass.async_add_executor_job(self.update)
File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/components/remote_rpi_gpio/binary_sensor.py", line 111, in update
self._state = remote_rpi_gpio.read_input(self._sensor)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/components/remote_rpi_gpio/__init__.py", line 57, in read_input
return sensor.value
^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'value'

Additional information

No response

home-assistant[bot] commented 2 weeks ago

remote_rpi_gpio documentation remote_rpi_gpio source