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.
Documentation: https://pethublocal.github.io/
Code: GitHub - PetHubLocal/pethublocal: Replacement for SurePetCare "Connect" cloud service connecting via MQTT to Home Assistant
There are two ways you can deploy PetHubLocal:
- Home Assistant OS / Supervisor Addon - GitHub - PetHubLocal/addon: Home Assistant addon Repository for PetHubLocal
- Standalone - GitHub - PetHubLocal/pethublocal: Replacement for SurePetCare "Connect" cloud service connecting via MQTT to Home Assistant
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.