home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.61k stars 29.93k forks source link

65.5 breaks Asuswrt device_tracker (phones ) status #13399

Closed Mariusthvdb closed 6 years ago

Mariusthvdb commented 6 years ago

Make sure you are running the latest version of Home Assistant before reporting an issue.

You should only file an issue if you found a bug. Feature and enhancement requests should go in the Feature Requests section of our community forum:

Home Assistant release (hass --version): 0.65.5 Python release (python3 --version): builtin python 3

Component/platform:

asuswrt Description of problem: see also: https://community.home-assistant.io/t/hassio-0-65-asuswrt-phone-device-trackers-incorrect/47539

since 0.65 all of my phones device trackers behave inconsistently. Home while away, vice versa. Very annoying, and working just perfectly before…

detail: when home, devices seems to interact as should, but when off, or away, devices show up inconsistently home and away.... no logic found yet ;-( Expected:

work as expected show home and away as is logged by the Asus router Problem-relevant configuration.yaml entries and steps to reproduce:

Traceback (if applicable):

Additional info: Custom UI 20180216 platform independent, Safari Mac desktop, Chrome, firefox, iPhone all show the same states

metbril commented 6 years ago

Using the component with hass.io on rpi myself without any issues.

0.65.5 and 3.6.3

Mariusthvdb commented 6 years ago

not sure if this is really solved on my side, but the phones seem to work again, most of the time.

several other idiosyncrasies though, of devices showing wrong states in the more-info, while the state itself shows to be correct.

close this issue, for now... since others have reported the states issue elsewhere

Mariusthvdb commented 6 years ago

well, cheered too soon.

Have more detail: at startup, Hassio thinks my phone is Home while in fact the wifi is turned off, and the router cant see it. Enabling Wifi, and disabling at again makes Hassio see me as Away.

Somehow it starts in the wrong state, and in this case it is wrong on all accounts, not only the state card or the more info. state in the dev-tools shows false positive.

kukudemajia commented 6 years ago

0.66.0.beta1 has the same issue.

Mariusthvdb commented 6 years ago

thanks, im not alone.... behavior is inconsistent, it now is showing 2 other phones being home, while in fact they are out of the building and are only tracked by the asuswrt component. So definitely something going on. Tried the custom-ui, since it determines the way they are represented in the frontend, but that does not appear to be the cause.

metbril commented 6 years ago

I am running 0.65.5 with Hass.io and Python 3.6.3. Using asuswrt component without (experiencing) issues on RT-AC68U running the latest firmware (incl. the new AiMesh).

PlanetJ commented 6 years ago

I am having the same problem after upgrading to 0.65.6 - used to work perfect. In my case, all my phones always show as away. I tested the component in the dev env and for me it seems to be an issue with the the line

if devices[key].ip is not None

I use my asus RT-AC66U in AP mode (Merlin 380.68_4) and none of the commands, arp, wl or neigh return an ip. If I ssh into my ap and ping some of the missing devices they start showing up as the ip starts showing up in the arp command response. Interesting thing is the gui device list always has mac+ip.

kukudemajia commented 6 years ago

It's awesome! ret_devices = {} for key in devices:

if devices[key].ip is not None:

            # ret_devices[key] = devices[key]
        ret_devices[key] = devices[key]
    return ret_devices

Now,it works well,thks!

Mariusthvdb commented 6 years ago

There’s hope ;-) Not sure what your findings show us to do ?

kukudemajia commented 6 years ago

Edit the file: /srv/homeassistant/homeassistant_venv/lib/python3.6/site-packages/homeassistant/components/device_tracker/asuswrt.py

Like this: qq 20180403135302

Or put the file in this directory: /home/homeassistant/.homeassistant/custom_components/device_tracker/

asuswrt.zip

Restart HASS!Enjoy!

Mariusthvdb commented 6 years ago

ok thanks, but are you sure this isnt something the should be fixed in the HA component itself?

Im on Hassio here, and never edit the system files like this....btw i dont have an asuswrt.py file in the custom_components, so maybe this would interfere with the main setup?

kukudemajia commented 6 years ago

Sorry,I don't know anything about Hassio,maybe you can wait for the official fix.

Mariusthvdb commented 6 years ago

will have to... how can we draw attention to the need for fixing this in Hassio, have i filed this issue in the correct place?

metbril commented 6 years ago

@fabaff Do you know who to ask for a fix / PR for this?

PlanetJ commented 6 years ago

A new configuration parameter should be added or have it only require an ip address in router mode. @kukudemajia and @hvbhome are you also using your asus in access point mode?

Mariusthvdb commented 6 years ago

this is my configuration:


- platform: asuswrt
  host: !secret asus_ip
  username: !secret asus_username
  password: !secret asus_password
  interval_seconds: 20
  consider_home: 60
  track_new_devices: yes

only router mode here.

Mariusthvdb commented 6 years ago

@fabaff HI , had not expected this to close, since the solution speaks of AP mode? Does this also solve the issues with Router mode?