ha_gehome: RuntimeError: Attribute hass is None every 30 seconds
I had removed the integration for a bit due to similar issues. With the recent updates, I did a fresh install of GE Home. After restarting HA, I began again to get the errors below. It is happening every 30 seconds and the integration doesn’t work. I’ll disable for now, but happy to re-enable to further test/debug as needed.
2023-09-16 20:35:15.700 DEBUG (MainThread) [custom_components.ge_home.update_coordinator] Updating <Entity HT135853G Laundry Machine State> (ge_home_HT135853G_laundry_machine_state, None)
2023-09-16 20:35:15.700 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/ge_home/update_coordinator.py", line 280, in on_device_update
entity.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 707, in async_write_ha_state
raise RuntimeError(f"Attribute hass is None for {self}")
RuntimeError: Attribute hass is None for <Entity HT135853G Laundry Machine State>
2023-09-16 20:35:15.801 DEBUG (MainThread) [custom_components.ge_home.update_coordinator] Updating <Entity GT345122N Laundry Machine State> (ge_home_GT345122N_laundry_machine_state, None)
2023-09-16 20:35:15.801 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/ge_home/update_coordinator.py", line 280, in on_device_update
entity.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 707, in async_write_ha_state
raise RuntimeError(f"Attribute hass is None for {self}")
RuntimeError: Attribute hass is None for <Entity GT345122N Laundry Machine State>
About this issue
- Original URL
- State: closed
- Created 9 months ago
- Comments: 48 (17 by maintainers)
Closing as resolved, will deploy to master once the other stability issue fix is also resolved. Thanks everyone for their help in diagnosing and resolving this!
Apologies, really swamped with work today. Just looked at the log, and I think it is helpful, but will need some time to process it. Hopefully I can identify the pattern tomorrow. Thank you for all your help so far!
I’ll wait until tomorrow or Tuesday and then will promote the current pre-release to release and close this issue if nothing further is reported. Thank you for your help in getting it resolved!
I think that was the last of them! I just restarted HA 7+ times and the integration came up perfectly every time!
I think the final test is to see if it randomly goes into an Unknown status in the middle of the day. But honestly I think the previous fixes fixed those issues as I haven’t seen that at all in the last few days.
Can you try dev4? The logs helped identify another startup issue (it sent the ready signal before the platform setup in your logs). I added some code to handle that situation, so hopefully one less problem. Let me know what you see now.
It’s controlled through the logger (https://www.home-assistant.io/integrations/logger/). I think you’d have to modify your HA config, I use yaml, not sure if there’s a way to do it from the UI:
logger: default: info logs: gehomesdk: debug custom_components.ge_home: debug
Hmm, somehow, it’s losing the appliance information, and then it goes into that state. I added a bunch more debug statements, so that’s what you’re seeing in there. I’ll look into how it could be losing the appliance, could be an issue with the reconnect logic.
not sure about the 403 errors, perhaps there was a temporary glitch with the GE auth service? I’ve added the logic guards that I mentioned in dev3, it should prevent unhandled exceptions and hopefully clear a few more stability issues. Let me know how it does.
I have an idea on that last error, it might be trying to update before it’s fully added to hass. I think I can put some guard code around that and it might resolve that one too. I’ll work on that tomorrow and will let you know when I deploy the next release.
I finally identified the issue with reloading the integration. I’m doubtful it’ll fix all issues, but may help the stability. Can you give dev2 a shot?
new release created
Hmm, I don’t know why #197 or #206 would fix this particular issue. I think this is related to Python MRO. I think I may have identified the fix in the latest dev branch, can you all check if it helps or if you’re still seeing the issue?
So https://github.com/simbaja/ha_gehome/pull/197 is an enormous hack that seems to get rid of that error entirely for me. Notably I suspect entity ids should really be added somewhere else and this will only work for those with just sensor issues. OTOH, it seems to break the integration for my second oven for some reason. Unsure why, especially given it’s a different model, but reloading the integration gets a series of errors like the following, but only for the second oven