custom-components / authenticated

A platform which allows you to get information about sucessfull logins to Home Assistant.
MIT License
82 stars 28 forks source link

Authenticated not showing any location information anymore #43

Closed DavidFW1960 closed 5 years ago

DavidFW1960 commented 5 years ago

Version of the custom_component

Describe the bug A clear and concise description of what the bug is. Prior to v1, the sensor used to show the location information country/region/city but now is blank. Otherwise now working well log

Untitled

ludeeus commented 5 years ago

This is 3 issues.. :/

1: the API providers have rate limits. 2: extreme-ip does not support IPv6 3: data from ipvigilante is not correctly parsed.

ipapi provider (default) should be able to show this as long as you do not hit the ratelimit.

DavidFW1960 commented 5 years ago

Hmm.... I have not configured anything in there for provider so should be default.. It has always worked with IPv6 actually... that screenshot is google assistant and it's always worked fine. I'll check my config for provider.

# Sensors
sensor:

# Authentication Sensor
  - platform: authenticated
    enable_notification: true
DavidFW1960 commented 5 years ago

I had deleted .ip_authenticated.yaml and checking that file now I only have 5 entries and none of them show a location. Checked the logs and there are no entries for authenticated at all - I used to get quite a lot.

ludeeus commented 5 years ago

default is ipapi, that support v6, but you have probably hit the ratelimit

DavidFW1960 commented 5 years ago

I've never hit it before. I have 12 entries in the yaml file (3 days) This is nowhere near as many entries as I was expecting

ludeeus commented 5 years ago

The entries are from .storage/auth, they may be old.

DavidFW1960 commented 5 years ago

Um... ok... just logged out and in again. In .ip_auth yaml it shows me logging back in at last_used_at: '2019-07-08T22:58:08.984340+00:00'. It should be 2019-07-09T07:25:00+00:00 I don't have a single entry in there for today. I also added ipapi as a provider (in single quotes).... nothing.

ludeeus commented 5 years ago

that is not how it works.

the entry for existing IP's will only be updated when needed (refresh token expired) and adding ipapi does not matter, that is default

I started this thread by stating rate limit was an issue did I not?

1: the API providers have rate limits.

No matter how you configure that it will still be an issue with how it operates, this need to change in the code.

DavidFW1960 commented 5 years ago

You did state that but it does not make sense... I was just eliminating the possibility it wasn't using it as the default. Like I said I have not see this rate limit previously and zero geo data for 3 days of entries in the yaml file isn't normal.

If you are sure that's all it is then I'll see what happens tomorrow.

ludeeus commented 5 years ago

before it did not query during startup, it does now, and that is too much for the API.

DavidFW1960 commented 5 years ago

Ok thanks for the explanation. I’ll see what happens tomorrow. Doesn’t really matter anyway I suppose it was just different to before.

ludeeus commented 5 years ago

1.0.6 fixes all issues mentioned in this issue. if you want a reindex of geodata, delete .ip_authenticated.yaml then restart HA.

DavidFW1960 commented 5 years ago

Thanks @ludeeus that seems to be working again now.