Sureflap Connect - Pet Door

Tags: #<Tag:0x00007f3f17c9e160>

A new product in the UK that I’m extremely interested in is the Sureflap Connect Cat Flap:

Linky

It communicated by mqtt to it’s “hub” and uses xively, which I understand is also the back end for a number of other products!

Now, a friend of mine has one of these, and if I could use this to trigger automation and add the cats as members of my “family group” I’d buy one in a flash!

The first thing is getting home assistant to pick up on the mqtt and broker etc… can anyone help with where to start? When people previously have been trying to access xively devices (lutron things I believe) was there a workaround to getting the credentials that I may have missed?

Thank’s in advance

Jack

I have one myself and would love to see where the cat is in the home assistant UI.

I managed to set up mitmproxy and log into the sure app with this and was able to capture the raw data.

, and the avitar for our pet.

There is nothing to share at the moment and so far i have only experimented a little bit.

Getting any further would require being able to authorize a connection to sureflap, and getting the id’s etc. The app doesn’t use mqtt, but rather http.
e.g. https://awshost/api/timeline/household/

FWIW, I asked Sure Petcare if they have a publically available API for integrating with third party applications. This was their response:

Thank you for your interest in the PetDoor Connect.

This question has been asked a couple of times, and we feel that in the future we may have an open API, but currently this is not something we can give to you or support.

Please do keep an eye on our website and social media feeds for any further updates on open API and other product integration.

Thanks guys, I guess fingers crossed they release something!

I have managed to reverse engineer a lot of their protocol, and managed to get something working.

It polls their servers every couple of minutes. and updates the status.

Though i am unsure of their device id, that their app sends on every update, i used a pseudo random one and it works fine. I will see if i can write it all up and link to some code.

Rene

6 Likes

You star rcastberg!

looking forward to it :slight_smile:

Nice one rcastberg - will be very excited to try this after our holiday in May (I’m in a change freeze right now :grinning:)

Great. I know I’ve exchanged several email about API’s with surepetcare before.

Personally I’d got as far getting to grips with the protocol, but not made the leap to HA.

Please release the code, does it support multi pet households ?

The code works for me at the moment, but can certainly do with other testers. It has been developed for my purposes, and therefor it is in the state it is in.

I have tried to document it a bit in the code and in the readme.

It should work for multiple pets, but it is very untested. It is “read only”, implying that i don’t set any parameters. Installing the python library is probably the hardest.

The home assistant integration is very basic, but it was what i had time for, idealy i guess you would create a hub, and attach any flaps to it and any pets to it. But this works for me at the moment, for me (i might have missed something that is different on somebody else’s app)

Be kind and don’t set the refresh interval too fast as this is polling sure’s rest server.
I am quite busy these days but will try to answer some questions, but won’t be able to guide you through this installation, so you will need some home assistant/developer skills.

5 Likes

Hi
Is it also possible to install this version in hassio?

Thanks for providing this rcastberg, getting a platform not found error so unfortunately can’t comment if this is working for me yet… I guess something isn’t installed right… I’ve checked and the dependancies are all in the folder ok, and so’s the custom_component…

Any suggestions would be welcomed

Thanks

Jack

Yes, that is the platform i use

@jackjohnsonuk Sounds like something is off on your installation.

When i do a search of my home assistant config folder, i get :
#find -name “sure*”
./deps/sure_petcare-0.1-py3.6.egg-info
./deps/sure_petcare
./tmp/sure_petcare
./custom_components/sensor/sure_petflap.py

Where i have removed most of the results for tmp/sure_petcare as this is the cloned repository i used to install the deps folder. Does yours match?

I’m hoping I’ll get the time to give this a whirl over this weekend - if so, I’ll be able to give some feedback on multiple pet households.

I could however use some pointers from anyone who’s installed it as to the clone / install process (I’m using a Python 3.6 venv on Ubuntu 16.04) - I appreciate rcastberg may be pushed for time so just a few pointers / gotchas should suffice.

In reference to polling refresh intervals, would I be correct in assuming that this is set in the get_data function in init.py? Or am I missing another location?

1 Like

Yes the polling intervals are fixed at the moment. We don’t want to overload their servers.
At the moment it is quite a hassel to install, but the guidelines written should allow it to work. But it should be easier if you are using a venv instead of a home assistant docker image.

I know somebody is working on a patch to upgrade many parts of the library, as he found some bugs, but i have no idea when he will be ready to post the updates.
But as it is at the moment it works for me.

1 Like

Great, thanks for the update.

Whether I get the chance to play this weekend or not it’s on my list of planned integrations. It all depends on whether my out of hours work maintenance goes according to plan and whether my ISP returns my connection which disappeared this morning.

1 Like

Received my Sureflap product today, so im gonna do some testing aswell

Received my Sureflap yesterday and just found this thread.
I couldn’t test anything yet, but your code looks great. :slight_smile:
Is it possible to also lock/unlock the door, or are you currently limited to just reading the data?

Have the same issue as @jackjohnsonuk. Everything is in the right folder but get the platform not found message.

If you get “platform not found” and everything seems in the correct place, hass probably can not find the sure_petcare Python package. Installing it solved it for me.