Problem with new version homeassistant 0.84.x and variable component

Hello
I am using home-assistant with the variable component since a year without problem. But when I try to upgrade from HA 0.83.3 to 0.84.3, the variable component breaks and I got the following error:

Dec 17 19:08:22 homeassistant hass[11313]: #033[31m2018-12-17 19:08:22 ERROR (MainThread) [homeassistant.loader] Error loading homeassistant.components.variable. Make sure all dependencies are installed#033[0m
Dec 17 19:08:22 homeassistant hass[11313]: Traceback (most recent call last):
Dec 17 19:08:23 homeassistant hass[11313]:   File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/loader.py", line 92, in
 get_component
Dec 17 19:08:23 homeassistant hass[11313]:     module = importlib.import_module(path)
Dec 17 19:08:23 homeassistant hass[11313]:   File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
Dec 17 19:08:23 homeassistant hass[11313]:     return _bootstrap._gcd_import(name[level:], package, level)
Dec 17 19:08:23 homeassistant hass[11313]:   File "<frozen importlib._bootstrap>", line 986, in _gcd_import
Dec 17 19:08:23 homeassistant hass[11313]:   File "<frozen importlib._bootstrap>", line 969, in _find_and_load
Dec 17 19:08:23 homeassistant hass[11313]:   File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
Dec 17 19:08:23 homeassistant hass[11313]:   File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
Dec 17 19:08:23 homeassistant hass[11313]:   File "<frozen importlib._bootstrap_external>", line 673, in exec_module
Dec 17 19:08:23 homeassistant hass[11313]:   File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
Dec 17 19:08:23 homeassistant hass[11313]:   File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/variable.py"
, line 14, in <module>
Dec 17 19:08:23 homeassistant hass[11313]:     from homeassistant.helpers.restore_state import async_get_last_state
Dec 17 19:08:23 homeassistant hass[11313]: ImportError: cannot import name 'async_get_last_state'#033[0m
Dec 17 19:08:23 homeassistant hass[11313]: #033[31m2018-12-17 19:08:23 ERROR (MainThread) [homeassistant.loader] Unable to find compone
nt variable#033[0m
Dec 17 19:08:23 homeassistant hass[11313]: #033[31m2018-12-17 19:08:23 ERROR (MainThread) [homeassistant.setup] Setup failed for variab
le: Component not found.#033[0m

I am using pip3 install --upgrade homeassistant to upgrade on a raspbian strech
Linux homeassistant 4.14.34-v7+ #1110 SMP Mon Apr 16 15:18:51 BST 2018 armv7l GNU/Linux

Did the new release work with the variable component ?

Thanks for any advice
Marc

This works
Comment out line 14 of variable.py
#from homeassistant.helpers.restore_state import RestoreEntity

Save reboot HA and then uncomment and reboot.

This seems to work for me.

There’s a pull request that fixes this. Updated file here:

1 Like

Yes that’s the one I was having trouble with.
Download it yesterday.

Thanks for the reply
In order to have a working variable component, I have download and install the variable.py as pointed out by aetolus

I have also to use a long token in appdaemon.yml to connect appdaemon with home-assistant.

With these 2 modifications, version 0.84.3 of HA is now working
Thanks

I’ll wait until it’s “officially” fixed by the maintainer I guess

Downloaded again from

And all is working thanks @rogro82 and sorry for the confusion. Great work.