Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why not pass _location_name_ on connects and disconnects? #17

Closed
SaturnusDJ opened this issue Dec 17, 2018 · 4 comments
Closed

Why not pass _location_name_ on connects and disconnects? #17

SaturnusDJ opened this issue Dec 17, 2018 · 4 comments
Labels
duplicate This issue or pull request already exists

Comments

@SaturnusDJ
Copy link

While exploring #16 I was wondering why, when a connect or disconnect happens, the script sends a consider_home value. Why not send the location_name, home on connect, and location_name, away on disconnect.

Is there a specific reason for this to not break things?

@mueslo
Copy link
Owner

mueslo commented Dec 17, 2018

What's the difference between this and #16?

@mueslo mueslo closed this as completed Dec 17, 2018
@mueslo mueslo added the duplicate This issue or pull request already exists label Dec 17, 2018
@SaturnusDJ
Copy link
Author

SaturnusDJ commented Dec 17, 2018

Here the question is why not use location_name instead of consider_home and send home and not_home states, which should cause no problem at all on the Home Assistant side because that's how HA works with the more 'integrated' nmap and ping tools from itself.

@mueslo
Copy link
Owner

mueslo commented Dec 17, 2018

consider_home is required so devices that drop off the network temporarily are not marked as away and because this script only sends data to HA on state changes, which might be multiple hours apart. Other than that, I'm not sure how exactly consider_home and location_name and zones interact, depending on that HA might need to be patched before #16 is solvable anyway.

@SaturnusDJ
Copy link
Author

Got it. I have read on the HA pages that consider_home is mainly used for iPhone.

My conclusion so far with this program is:

  1. iPhones that enter sleep mode and thus cannot be detected with NMAP/Ping tools do not disconnect from the router, and the router does not kick them, so they stay home.
  2. Meanwhile, when a device moves out of range the router times it out after some minute and it will be marked not_home.
    (Subject to change. Still discovering the ins and outs.)

Absolutely great. 🥂

Anyone has a different experience?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants