2025.5 upstream deprecation: `AttributeError: 'HomeAssistant' object has no attribute 'helpers'`
Logger: homeassistant.setup
Source: setup.py:426
First occurred: 10:59:45 PM (1 occurrence)
Last logged: 10:59:45 PM
Error during setup of component smartthings: 'HomeAssistant' object has no attribute 'helpers'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 426, in _async_setup_component
result = await task
^^^^^^^^^^
File "/config/custom_components/smartthings/__init__.py", line 57, in async_setup
await setup_smartapp_endpoint(hass)
File "/config/custom_components/smartthings/smartapp.py", line 212, in setup_smartapp_endpoint
store = hass.helpers.storage.Store(STORAGE_VERSION, STORAGE_KEY)
^^^^^^^^^^^^
AttributeError: 'HomeAssistant' object has no attribute 'helpers'
Workaround: Downgrade to 2025.4
See also: https://github.com/rospogrigio/localtuya/issues/1977
GitHub Etiquette
- Please use the 👍 reaction to show that you are affected by the same issue. (?)
- Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue. (?)
- Subscribe to receive notifications on new comments, or get notified of resolution with 'Status' (?).
">>This current integration is not being updated, only fixed if HA update breaks it!<<" Aaaand an update broke it. @veista is this something fixable - are you looking into this?
Same problem, if it is not resolved I will have to return to the standard
On line 25 in smartapp.py , add , cloud at the end. You should get this:
from homeassistant.components import webhook, cloud
After line 32 add
from homeassistant.helpers.storage import Store
So you'll get this:
from homeassistant.helpers.dispatcher import (
async_dispatcher_connect,
async_dispatcher_send,
) # <-- This is line 32
from homeassistant.helpers.storage import Store # <-- add this
from homeassistant.helpers.network import NoURLAvailableError, get_url
from .const import (
Now line 97 (was 96), change it from
if hass.components.cloud.async_active_subscription():
to
if cloud.async_active_subscription(hass):
So you should have this:
def validate_webhook_requirements(hass: HomeAssistant) -> bool:
"""Ensure Home Assistant is setup properly to receive webhooks."""
if cloud.async_active_subscription(hass): # <--- here is the change to now line 97.
return True
if hass.data[DOMAIN][CONF_CLOUDHOOK_URL] is not None:
return True
return get_webhook_url(hass).lower().startswith("https://")
Now line 213 (was line 212 before the addition, Change from
store = hass.helpers.storage.Store(STORAGE_VERSION, STORAGE_KEY)
to
store = Store(hass, STORAGE_VERSION, STORAGE_KEY)
You should have:
# Get/create config to store a unique id for this hass instance.
store = Store(hass, STORAGE_VERSION, STORAGE_KEY)
config = await store.async_load()
if not config:
# Create config
config = {
CONF_INSTANCE_ID: str(uuid4()),
CONF_WEBHOOK_ID: secrets.token_hex(),
CONF_CLOUDHOOK_URL: None,
}
Save the file and restart homeassistant.
I created a PR, it may be easier to follow that if it isn't merged: https://github.com/veista/smartthings/pull/134/commits/ec5765cb4ea2ab69eb01cd11abf57cdc1ba14a0f
I created a PR, it may be easier to follow that if it isn't merged: ec5765c
I Update smartapp.py with your but Smartthings not work, and in the log i see this:
Registratore: homeassistant.setup
Fonte: setup.py:426
Prima occorrenza: 23:33:54 (1 occorrenza)
Ultimo accesso: 23:33:54
Error during setup of component smartthings: 'HomeAssistant' object has no attribute 'components'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 426, in _async_setup_component
result = await task
^^^^^^^^^^
File "/config/custom_components/smartthings/__init__.py", line 57, in async_setup
await setup_smartapp_endpoint(hass)
File "/config/custom_components/smartthings/smartapp.py", line 233, in setup_smartapp_endpoint
and hass.components.cloud.async_active_subscription()
^^^^^^^^^^^^^^^
AttributeError: 'HomeAssistant' object has no attribute 'components'
could you help me to undertand what is the problema now?
Can confirm the above.
I also got the error: AttributeError: 'HomeAssistant' object has no attribute 'helpers'
After modifying smartapp.py based on Milkysunshine's post, the error with 'helpers' was probably fixed, but now the integration returns an error with 'components': AttributeError: 'HomeAssistant' object has no attribute 'components' same as Diegocampy above.
Yeah, I'm not sure.
I made the exact modifications I mentioned and it works?
I just rebooted HA again to verify... It works.
My PR was based on a full copy and paste of my current working file.
Maybe try pasting in the entire file from https://raw.githubusercontent.com/Milkysunshine/smartthings/refs/heads/master/custom_components/smartthings/smartapp.py ?
I upgrqded to 2025.5 and removed Smarthings Custom - made the modification by @Milkysunshine, but got the same error. I then downgraded to 2025.4 and installed Smarthings Custom again, upgraded to 2025.5 without removing Smarthings Custom. Made the modification - restarted and everything worked.
I upgrqded to 2025.5 and removed Smarthings Custom - made the modification by @Milkysunshine, but got the same error. I then downgraded to 2025.4 and installed Smarthings Custom again, upgraded to 2025.5 without removing Smarthings Custom. Made the modification - restarted and everything worked.
when you write downgrade, you restore a backup or different?
I upgrqded to 2025.5 and removed Smarthings Custom - made the modification by @Milkysunshine, but got the same error. I then downgraded to 2025.4 and installed Smarthings Custom again, upgraded to 2025.5 without removing Smarthings Custom. Made the modification - restarted and everything worked.
when you write downgrade, you restore a backup or different?
I restored a backup
There's a few other instances of hass.components.cloud that need to be replaced by just cloud like the PR was doing.
There's a few other instances of hass.components.cloud that need to be replaced by just cloud like the PR was doing.
It is very possible. I only made changes until it worked on my installation.
Hi - Here is a new modified file smartapp.py. It was necessary to do some more changes to the file, thank you @Milkysunshine for pointing in the right direction.
For modified file: https://github.com/breiviar/brama/blob/master/smartapp.py
You replace the file smartapp.py in config --> custom_components --> smartthings Restart Home Assistant and add Smartthings Custom integration again
Hi - Here is a new modified file smartapp.py. It was necessary to do some more changes to the file, thank you @Milkysunshine for pointing in the right direction.
For modified file: https://raw.githubusercontent.com/breiviar/brama/refs/heads/master/smartapp.py?token=GHSAT0AAAAAADDRZIMMYD4U3DDRHLWKSJVQ2A67DFQ
You replace the file smartapp.py in config --> custom_components --> smartthings Restart Home Assistant and add Smartthings Custom integration again
Thank you, but the link gives me a 404 not found
Hi - Here is a new modified file smartapp.py. It was necessary to do some more changes to the file, thank you @Milkysunshine for pointing in the right direction. For modified file: https://raw.githubusercontent.com/breiviar/brama/refs/heads/master/smartapp.py?token=GHSAT0AAAAAADDRZIMMYD4U3DDRHLWKSJVQ2A67DFQ You replace the file smartapp.py in config --> custom_components --> smartthings Restart Home Assistant and add Smartthings Custom integration again
Thank you, but the link gives me a 404 not found
I´m terrible at this - please try again
https://github.com/breiviar/brama/blob/master/smartapp.py
Hi - Here is a new modified file smartapp.py. It was necessary to do some more changes to the file, thank you @Milkysunshine for pointing in the right direction.
For modified file: https://github.com/breiviar/brama/blob/master/smartapp.py
You replace the file smartapp.py in config --> custom_components --> smartthings Restart Home Assistant and add Smartthings Custom integration again
Thank you 🙏 This fixed it for me.
Thanks @breiviar, it works great for me ! 👌
Hi all, What about 24 hours tokens, is somehow fixed in this file ? Because after one day it is not working
The upgrade to HA also broke my SmartThings integration. I tried the changes without success. I have fixed by restoring a backup from 3 days ago and recreating the PAT for SmartThings.
I redid the manual file update process described in this thread and now works 100% - many thanks to all involved for resolving. Most appreciated.
Hi - Here is a new modified file smartapp.py. It was necessary to do some more changes to the file, thank you @Milkysunshine for pointing in the right direction.
For modified file: https://github.com/breiviar/brama/blob/master/smartapp.py
You replace the file smartapp.py in config --> custom_components --> smartthings Restart Home Assistant and add Smartthings Custom integration again
You are an absolute life savior! This works flawless - just replaced the smartapp.py and rebooted (no restore of HA) and it just works again. However, this whole incident makes me question if this is still a good choice as it seems @veista is no longer maintaining this project. Maybe someone is willing to fork it to keep it alive?
Is this to resolve the ‘not loaded’ error?
The whole token issue is solved in the core version and every version since comes with a load of new features, so consider switching back to the core version :)
So I was thinking to ask this exact question, my integration shows it’s custom and from HACS I don’t know how or when I did it, what’s the way to switch back to the core one? I don’t have any interest in being ahead of the curve on a custom release 😅
Delete smartthings from your custom_components folder. If you run HAOS it's in /config/custom_components. Do note that you have to remove the integration beforehand. I have no clue if this custom integration updated the unique id in a weird way, so not all features are available, but if you join the smartthings discord I am happy to look into them
Thank you so much I was actually thinking to myself the other week why does it look like an unofficial one but wasn’t sure…anyway I am setting back up now I’m stuck in the authorize HomeAssistant step I authorize it multiple times and still it sits waiting..I don’t want to hijack this thread so I’ll just move over to the discord if I can’t get past it or need more advice
For everyone who downloaded the custom SmartThings integration via HACS: delete it and install SmartThings (not HACS, and not custom) from the official Home Assistant store. The custom integration no longer works and forces you to log in every 24 hours. I spent two weeks trying to figure out the issue — oh man!
The whole token issue is solved in the core version and every version since comes with a load of new features, so consider switching back to the core version :)
@joostlek Except I can't install it :-/ https://github.com/home-assistant/core/issues/147347