Kevo Plus door locks now working in Home Assistant

Well I haven’t abandoned Kevo yet after reading a lot of bad things about Level Lock+ lately. I may give this another try after I finish up another integration I’ve been working on the last few weeks which is a bit more complex and taught me a lot. That said, now that I have a few HA integrations under my belt, I realized this integration (and the underlying library) really need to be completely rewritten from scratch. I think part of the issues with the original integration is based on the way this was all written.

It looks like Kevo is releasing a new website with a new interface (much better), and doesn’t seem to require reCaptcha. It even looks like it offers a websocket that provides realtime lock status updates instead of needing polling. Not sure if I plan to take on this project just yet though

Alright, I was bored this week. I’ve written a python library that can communicate with the locks properly and doesn’t suffer from captcha limitations. This is a complete rewrite of the underlying library to use the new Kevo website (which means you’ll need to opt into that to make this work). Next step is to completely rewrite the custom component to use this new library. Seems to work a lot more reliably. The new integration will be UI based instead of yaml because now I know how to do that :slight_smile:

3 Likes

Top work, got a link to the repo?

The library is located here GitHub - dcmeglio/pykevoplus: A python3 version of pykevoplus by cseelye but the updated integration isn’t published yet. I haven’t started coding it yet.

Nice! got a https://www.buymeacoffee.com/ ? so i can get you that beer

I do, Dominick Meglio but let me actually get it working first :slight_smile:
Also a question – does anyone have a non-Kwikset Kevo lock such as Baldwin? The new API seems to have some IDs that are specific to Kwikset so I’m guessing I’d need some help finding the values for other brands.

Just kwikset for me.

1 Like

I mostly have it working now, just need to do some error handling and testing:

It supports all the built in lock entity features locked/unlocked/locking/unlocking and jammed status. I can also pull the battery level

2 Likes

Seems to be working pretty well for me, GitHub - dcmeglio/home-assistant-kevo: Kevo Custom Component for Home Assistant let me know if you hit any issues and also if anyone is using a Baldwin or Weiser lock let me know if it works. I only have Kwikset to test with.

1 Like

So far so good - fwiw the icons are broken.

Screenshot from 2022-12-29 20-21-16
Screenshot from 2022-12-29 20-21-02

1 Like

Icons aren’t actually part of the integration, they are part of an HA managed system. I submitted a PR to get the icons added, but until this gets merged by the HA team it will show broken icons Kevo plus by dcmeglio · Pull Request #3977 · home-assistant/brands · GitHub

@dman2306 Integration appears to be working better than the stupid Homebridge to Home Assistant back to Homebridge thing I had going on before. How often does this poll for status? It seems to just stop polling after a bit and I end up with a stale lock/unlock state in the UI until I reload the integration.

It doesn’t poll. It connects to a websocket that reports the updates as soon as they’re available. Two things:

  1. Do you see any errors in the logs?
  2. Try creating a separate username/eKey for Home Assistant. I noticed the websocket doesn’t seem to like if you’re logged in to the mobile app using the same username so I created a separate eKey just for Home Assistant and I haven’t had any issues since.
1 Like

No errors in the logs associated with Kevo Plus. Reloading the integration fixes it instantly. I have a Kevo account just for Home Assistant as well as with my other workaround it also did not like having the mobile app logged in with the same credentials. I did just notice my PC was logged in with the same account from when I did the opt in to the new interface so I’ve logged out and perhaps it was that.

That’s possible. Let me know if it fixes it. If not I’ll see if I can add some increased logging around the websocket to track it down.

Yeah, still no dice. I am able to lock/unlock with the button in the interface but even after the lock shows “2 hours ago”. If I restart the integration it works as expected but it just seems to timeout or close the connection after a while?

My connection has been open for 8 days and still providing updates, so it’s not supposed to just close. But something could be causing disconnects. If you get disconnected the logs should show an error of Lost connection to websocket

I’ll try to do some more testing this week of the reconnect logic.

well crap on a crap cracker. I was noticing some oddities with it, so decided to create a seperate account just for HA. Now getting errors was trying to set it up.

Logger: custom_components.kevo_plus.config_flow
Source: custom_components/kevo_plus/config_flow.py:55
Integration: Kevo Plus ([documentation](https://github.com/dcmeglio/home-assistant-kevo), [issues](https://github.com/dcmeglio/home-assistant-kevo/issues))
First occurred: 3:44:56 PM (3 occurrences)
Last logged: 3:55:47 PM

Unexpected exception

Traceback (most recent call last): File "/config/custom_components/kevo_plus/config_flow.py", line 55, in async_step_user await self._api.login(user_input["username"], user_input["password"]) File "/usr/local/lib/python3.10/site-packages/aiokevoplus/__init__.py", line 340, in login res.raise_for_status() File "/usr/local/lib/python3.10/site-packages/httpx/_models.py", line 745, in raise_for_status raise HTTPStatusError(message, request=request, response=self) httpx.HTTPStatusError: Server error '500 Internal Server Error' for url 'https://identity.unikey.com/account/login' For more information check: https://httpstatuses.com/500

Definitely a problem with the websocket reconnect logic, I’m working on it.

Did you try more than once? A 500 could just be an intermittent server error