GithubHelp home page GithubHelp logo

Comments (11)

chvancooten avatar chvancooten commented on June 16, 2024

Hi @KaoruKanon,

Thanks for reporting this! The issue sounds new to me. Could you provide some more details on what kind of disconnections you experience, and how you have implemented the token grabber?

I have the token grabber set on a 1-hour cronjob and it works without interruptions for me!

from homeassistant-googletokenretriever.

luismalves avatar luismalves commented on June 16, 2024

Hi,

The same is happening to me. I have set initially a 1-hour cronjob as you. I'm also not being able to connect to the Google home with the generated token. It's returning connection refused. Have you faced similar issues in the last day?

Thanks!

from homeassistant-googletokenretriever.

chvancooten avatar chvancooten commented on June 16, 2024

That's odd, the tokens that are being pushed to my home assistant seem to work, and I'm not encountering "connection refused" errors either.

Are the tokens being pushed to the input_text.google_tokens object correctly? What happens if you send a manual cURL request to the local API using the generated token? (E.g. Authorization: Bearer {TOKENHERE}). For more, please refer here.

If you are not able to use these tokens even manually, there may be a wider problem with Google changing the mechanisms of the local API. They've been known for making arbitrary changes, and rolling them out in a seemingly random fashion. I do hope that's not the case here!

from homeassistant-googletokenretriever.

luismalves avatar luismalves commented on June 16, 2024

Thank you, that worked so it was a configuration issue after all. My google account keeps asking for sign in on all devices at around 7 am everyday after using this method. I wonder if the same have happened to anyone else.

from homeassistant-googletokenretriever.

chvancooten avatar chvancooten commented on June 16, 2024

It's odd, I'm not at all able to reproduce this issue, with various intervals (both cron and manually). Some questions that may help troubleshooting it:

  1. What API endpoint are you trying to access using your token?
  2. What happens when you manually run the python script? python3 get_tokens.py, output should look like this:
    image
  3. What happens when you manually run the bash script? Are tokens correctly pushed to your Home Assistant?
  4. What happens when you manually make a call to the local API endpoint? E.g., for alarms, it should look like this:
    image
  5. Could you share the cronjob you have running to trigger the script?

from homeassistant-googletokenretriever.

luismalves avatar luismalves commented on June 16, 2024

I found the problem with the Google Account sign out. My cron job had an error and was being trigger every minute. This would probably kick in some security alert in the Google Account and force a new sign in in all devices.

Thanks for the help and for the script!

from homeassistant-googletokenretriever.

chvancooten avatar chvancooten commented on June 16, 2024

Ah yes, that would explain it indeed! Glad the issue is resolved now.

@KaoruKanon - Did you figure out the issue on your end? My previous post may help troubleshoot.

from homeassistant-googletokenretriever.

KaoruKanon avatar KaoruKanon commented on June 16, 2024

I think I have fixed my issue. I needed time to check the good running

I put my master token in bash file. I changed my crontab because I had put every 30minutes cron. I had done that for testing purposes
I have recently set a @hourly crontab

I want to take this time to ask you: have you test a hass automation for running this script? I already test, it works not well.

from homeassistant-googletokenretriever.

chvancooten avatar chvancooten commented on June 16, 2024

Good to hear! Let's hope that indeed fixed the issue.

I do have an automation running, to fetch my Google Assistant alarm time from a certain Google Home device. I use the commandline sensor to retrieve it as follows.

platform: command_line
command: "curl --insecure --header \"cast-local-authorization-token: {{ state_attr('input_text.google_tokens', 'token_my-google-home') }}\" https://my-google-home:8443/setup/assistant/alarms"
name: Next Alarm
value_template: >
  {% set alarms = value_json.alarm|sort(attribute='fire_time') %}
  {% if alarms[0] is defined %}
    {{ alarms[0].fire_time }}
  {% else %}
    None
  {% endif %}

from homeassistant-googletokenretriever.

KaoruKanon avatar KaoruKanon commented on June 16, 2024

@chvancooten For the sensor integration, I have looked your hass config. It works well. Thank you

In fact, I'm talking about the same work than cron but handled by hass itself. There is an inherent issue with cron. If you restart hass, hass lose the token and you need to wait the cron task or start manually the get_tokens. sh

I've found an automation for that thanks to starting of get_tokens via ssh.

from homeassistant-googletokenretriever.

chvancooten avatar chvancooten commented on June 16, 2024

Yes, that should work indeed. Closing this issue for now, as no problems seem to remain :)

from homeassistant-googletokenretriever.

Related Issues (2)

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.