Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stopped working / Entities unavailable after update #343

Open
mpikosdimitris opened this issue Jan 18, 2025 · 5 comments
Open

Stopped working / Entities unavailable after update #343

mpikosdimitris opened this issue Jan 18, 2025 · 5 comments

Comments

@mpikosdimitris
Copy link

mpikosdimitris commented Jan 18, 2025

Hello,

i was using the integration with older versions and this is because when i tried to update to 2024.x.x some months ago, i couldn't make the integration to work again. Today i tried to update again and if something went wrong i would do rollback to the previous version but i cound't make it. I'm using a RPi4 and i have a fan connected to pins 4-6-8 (GPIO 14) and this is my setup in configuration.yaml . My entities in version 2024.12.1 are unavailable and in version 2024.12.2 are missing. This is my setup :

HA Core 2025.1.2

binary_sensor:
  - platform: rpi_gpio
    sensors:
      - port: 14
        name: "RPi4 FAN"

switch:
  - platform: rpi_gpio
    switches:
      - port: 14
        name: "RPi4 Fan"

My previous setup was like :

switch:
  - platform: rpi_gpio
    ports:
       14: RPi4 FAN

but even with a rollback i can't make it to work again. Any suggestions please ?

@tomer-w
Copy link
Collaborator

tomer-w commented Jan 19, 2025

Hi @mpikosdimitris , sorry for your experience.
With regards to the rollback to old version, I have no idea what is wrong. You will need to provide logs as described in the end of our GitHub page. It should work as the integration don't have any long term memory.

With regards to the new version, this is easier. You don't need both binary_sensor and switch. You should just keep the switch one. Don't forget to restart after you change the configuration file. This will solve the problem. If not, we will need to get the logs to understand the exact situation.

@mpikosdimitris
Copy link
Author

Thanks for your reply @tomer-w , i do a restart every time i change something in my cofniguration, also tried to reboot my RPi4 with no luck. Finaly i removed the binary_sensor and rpi_gpio: and path: /dev/gpiochip0 below my default_config: and with version 2024.12.2 the switch entity is missing in integrations page :

Image

rolling back to version 2024.12.1 entity comes back :

Image

but the status is Unavailable :

Image

after that i tried to delete the entity , restart HA , the entity comes back but now i'm facing a new problem...when i trigger the switch i get this error :

Image

here is my debig log

2025-01-20 00:26:08.791 DEBUG (Dummy-1) [custom_components.rpi_gpio.hub] in turn_on 14
2025-01-20 00:26:08.792 ERROR (Dummy-1) [homeassistant.components.websocket_api.http.connection] [2854125608] Unexpected exception
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 245, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<7 lines>...
    )
    ^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2795, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2838, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1006, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
        hass, entity, func, data, call.context
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1078, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/rpi_gpio/switch.py", line 102, in async_turn_on
    self._hub.turn_on(self._port)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/config/custom_components/rpi_gpio/hub.py", line 172, in turn_on
    self._lines.set_value(port, Value.ACTIVE)
    ^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'set_value'
2025-01-20 00:26:10.864 DEBUG (Dummy-1) [custom_components.rpi_gpio.hub] in turn_off 14
2025-01-20 00:26:10.865 ERROR (Dummy-1) [homeassistant.components.websocket_api.http.connection] [2854125608] Unexpected exception
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 245, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<7 lines>...
    )
    ^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2795, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2838, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1006, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
        hass, entity, func, data, call.context
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1078, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/rpi_gpio/switch.py", line 107, in async_turn_off
    self._hub.turn_off(self._port)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/config/custom_components/rpi_gpio/hub.py", line 177, in turn_off
    self._lines.set_value(port, Value.INACTIVE)
    ^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'set_value'

revert back to version 2024.12.2 and again the entity is missing again...

@jocjocde
Copy link

I Have the same problem.

Image

@tomer-w
Copy link
Collaborator

tomer-w commented Jan 20, 2025 via email

@jocjocde
Copy link

jocjocde commented Jan 20, 2025

I will need the debug logs as described here: https://github.com/thecode/ha-rpi_gpio?tab=readme-ov-file#reporting-issues
It should be the full logs from after you restart HA. The initialization part is the most important part.
Please note is be should be from the largest version of the integration. This is the only version we keep updating.

I turned on the debug and then restarted.
Attached the debug file.

Thanks

home-assistant_rpi_gpio_2025-01-20T15-49-23.740Z.log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants