watkins-matt / home-assistant-google-keep-sync

Custom component for Home Assistant that enables bidirectional synchronization with Google Keep lists.
MIT License
47 stars 4 forks source link

15 minutes sync not working? #11

Closed FragMenthor closed 7 months ago

FragMenthor commented 7 months ago

Hello again. It seams that 0.92 stopped the automated sync every 15 minutes; I did an automation to call the update_entity service every 15 minutes, and it works (also use my cellphone sensors do detect when the app is used / closed and update a little bit after).

alias: "Lista de Compras: Sincronizar"
description: ""
trigger:
  - platform: time_pattern
    minutes: /15
    seconds: "10"
    id: padrao_tempo
  - platform: state
    entity_id:
      - sensor.telemovel_fragmenthor_last_used_app
    from: com.google.android.keep
    id: app_fragmenthor
condition: []
action:
  - delay:
      minutes: 1
      seconds: 30
  - service: homeassistant.update_entity
    data: {}
    target:
      entity_id: todo.google_keep_compras_supermercado
mode: restart

Whithout this automation the list would not update on the HA side (waited more than 1 hour and still the items I added in Google Keep would't show up on HA). Is it only me? By the way, is there a reason for limiting the sync to every 15 minutes? Why not 5 minutes, for instance? I am asking this to try to undertand if I am stepping over some king of limit with my automation.

And a little info needed from my side: where are these lists stored? Can't find them anywere... Thanks again!

watkins-matt commented 7 months ago

I'm not able to reproduce this. I just tested it and everything is still syncing as expected.

Nothing changed with the sync code yet in the new version so you shouldn't be seeing any differences.

Are you seeing any errors in the Home Assistant logs? Did you try deleting the integration and adding it again?

If you are updating significantly more frequently than the normal rate (due to the automation), it is possible you are being rate limited or ip banned by Google.

The main reason the update rate is 15 minutes is to avoid creating unreasonable levels of traffic that Google might have an issue with. I may still consider lowering it slightly or exposing it as an option but 15 minutes was a good trade-off between a reasonable update rate and limited strain on the Keep servers.

Obviously no one would be able to stop you if you chose to go into the code and lower the number manually, but this would not be supported and may cause issues.

watkins-matt commented 7 months ago

Besides within the todo entities themselves, there is a json file within your config/.storage file that is used as a cache of all your data. You can view it but please don't edit/move/rename or delete the file because it may cause issues with the integration.

FragMenthor commented 7 months ago

Thank you for that feedback, probably will adjust my settings to reduce access. And probably some mistake on my side... Regarding the files, it seams HA still hasn't standarized everything.

I have now 6 todo lists in HA, with 3 different storage aproaches: image

I am trying to store (only read, not write) the contents of the list in an attribute of a sensor, but still didn't wrap this around...

watkins-matt commented 7 months ago

The Home Assistant forums will probably be more helpful regarding questions specific to Home Assistant in general. All your items are stored in the todo entity (so todo.google_keep_list_name) and you'll want to use the service todo.get_items.

See here: https://www.home-assistant.io/integrations/todo/

And here: https://community.home-assistant.io/t/help-how-to-use-todo-get-items/651792

Going to close this issue because this is not something that I can reproduce.

FragMenthor commented 7 months ago

THANK YOU, and sorry to mislead the request! Will do as suggested! 🙏