Skip to content

ValueError: (22, 'Invalid argument' #4

Description

@JiriPrchal

Hi, I've got a problem, I'm trying to set up IO on https://edatec.cn/docs/ipc3630/ds/ where it is on gpiochip14.
My config:

binary_sensor:
 - platform: gpio
   sensors:
    - port: 1
      device: "/dev/gpiochip14"
      name: "OVP"

Log:

2025-11-20 10:48:40.881 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up gpio platform for binary_sensor: (22, 'Invalid argument')
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.13/site-packages/homeassistant/helpers/entity_platform.py", line 451, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/etc/homeassistant/custom_components/gpio/binary_sensor.py", line 77, in setup_platform
    sensors = [GPIOBinarySensor(sensor[CONF_NAME],
               ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
                                sensor[CONF_DEVICE],
                                ^^^^^^^^^^^^^^^^^^^^
    ...<3 lines>...
                                sensor[CONF_INVERT_LOGIC],
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^
                                sensor.get(CONF_UNIQUE_ID))
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/etc/homeassistant/custom_components/gpio/binary_sensor.py", line 112, in __init__
    enable_edge_detect(self._line, "BOTH", self._bouncetime)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/etc/homeassistant/custom_components/gpio/__init__.py", line 90, in enable_edge_detect
    req.reconfigure_lines(
    ~~~~~~~~~~~~~~~~~~~~~^
        {port: LineSettings(edge_detection=getattr(Edge, detect_edges),
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                            debounce_period=datetime.timedelta(milliseconds=debounce_ms))
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         for port in req.lines})
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.13/site-packages/gpiod/line_request.py", line 189, in reconfigure_lines
    cast(_ext.Request, self._req).reconfigure_lines(line_cfg)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
ValueError: (22, 'Invalid argument')

Command line gpiod works fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions