tykeal / homeassistant-rental-control

Rental Control system for Home Assistant
42 stars 6 forks source link

Slots moved which breaks kwikset managed z-wave locks #163

Closed bmbouter closed 1 year ago

bmbouter commented 1 year ago

First off I love this integration. I love it so much I'm here to figure out how to keep using it. I have a smartcode 888 kwikset lock managed by keymaster. It's working with the airbnb calendar for me well. I have it managing slots 5-10. I have it configured with 5 door sensors.

Well about 12:18am one of my guests got locked out due to something strange happening here. Luckily someone else was inside and everything was fine.

What I noticed in the logbook was that right around then rental control "moved" the slots assigned to the different calendars. Specifically slot 5 was in-use and my current reservation was in that slot, but then around 12:18am it got moved to slot 6 somehow and I think all the other ones (there are only 4 reservations) also got moved.

So what happens with the kwikset is that if you try to assign it a code that it already has it won't "assign" it gets stuck at "Adding". This isn't keymaster or rental control's fault at all, but it's the way it is. I'm pretty sure when the shifting happened the moving of the code from slot 5 to slot 6 either happened out of order or very close to each other such that it was removed from slot 5 correctly, but it failed to actually add to slot 6. It was set to "enabled" so I'm not sure what more rental control could have done, according it the job was done as expected.

I'm mainly here with questions both in terms of what happened and what I could do about it in the future.

Let me know if there is anything I can provide to help out.

tykeal commented 1 year ago

I actually have the same problem occasionally. I have yet to figure out what is specifically causing the issue, but I have some suspicions.

  1. I had the issue most often when I was running HA off of a VM that was not always the most responsive, I resolved this by moving to a dedicated RPi4. I have only seen the issue once since moving to hardware, whereas I saw it semi-regularly when on a VM
  2. Slots can get rearranged during a restart if RC ends up firing certain events faster than the system is prepared for during startup. I've got extra delays already in RC to help prevent this, but it's still possible
  3. An update to the upcoming event calendar might (though it shouldn't) cause a re-arranging of the slots. I wrote it in such a way that this should not happen. I haven't actually seen this one happen since I put in protection code for it.

As to what you can do to limit this sort of thing from happening. Reduce your sensors from 5 to 2 or 1. If you have possible overlap, that is a guest leaves on same day that another comes in, then you need at a minimum 2. If you do not have overlap, then 1 will be fine.

You shouldn't need to do this, but it's the only way to pretty much guarantee that it won't happen.

I'm still trying to figure out what more I can do to keep things more solid. The shifting around has caused me a few anxious moments as well. I've even had it somehow try to reassign the slot back to itself but it sometimes confuses a Kwikset (which is all I use) when it gets a clear event followed by a code setting event to the same code all driven by Keymaster.

bmbouter commented 1 year ago

While Rental Control could stop moving slots and I would like that, here's what I found showing what keymaster could also to do fix the issue. https://github.com/FutureTense/keymaster/issues/310#issuecomment-1557419033

tykeal commented 1 year ago

The issue you commented on is already closed. I don't know if they would re-open the issue given what I see in the responses.

bmbouter commented 1 year ago

I clarified to them why they should reopen it here: https://github.com/FutureTense/keymaster/issues/310#issuecomment-1559784685

@tykeal any idea why rental control moves the slots?

tykeal commented 1 year ago

Not really. The way it's setup it shouldn't be doing that from my understanding of the code that I wrote! But I haven't really delved too deeply into it