I’m looking to reverse engineer the sureflap cloud backend.
This is a completely different approach to the built-in Home Assistant Integrations to the SurePetCare Cloud:
PetHubLocal requires you to poison the DNS entry the hub connects to hub.api.surehub.io to an internal host, so that the hub no longer connects to the Cloud service but it only connects locally.
To achieve this I have mostly reverse engineered the SureFlap Connect series hardware Hub. With a primary focus on “Me In The Middle” aka MITMing the traffic from the Hub to the SurePetCare cloud after figuring out how to open the AWS IoT MQTT Client Certificate by finding how the password is calculated on a per-hub basis. This has involved building a python frontend and Hub <-> Home Assistant translation to translate MQTT messages generated by the hub into Home Assistant messages and vice versa.
The HAOS Addon assumes you are using the embedded Mosquitto MQTT Broker and deploys the addon along side exposing the ports required by the hub (80/443/8883) and connects back to the main broker.
Standalone you can deploy it in a Docker container, or run it interactively using tmux or something to keep it running as a background process.
I recommend you start at the documentation to understand how it all fits together, and if updating your internal DNS, and potentially flashing custom firmware onto your hub if it has been upgraded sounds all a bit too much then this project probably isn’t for you.
Does anyone have a H004 serial number hub? There seem to be 10 revisions from H001 to H010. If so I wouldn’t mind if you could PM me your serial number and the mac address of the hub.
So it appears it might be easier to reverse the air protocol and build a custom gateway. Anyone else with a CC2531 that ideally has the external antenna as then you should be able to pick up the Miwi traffic from the hub and the door / feeder and interested in running a docker image to sniff traffic.
Do you still need someone to help with a pet door? I see the above github repo only works with the feeders currently. Would love to move my door over to mqtt locally. Cloud is more down than up for me for some reason.
I have a feeder and pet door. So am working on both. Need to confirm everything is the same with the cat flap. But so far it looks to all use the same messages.
The hardware required will probably end up being something very similar to this project. With just a esp32 or 8266 and the MRF24J40. https://doc.riot-os.org/group__boards__esp32__mh-et-live-minikit.html
I like the idea of the ESP with MRF24J40 more than a Pi3. Really excited.
I do like the MH-ET LIVE MiniKit setup, but can’t find it anywhere. Looks like we either email that email address on that site or look at the easier obtainable arduinos.
I have just published my first initial cut of the Wemos ESP32 Arduino code with the MRF24J40 radio controller.
My focus is similar to Mark having a local hub as the constraints of re-using the existing hub were such that I couldn’t easily use it.
Currently the code segfaults every few minutes due to an issue with the interrupt handler which I think should be fairly easy to solve and plan to do that over the next few days. I also have python code I am working on to take all the messages off the MQTT topic that the Wemos Hub puts on and converts them into Home Assistant messages. The code is incredibly rough but will commit it when I am feeling happier with it.
Do you think in future a CPL and BOM can be included to make it easier to let jlcpcb do the SMT assembly? Just asking for others, for now I will print and diy.
Unfortunately JLCPCB doesn’t support the MRF24J40MA so you can’t have them do it for you. But the MA is a single PCB that solders directly only the fabricated PCB so it is a super simple job to solder on. I have sourced the MAs from rsonline or Ali and they are a standard component which is slightly on the more expensive side for Zigbee radios.
However if you don’t mind opening your hub or perhaps you bricked it there is one inside there too.
Added further documentation to the feeder message decode the feeder messages:
And the issue I have around the calculation of the CRC value of the frame and if it is an xored value or not, plus there are two digits I am not sure about for the xor key that I would like to figure out.