jugla / worldtidesinfocustom

world tides info custom component for home assistant
MIT License
28 stars 2 forks source link

Credits used incorrect? #21

Closed realjax closed 1 year ago

realjax commented 1 year ago

Describe the bug Documentation says credits used per day is 3 but when I look at the last 10 calls it shows a call is made every 60 minutes. Which equates to 24 call per day..

To Reproduce Steps to reproduce the behavior:

  1. Go to https://www.worldtides.info/overview
  2. check 'last 10 apicalls'

see screenshot

Expected behavior 3 credits used per day, not 24

Screenshots Screenshot 2023-02-23 at 13 25 04

jugla commented 1 year ago

Hello Thanks for your feed back. Please can you give me your configuration? I mean static place or moving. Is it the first day ? Thanks in advance.

realjax commented 1 year ago

I'm not sure what you mean by static place or moving. I have an HA instance in my house setup that doesnt go anywhere. Does that answer your question? It is not the first day, it does an update exactly every hour. configuration is this

Screenshot 2023-02-24 at 10 43 39

realjax commented 1 year ago

Just realised I might be caused by the fact that I also have this one configured: https://www.home-assistant.io/integrations/worldtidesinfo !

I will remove that one and then let you know if that was it

jugla commented 1 year ago

Hello, Thanks a lot for the reply. In the HA worldtidesinfo, there is a request every hour. There is no optimization. SCAN_INTERVAL = timedelta(seconds=3600) in file core/homeassistant/components/worldtidesinfo/sensor.py

jugla commented 1 year ago

I'm not sure what you mean by static place or moving. I have an HA instance in my house setup that doesnt go anywhere. Does that answer your question?

When you have defined the tide location, you can refer to a static point (by default your home location) or attach to a tracker (i.e. a boat GPS) (i.e. moving)

realjax commented 1 year ago

Yep, the HA worldtidesinfo was causing it! Thanks for your help and I will close to his now.