Local Deployment for SureFlap / SurePetCare Connect using only local MQTT Broker

Are there any non-solder solutions, as my essential tremors made soldering a fools errand?

So @mretallack solution uses a Raspbery Pi and shields plugged in the top. https://github.com/mretallack/catfeeder so that requires no soldering but is a larger form factor than what I am trying to build with the Wemos + MRF Shield.

1 Like

And added my docker compose to run as a local backend to collect the messages:

Thanks for the heads up. The readme seems to suggest that it only works for the feeder. Any idea if it works for the pet door too?

Mark only has a feeder so hasn’t had to build for the door.
I have both and plan to build to support both but one thing I still need to sort is how the CRC is calculated as without that the door or feeder will reject all my commands.
Development assistance there would be gratefully accepted.
That is what I documented in issue #1 on my repo.

I’d love to help, but am totally useless. Thank you so much though for your work.

So good news and bad news.
Good news I have figured out how to send messages to the pet door and feeder using the surepet hub, bad news is the messages for the Cat Door and Pet Door are completely different. The cat door is very similar to the feeder so someone who has a cat door will need to figure it out. But the good news is if I send a frame like this to my door it locks:

**TS** 1000 2 36 1 01
**TS** 1000 2 36 1 02
**TS** 1000 2 36 1 03
**TS** 1000 2 36 1 04

Where the TS is a Unix Timestamp, and the last byte is the lock state.
This is a bit of code I wrote to create the message:

def mqttfeeder(value):
  ts = hex(round(datetime.utcnow().timestamp()))[2:]
  return ts + " 1000 " + message

Lots of code changes is my packet handling python https://github.com/plambrechtsen/pethublocal/blob/aa44c2a7bd108d2aede35289d13f72bb91e51b51/PetHub/pethubpacket.py to support lots of different messages I have discovered.
Still very time constrained so can’t spend a whole lot of time on this.

4 Likes

nice job peter :clap::clap:

So… if anyone who has a Cat Door (and not a Pet Door) and also has a CC2531 Zigbee sniffer can spin up the zigsniff docker container.


Ideally the CC2531 should be one of the ones with an external antenna as per the above link to AliExpress as the ones with no external antenna are complete rubbish. Then try doing the Lock / Unlock functions via the App and then do them again using the button on the Cat Flap, then we can get that added too.

I have the cat door, so I can help if I buy this?

edit: Could this work?
https://www.amazon.com/Acxico-Bluetooth-Wireless-Analyzer-External/dp/B081WRGL31/ref=sr_1_3?dchild=1&keywords=cc2531+zigbee+sniffer&qid=1616595609&sr=8-3

Should be okay for this case :slight_smile: But as @peterl is the master here, please wait for his confirmation too :smiley:

1 Like

This one: https://www.aliexpress.com/item/1005001973568180.html
And make sure you select the “CC2531” not the CC2540, as the CC2540 is Bluetooth and won’t work.
The Amazon link you posted is only for the CC2531 and not the “CC Debugger” which is the flasher which if you don’t already have one you need to purchase it as it is required to flash the CC2531 with the right firmware. You only need to flash the CC2531 once and the CC Debugger isn’t required for standard operation so if you know someone with one of them then you can borrow it.
Otherwise this has the 8db antenna instead:
https://www.aliexpress.com/item/4000439492385.html
But it needs to have the external antenna as the ones without antenna are terrible.

Darn, I was hoping to find one on Amazon so I wouldn’t have to wait a month to get it.

I have made really good progress on the messages and if you setup the docker stack and redirect the DNS entry for hub.api… then you should be able to see a lot of messages. Also check out my mksurepetdb under PetHub to see if the database script gets created. Lots of strands to tie together.
And that one off Amazon will work, but you will need the CC Debugger to program it first.
This is the complete kit but that CC2531 is the rubbish one with a terrible antenna.
https://www.amazon.com/Bluetooth-Emulator-CC-Debugger-Programmer-Protocol/dp/B081VP2LDW
If you can find one with a CC Debugger with the little adapter too to take it from a larger ribbon connector down to the small one then you should be fine.
I hope to have a full hub based solution soon enough I am just time poor.

1 Like

So I am just finishing up the finer point on my code over the next few weeks. If folks have a look at the docker compose here.

As that and the PetHub packet code https://github.com/plambrechtsen/pethublocal/tree/main/PetHub is where the main code is happening.

First step is to convert the start api response into a local SQLite database to use that as an ongoing reference for mapping tags and devices to their names.

I think creating a mqtt discovery configuration is the best way to manage it as then the entities just turn up in HA. Otherwise a full component will need to be written.

Crap. I went to order that one and it seems that it ships from China too. #FML

So I now have the feeder and continuing to work on the door for operations.
Would be interested in feedback of getting it working and I don’t have a cat door so I don’t know what those messages are so logs of that would be great.
If you follow the instructions here see how you go.

Can you confirm these would work? Both are available to me quickly via Amazon Prime.

https://www.amazon.com/Debugger-Downloader-Programmed-Simulation-Programmer/dp/B07T13JX32/
https://www.amazon.com/Acxico-Bluetooth-Wireless-Analyzer-External/dp/B081WRGL31

Peter your work looks really good!
Sorry for this noobish question…

You can buy the Smart Connect Cat door without an official Sureflap connect HUB (
ean: 5060180392550)
Will your solution work without the official hub or do you need it and place and extra hub inbetween that intercepts the trafic between the door and the official hub?

It’s missing the bit in the middle which is the adapter from the large to small ribbon cable. https://m.aliexpress.com/item/32767478130.html

But you don’t need the debugger as the docker solution provides a work in progress backend to the connect hub.
Have you tried deploying the docker compose stack and altering the dns in your network to point the hub.api domain to your docker stack?? As that should now mostly work. I am just considering the best way to now connect up the MQTT messages I have parsed into a home assistant component.