After HA Core update to 0.115 I have just lost my MCP23017 Expander for both: sensor and switch.
Example of config (the same setting was working perfect on previous version)
configuration.yaml
binary_sensor:
platform: mcp23017
i2c_address: 0x22
pins:
0: MCP_IN 8
#Switches
switch:
platform: mcp23017
i2c_address: 0x20
pins:
0: MCP 8
Logger: homeassistant.components.binary_sensor
Source: components/mcp23017/binary_sensor.py:48
Integration: Sensor binarny (documentation, issues)
First occurred: 20:26:30 (2 occurrences)
Last logged: 20:26:30
Error while setting up mcp23017 platform for binary_sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 193, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/mcp23017/binary_sensor.py", line 48, in setup_platform
i2c = busio.I2C(board.SCL, board.SDA)
File "/usr/local/lib/python3.8/site-packages/busio.py", line 18, in __init__
self.init(scl, sda, frequency)
File "/usr/local/lib/python3.8/site-packages/busio.py", line 38, in init
from microcontroller.pin import i2cPorts
File "/usr/local/lib/python3.8/site-packages/microcontroller/__init__.py", line 29, in <module>
elif chip_id == ap_chip.STM32:
AttributeError: module 'adafruit_platformdetect.constants.chips' has no attribute 'STM32'
====
Logger: homeassistant.components.switch
Source: components/mcp23017/switch.py:41
Integration: Prze艂膮cznik (documentation, issues)
First occurred: 20:26:30 (2 occurrences)
Last logged: 20:26:30
Error while setting up mcp23017 platform for switch
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 193, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/mcp23017/switch.py", line 41, in setup_platform
i2c = busio.I2C(board.SCL, board.SDA)
File "/usr/local/lib/python3.8/site-packages/busio.py", line 18, in __init__
self.init(scl, sda, frequency)
File "/usr/local/lib/python3.8/site-packages/busio.py", line 38, in init
from microcontroller.pin import i2cPorts
File "/usr/local/lib/python3.8/site-packages/microcontroller/__init__.py", line 29, in <module>
elif chip_id == ap_chip.STM32:
AttributeError: module 'adafruit_platformdetect.constants.chips' has no attribute 'STM32'
Hey there @jardiamj, mind taking a look at this issue as its been labeled with an integration (mcp23017
) you are listed as a codeowner for? Thanks!
(message by CodeOwnersMention)
this may be the cause https://github.com/adafruit/Adafruit_Python_PlatformDetect/releases/tag/2.16.0
@mmatloka
Thank you for the hint but it looks it doesn't work as Adafruit-PlatformDetect already installed.
sudo pip3 install Adafruit-PlatformDetect
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: Adafruit-PlatformDetect in /usr/local/lib/python3.7/dist-packages (2.15.0)
I have the same problem, generally it seems that some dependency got upgraded and broke this component, but I don't see which one and why.
Same here. Do you think the HA downgrade will help?
Yes downgrade to 0.114.4 did the trick. MCP23017 works as before upgrade.
same issue... any one tried to enable de i2c again?
Fix it by downgrading Adafruit-PlatformDetect manually:
Fix it by downgrading Adafruit-PlatformDetect manually:
- docker exec -it homeassistant bash
- pip3 install Adafruit-PlatformDetect==2.15.0
- exit
- docker commit homeassistant homeassistant/raspberrypi4-homeassistant:0.115.2
- Restart Homeassistant Server
I'm running rpi4 hassOS.. How do I do it? Can you help?
I have a mcp23017 board (made myself) to control my home alarm (pir and siren) by wire... It is important for me... Stop work when 115 update...
How can I downgrade Adafruit-PlatformDetect manually in hassOS?
Thanks
Fix it by downgrading Adafruit-PlatformDetect manually:
- docker exec -it homeassistant bash
- pip3 install Adafruit-PlatformDetect==2.15.0
- exit
- docker commit homeassistant homeassistant/raspberrypi4-homeassistant:
- Restart Homeassistant Server (or the whole PI is it doesn't work)
I'm running rpi4 hassOS.. How do I do it? Can you help?
I have a mcp23017 board (made myself) to control my home alarm (pir and siren) by wire... It is important for me... Stop work when 115 update...
How can I downgrade Adafruit-PlatformDetect manually in hassOS?
Thanks
Oh sorry, I think I should have mentioned that you need SSH access to your rpi4. See if you can get that working and your steps would be:
Should be plenty of tutorials on getting SSH access. But also, I would recommend to begin snapshotting before you upgrade hass so you can do a rollback.
Have the same problem.
Rolled back to 0.114.4 and MCP23017 is working OK.
I cannot downgrade. I hope for a quick fix. I would need it otherwise I have to rewrite many automations.
is it known what commit caused this issue?
@fraygon
I cannot downgrade. I hope for a quick fix. I would need it otherwise I have to rewrite many automations.
I was afraid of downgrading procedure but (at least for HassOS) it was as easy as going to terminal and issuing command:
ha core update --version 0.114.4
few mintues later after reboot all was working fine.
@fraygon
I cannot downgrade. I hope for a quick fix. I would need it otherwise I have to rewrite many automations.
I was afraid of downgrading procedure but (at least for HassOS) it was as easy as going to terminal and issuing command:
ha core update --version 0.114.4
few mintues later after reboot all was working fine.
Thank you... A lot... It's so easy 馃槑... Already done it.
Everything ok right now.
So.. Anyone knows if there will be an update with this integration solved?
I wouldn't like to be stuck in 114.4
Thanks everyone...
I think we got stuck with version 114.4 :(
I think we got stuck with version 114.4 :(
Why you think so ? I trust it will be fixed soon.
Another question is if the issue is related to integration which is part of core system or not. With this question I wonder if the custom component: https://github.com/jardiamj/homeassistant/blob/master/custom_components/README.md will work with 115.x or not ?
I want to do a new, clean installation of Home Assistant, please tell me what version of HassOS should I install so that the MCP23017 extender works for me?
For me and few others it works on 0.114.4
Problems started with 0.115
Anyone tried the new version 116.?
Can the 116 version solve the mcp23017 problem?
Anyone tried the new version 116.?
Can the 116 version solve the mcp23017 problem?
No. I update... Still the same problem... :(
This seems to be due to changes to the Adafruit's PlatformDetect module that created compatibility issues with the Adafruit_Blinka module. It looks like this has been fixed in the latest release of Adafruit_Blinka (https://github.com/adafruit/Adafruit_Blinka/pull/339).
I believe that bumping Adafruit_Blinka to the latest release should fix the issue but I haven't tested it; will do so as soon as I can.
@jardiamj please take a look at linked issue #41250 where I've proposed the complete removal of blinka from the manifest (it is indirectly referenced through other components). Hope this helps!
Has someone managed to fix this problem?
I don't no what to do... I'm a new user and can't help.
I have some hardware stuck with this problem..
Can anyone say what can I do to help?
I would like to contribute... But I don't know how..
@gugaspinto - I believe the only way is to downgrade to version 0.114.4 - it is extremely easy if you are using HassOS ( with Terminal & SSH Add-on you go to terminal and do:ha core update --version 0.114.4
). few minutes later after reboot all was working fine.
And I am happy to see some activities to fix the issue so hopefully soon it will be part of another version. :)
I went back to version 0.114.4 and I have this error now:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 184, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/mcp23017/switch.py", line 41, in setup_platform
i2c = busio.I2C(board.SCL, board.SDA)
File "/usr/local/lib/python3.8/site-packages/busio.py", line 18, in __init__
self.init(scl, sda, frequency)
File "/usr/local/lib/python3.8/site-packages/busio.py", line 47, in init
raise ValueError(
ValueError: No Hardware I2C on (scl,sda)=(3, 2)
Valid I2C ports: ((3, 3, 2), (1, 3, 2), (0, 1, 0))
Can I ask for a hint about the problem?
I have 0.114.4 working well.
I tried 0.116.4 and there is no good news yet.... lets wait.
Downgraded again
As much as I understand until this request https://github.com/home-assistant/core/pull/41768 will be open (or will go into next release) our issue will not change.
@Maco65 correct, however you can also downgrade Adafruit-PlatformDetect
to version 2.18.0 which is the last known version working with adafruit-blinka
version 3.9.0. Upgrading adafruit-blinka
to the latest version would resolve this issue however its version is unfortunately pinned by this component, so it is not possible until my PR is merged.
I'm not familiar with hassio itself but normally you would issue the following pip command in the python environment to downgrade:
pip install Adafruit-PlatformDetect==2.18.0 --force-reinstall
thanks for the PR @belidzs !
Thanks @belidzs
I trust your PR was merged and implemented in supervisor 0.117.0.
Unfortunately MC23017 still is not working. Have the following logs:
For binary sensor:
Logger: homeassistant.components.binary_sensor
Source: components/mcp23017/binary_sensor.py:44
Integration: Binary Sensor (documentation, issues)
First occurred: 08:11:22 (1 occurrences)
Last logged: 08:11:22
Error while setting up mcp23017 platform for binary_sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 197, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/mcp23017/binary_sensor.py", line 44, in setup_platform
i2c = busio.I2C(board.SCL, board.SDA)
File "/usr/local/lib/python3.8/site-packages/busio.py", line 19, in __init__
self.init(scl, sda, frequency)
File "/usr/local/lib/python3.8/site-packages/busio.py", line 39, in init
from microcontroller.pin import i2cPorts
File "/usr/local/lib/python3.8/site-packages/microcontroller/__init__.py", line 29, in <module>
elif chip_id == ap_chip.STM32:
AttributeError: module 'adafruit_platformdetect.constants.chips' has no attribute 'STM32'
and for switch:
```Logger: homeassistant.components.switch
Source: components/mcp23017/switch.py:37
Integration: Switch (documentation, issues)
First occurred: 08:11:25 (1 occurrences)
Last logged: 08:11:25
Error while setting up mcp23017 platform for switch
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 197, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(self.args, *self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/mcp23017/switch.py", line 37, in setup_platform
i2c = busio.I2C(board.SCL, board.SDA)
File "/usr/local/lib/python3.8/site-packages/busio.py", line 19, in __init__
self.init(scl, sda, frequency)
File "/usr/local/lib/python3.8/site-packages/busio.py", line 39, in init
from microcontroller.pin import i2cPorts
File "/usr/local/lib/python3.8/site-packages/microcontroller/__init__.py", line 29, in
elif chip_id == ap_chip.STM32:
AttributeError: module 'adafruit_platformdetect.constants.chips' has no attribute 'STM32'
```
I am going back to 0.114.4 as I need my sensors and switches working and looking forward for solution suggestion.
I am also afraid that in my installation (HassOS 4.15) the command you suggested for downgrading adafruit-blinka
is not working (at listpip
is not working in the terminal add-on
I am running the beta 117.0b5 by 4 days and everything ok.
Now I'm updating to stable 117.0
In a few minutes I'll give feedback.
Thanks everyone.
@Maco65 I'm not familiar with HassOS, but all that my PR does is that it removes dependency on a specific version of adafruit-blinka
which was causing issues and was also unnecessary. This means that a new install of home-assistant (and pip) will just install the latest versions of the related libraries which are known to work together well.
However if your pip environment is already in a bad state, you might have to manually resolve it using pip. Again, I unfortunately don't know HassOS but if you manage to find out how to run pip in homeassistant's environment, running the command below should fix your issue:
pip install --upgrade adafruit-blinka adafruit-platformdetect
Here... With stable 117.0 everything ok
MCP23017 fine...
馃憣馃憣
Running HAssOS 4.15
Supervisor 2020.10.0
HA core 0.117.0
@belidzs @gugaspinto - THANK YOU.
I have tried one more time and this time I have rebooted the host and now it works !!! :) :) :)
btw it seems that by nature in HAssOS (run in docker) there is no simple (or not al all) way to run pip
...
Most helpful comment
@gugaspinto - I believe the only way is to downgrade to version 0.114.4 - it is extremely easy if you are using HassOS ( with Terminal & SSH Add-on you go to terminal and do:
ha core update --version 0.114.4
). few minutes later after reboot all was working fine.And I am happy to see some activities to fix the issue so hopefully soon it will be part of another version. :)