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

Everyone_home/not_home wrong state #58

Open
pointlevel opened this issue Aug 21, 2020 · 4 comments
Open

Everyone_home/not_home wrong state #58

pointlevel opened this issue Aug 21, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@pointlevel
Copy link

Hello!

I have started to looking to use the binary sensors created from the app. But my sensors are reporting wrong state.
In the app i have 4 macs. And by the time writing, 2 is home and 2 is away.
And the status of the sensors is:

binary_sensor.everyone_home = on
binary_sensor.everyone_not_home = off

Feels to me that they are switched?

@Odianosen25
Copy link
Owner

Hello @pointlevel,

Yeah I just saw it, and weird I didn't see it before. Though @skynet01 had reported it before, but seems my fix not as solid as I thought.

Will see if its something I can fix over the weekend.

Regards

@Odianosen25 Odianosen25 added the bug Something isn't working label Aug 21, 2020
@pointlevel
Copy link
Author

Now a couple of hours later the sensors is different(correct) with same number of people in the house(actually also the same people), se below:

binary_sensor.everyone_home = off
binary_sensor.everyone_not_home = off

@Odianosen25
Copy link
Owner

Yes @pointlevel,

It’s the same bug reported. Initially it’s wrong, and after a while it’s head gets settled. I just need to find a reliable way to fix it, still no clue yet.

Regards

@skynet01
Copy link
Contributor

While we are on the subject of these variables it looks like they are being reset when HA restarts and then updated once scan is complete. This results in some automations being fired incorrectly. Here is my case scenario:

  1. people are home - binary_sensor.somebody_home = on
  2. -- HA Restarts --
  3. binary_sensor.somebody_home > gets set to off. > automation is fired because no one is home
  4. scan starts, people are found again
  5. binary_sensor.somebody_home > gets set to on > automation is fired because someone is home

I believe a solution is to preserve the state of these variables during restart and only update them after the scan is finished (if it's not already like this). Currently i had to add delays to my automations just to compensate for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants