Git Product home page Git Product logo

Comments (19)

chrisjenx avatar chrisjenx commented on May 31, 2024 1

Seems like redownloading and reauthin to get a new tokens.js fixed it.
Wondering if the container needs to run a periodic refresh token command to make sure it doesn't expire?

from google-assistant-broadcast.

chrisjenx avatar chrisjenx commented on May 31, 2024

It's like the cert just randomly invalidated it'self, I'll refresh and redownload and see if it fixes it

from google-assistant-broadcast.

ismarslomic avatar ismarslomic commented on May 31, 2024

Glad to hear to you fixed the issue.

I have been running my docker container for couple of weeks without need for any manual refreshing of tokens, or re-downloading the tokens file. So I'm not sure refreshing the token is the issue.

I suggest that you leave your container running for couple of days/weeks now, when everything is working, and see how it goes.

Closing this issue for now, but please report back if you face any new issues!

from google-assistant-broadcast.

chrisjenx avatar chrisjenx commented on May 31, 2024

Looks like 11 days later and same error, wondering if my generated token has a short ttl

from google-assistant-broadcast.

chrisjenx avatar chrisjenx commented on May 31, 2024

So yeah 7 days, looks like this is how oauth works on testing accounts.

Refresh tokens will actually expire after 7 days if the project publishing status is "testing". Per google documentation: A Google Cloud Platform project with an OAuth consent screen configured for an external user type and a publishing status of "Testing" is issued a refresh token expiring in 7 days.

from google-assistant-broadcast.

chrisjenx avatar chrisjenx commented on May 31, 2024

If you look inside your tokens.json you'll see your bearer expires:

"token_type":"Bearer","expiry_date":1657083576057}

from google-assistant-broadcast.

chrisjenx avatar chrisjenx commented on May 31, 2024

I'm guessing your either have a published project? or you have managed to set a longer token somehow

from google-assistant-broadcast.

chrisjenx avatar chrisjenx commented on May 31, 2024

Oh you need to publish the app: https://stackoverflow.com/a/67367752/803225

from google-assistant-broadcast.

chrisjenx avatar chrisjenx commented on May 31, 2024

yeah Ive published my app and refreshed the token, lets see if it lasts more than 7 days

from google-assistant-broadcast.

ismarslomic avatar ismarslomic commented on May 31, 2024

Thanks for the input! I have re-opened this issue.

I have not published my app in Google Assistant Console, so I dont think that is required in order to fix the token refreshing. And, Im still using the same token I generated months ago without any issues. What I assume is different between mine and yours setup is that Im using the Google Assistant broadcast every day in HA automation and I think that token is automatically refreshed when actively using the broadcast API and underlaying lib https://github.com/endoplasmic/google-assistant.

But it is also possible to schedule token refreshes, to avoid need for frequent usage of the broadcast api!

Im currently on vaccation, but will look at this in couple of weeks or so.

Help and PR is of course welcome!

from google-assistant-broadcast.

chrisjenx avatar chrisjenx commented on May 31, 2024

Maybe, but we send a Broadcast at least once a day, I noticed where it sent one in the morning and didn't later (When the garage was left open).

I'm wondering if there is some nuanced way the projects are setup/tokens, or that my setup is not able to refresh the token and write it to disk (maybe my docker container config?)

from google-assistant-broadcast.

ismarslomic avatar ismarslomic commented on May 31, 2024

Oh, then my assumption might be incorrect.

Another solution would be to publish the google assistant broadcast as custom HA component and let HA take care of OAuth flow (authentication and refreshing). But that requires development that I dont have time for currently.

from google-assistant-broadcast.

chrisjenx avatar chrisjenx commented on May 31, 2024

Maybe, let's see what happens in a week.
I really would like NabuCasa to add notification intergration into the cloud sub (https://developers.google.com/assistant/smarthome/develop/notifications) that would make that much more useful, where a doorbell could just send a direct notification instead of a roundabout Broadcast.

I started going down that route, but you need to create/register devices, which is possible as a HA plugin as they already expose those devices to Google Assistant - I was trying to do a standalone docker image.

from google-assistant-broadcast.

chrisjenx avatar chrisjenx commented on May 31, 2024

Seems publishing my project fixed it, 20+ days on still working!

from google-assistant-broadcast.

ismarslomic avatar ismarslomic commented on May 31, 2024

Thanks for the update, and happy to see that this solved your issue! So basically what you did where to configure the OAuth Consent Screen for your app in the Google Console?

from google-assistant-broadcast.

chrisjenx avatar chrisjenx commented on May 31, 2024

Yeah on this screen:

image

https://console.cloud.google.com/apis/credentials/consent

from google-assistant-broadcast.

chrisjenx avatar chrisjenx commented on May 31, 2024

Little confused why yours is fine without being published, but seems to fix it for me 🤷

from google-assistant-broadcast.

ismarslomic avatar ismarslomic commented on May 31, 2024

Alright! Glad you fixed the issue and I hope you are enjoying the Google Broadcast 👍

from google-assistant-broadcast.

chrisjenx avatar chrisjenx commented on May 31, 2024

Thank you, appreciate it!

from google-assistant-broadcast.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.