home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.65k stars 29.94k forks source link

Google Chat integration has stopped working #82235

Closed B00T5820485730 closed 1 year ago

B00T5820485730 commented 1 year ago

The problem

The Google Chat integration has stopped working. The hangouts.conversations entity is no longer displayed in Developer Tools -> States, and calling the Google Chat: Update service throws an error: "Failed to call service hangouts.update. Unknown error."

I tried restarting HassOS, disabling/enabling the integration, and removing/adding the integration. Authentication still works, but I'm not able to send messages. The integration stopped working some time during the day on 11/16, without any changes to my configuration.

What version of Home Assistant Core has the issue?

2022.11.3

What was the last working version of Home Assistant Core?

2022.11.3

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Google Chat

Link to integration documentation on our website

https://www.home-assistant.io/integrations/hangouts/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 1 year ago

hangouts documentation hangouts source

StephenWetzel commented 1 year ago

Similar problem for me. Stopped working 11/15. I'm running Home Assistant Core 2022.10.5. The error in the logs is:

  File "/home/steve/.pyenv/versions/3.9.13/envs/homeassistant/lib/python3.9/site-packages/homeassistant/components/hangouts/hangouts_bot.py", line 252, in _async_send_message
    conversation = self._conversation_list.get(target[CONF_CONVERSATION_ID])
AttributeError: 'NoneType' object has no attribute 'get'
djxela commented 1 year ago

I have problems with Hangouts too. Stopped working on 16.11. Im'm running 2022.11.3. There is no problems with login and password. After reload integration I have these logs:

Exception in async_handle_update_users_and_conversations when dispatching 'hangouts_connected': () Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/hangouts/hangouts_bot.py", line 352, in async_handle_update_users_and_conversations await self._async_list_conversations() File "/usr/src/homeassistant/homeassistant/components/hangouts/hangouts_bot.py", line 319, in _async_list_conversations ) = await hangups.build_user_conversation_list(self._client) File "/usr/local/lib/python3.10/site-packages/hangups/conversation.py", line 30, in build_user_conversation_list conv_states, sync_timestamp = await _sync_all_conversations(client) File "/usr/local/lib/python3.10/site-packages/hangups/conversation.py", line 110, in _sync_all_conversations response = await client.sync_recent_conversations(request) File "/usr/local/lib/python3.10/site-packages/hangups/client.py", line 674, in sync_recent_conversations await self._pb_request('conversations/syncrecentconversations', File "/usr/local/lib/python3.10/site-packages/hangups/client.py", line 415, in _pb_request res = await self._base_request( File "/usr/local/lib/python3.10/site-packages/hangups/client.py", line 471, in _base_request res = await self._session.fetch( File "/usr/local/lib/python3.10/site-packages/hangups/http_utils.py", line 89, in fetch raise exceptions.NetworkError( hangups.exceptions.NetworkError: Request return unexpected status: 403: Forbidden
Exception in async_handle_update_users_and_conversations when dispatching 'hangouts_connected': () Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/hangouts/hangouts_bot.py", line 352, in async_handle_update_users_and_conversations await self._async_list_conversations() File "/usr/src/homeassistant/homeassistant/components/hangouts/hangouts_bot.py", line 319, in _async_list_conversations ) = await hangups.build_user_conversation_list(self._client) File "/usr/local/lib/python3.10/site-packages/hangups/conversation.py", line 30, in build_user_conversation_list conv_states, sync_timestamp = await _sync_all_conversations(client) File "/usr/local/lib/python3.10/site-packages/hangups/conversation.py", line 110, in _sync_all_conversations response = await client.sync_recent_conversations(request) File "/usr/local/lib/python3.10/site-packages/hangups/client.py", line 674, in sync_recent_conversations await self._pb_request('conversations/syncrecentconversations', File "/usr/local/lib/python3.10/site-packages/hangups/client.py", line 415, in _pb_request res = await self._base_request( File "/usr/local/lib/python3.10/site-packages/hangups/client.py", line 471, in _base_request res = await self._session.fetch( File "/usr/local/lib/python3.10/site-packages/hangups/http_utils.py", line 67, in fetch async with self.fetch_raw(method, url, params=params, File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 1138, in __aenter__ self._resp = await self._coro File "/usr/local/lib/python3.10/site-pac
```kages/aiohttp/client.py", line 399, in _request raise RuntimeError("Session is closed") RuntimeError: Session is closed
compacthack commented 1 year ago

My Google Chat integration stopped working about the same time too, I've tried remove / add, log back in, still no go, not sure if it is related but I'm getting these errors:-

2022-11-19 10:04:16.493 ERROR (MainThread) [homeassistant.util.logging] Exception in async_handle_update_users_and_conversations when dispatching 'hangouts_connected': () Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/hangouts/hangouts_bot.py", line 352, in async_handle_update_users_and_conversations await self._async_list_conversations() File "/usr/src/homeassistant/homeassistant/components/hangouts/hangouts_bot.py", line 319, in _async_list_conversations ) = await hangups.build_user_conversation_list(self._client) File "/usr/local/lib/python3.10/site-packages/hangups/conversation.py", line 30, in build_user_conversation_list conv_states, sync_timestamp = await _sync_all_conversations(client) File "/usr/local/lib/python3.10/site-packages/hangups/conversation.py", line 110, in _sync_all_conversations response = await client.sync_recent_conversations(request) File "/usr/local/lib/python3.10/site-packages/hangups/client.py", line 674, in sync_recent_conversations await self._pb_request('conversations/syncrecentconversations', File "/usr/local/lib/python3.10/site-packages/hangups/client.py", line 415, in _pb_request res = await self._base_request( File "/usr/local/lib/python3.10/site-packages/hangups/client.py", line 471, in _base_request res = await self._session.fetch( File "/usr/local/lib/python3.10/site-packages/hangups/http_utils.py", line 89, in fetch raise exceptions.NetworkError( hangups.exceptions.NetworkError: Request return unexpected status: 403: Forbidden

h4de5 commented 1 year ago

can't say for how long the link on the integration page (https://accounts.google.com/o/oauth2/programmatic_auth?scope=https%3A%2F%2Fwww.google.com%2Faccounts%2FOAuthLogin+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email&client_id=936475272427.apps.googleusercontent.com&device_name=hangups) is not working anymore. but maybe this may help somebody to investigate. the app behind the integration could have been disabled.

yp87 commented 1 year ago

same error here, since yesterday :/

wrkn4alivn commented 1 year ago

Because this integration depends on Hangups from tdryer, I believe this is the reason: https://github.com/tdryer/hangups/issues/533

I am not sure why this integration was renamed "Google Chat". The underlying Hangups client reverse-engineered the Google Hangouts protocol, which was deprecated long ago and now appears to be turned down. To get this working again, the integration will likely have to be completely rewritten to use Google Chat APIs.

compacthack commented 1 year ago

I use Eion Robb's Google Chat plugin for Pidgin chat client and that is still working fine ? I'm no coder but If HA could abandon Hangups and jump on Eion's purple-googlechat that might get us back on the air. I'm sure it wouldn't be that easy. https://github.com/EionRobb/purple-googlechat

People are now reporting that Elon's other Pidgin for Hangouts has recently stopped working, and He is asking people to change to his purple-googlechat plugin because the Hangouts API has been shut down by Google. https://github.com/EionRobb/purple-hangouts

misakm commented 1 year ago

Is there any update? I got the same issue 2022.6.6 2022-11-20 18:51:21 ERROR (MainThread) [homeassistant.util.logging] Exception in async_handle_update_users_and_conversations when dispatching 'hangouts_connected': ()

skywurz commented 1 year ago

Same issue. I hope its not actually built on hangouts as someone mentioned because Google did just shut it off.

KuroSetsuna29 commented 1 year ago

Same issue. I hope its not actually built on hangouts as someone mentioned because Google did just shut it off.

Well its built on the hangups util library, which leverages the Hangouts protocol. Thats what probably cause it to stop working for everyone. To fix, it looks like someone will need to update the component to use a newer library that uses the Google Chat protocol.

KuroSetsuna29 commented 1 year ago

To be clear, if I understand the the PR that closes this issue. It doesn't actually fix the issue, it is just saying that integration is no longer supported and is being removed?

frenck commented 1 year ago

it is just saying that integration is no longer supported and is being removed?

Correct. The API it uses has been shut down, the integration can no longer work. It has, therefore, been removed from our codebase and is pending removal for Home Assistant 2022.12.

The integration was labeled Google Chat, however, it was previous labels (and using) Google Hangouts.

This issue was closed by the removal PR for that reason.

../Frenck

compacthack commented 1 year ago

So long Google Hangouts / Chat, thanks for all the fish. Since it died a week or so back I've migrated over to a discord bot for notifications, so far it seems to work really well, no offence but the Android companion app Notifications aren't quite adequate yet, missing native imaging viewing & image log from within the companion app 🥺, but that could be just me..

misakm commented 1 year ago

@compacthack - is Discord bot free and secure? What are other alternatives?

wrkn4alivn commented 1 year ago

The Discord integration https://www.home-assistant.io/integrations/discord/ works for notify service calls. If you want chatbot capability, Telegram https://www.home-assistant.io/integrations/telegram_bot/ is a good alternative.

On Thu, Nov 24, 2022, 11:46 PM misakm @.***> wrote:

@compacthack https://github.com/compacthack - is Discord bot free and secure? What are other alternatives?

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/82235#issuecomment-1327119267, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABIOTVHKLDMLU4IU5NOBSPLWKBVELANCNFSM6AAAAAASC5JBWE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

skywurz commented 1 year ago

I just moved everything to Discord. with node-red you can do commands from discord to HA image

Edit:

The service command was easy to replace service: notify.discord <--(The service will be named the bots name) data: message: "{{now().strftime(\"%m/%d/%Y - %r\")}} : Aquarium Chiller Running for over 2 hours." target: ["1234(its a long number you copy from discord)"]