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

this is a cool project, couple of questions: does the HA add-on still record stats for each cat i.e. in/out counter & total time for the catflap? Or would you have to keep track of that yourself, i.e. in NodeRed?
Does the DNS spoofing mean you can still use the SurePet phone app (whilst on your home network) or is all control through the add-on now? thanks.

Your pets will just show on/off (home/away). Any calculations you’d have to do. And you’ll only be able to control it via HA.

1 Like

thanks for the answer!

In fact there are four states, don’t forget “lookedin” and “lookedout”.
If you want a sensor with just the state “inside” or “outside” (which is useful in some cases) you need to create one via template:

      cat_shadow_where:
        friendly_name: Shadow_where
        value_template: '{% if (states("sensor.shadow") == "Inside" or states("sensor.shadow") == "Lookedout") %}inside{% elif  (states("sensor.shadow") == "Outside" or states("sensor.shadow") == "Lookedin") %}outside{% endif %}'
      cat_rocket_where:
        friendly_name: Rocket_where
        value_template: '{% if (states("sensor.rocket") == "Inside" or states("sensor.rocket") == "Lookedout") %}inside{% elif  (states("sensor.rocket") == "Outside" or states("sensor.rocket") == "Lookedin") %}outside{% endif %}'

Ahhh, I didn’t know those were represented as well. Does it just stay in that state if they never go in or out? That seems odd.

Hmmm, if the sensor has multiple states, going back to my previous request @peterl it would probably be preferred to have a service that sets the pet state (like the native SurePet integration), rather than changing the pet to a binary sensor?

I’m really sorry as this is probably not the place to ask. However, this audience is probably the only place I can find on the internet that might help.

Is there any trick to getting this hub setup? I’ve followed the brutally bad instructions but no matter what I’ve done I can’t get the hub added to my account.

Is there a known way to bypass the account setup and use this solution locally or do I need to get it setup and going with the app first?

Thanks!

I don’t believe that you need to connect it to the app first before using this local version. That said, what’s your issue? I found the onboarding process very easy.

Just can’t get the app or site to find and add the hub to my account. I’ve got the right ear lights (flash of orange then solid green), I click the pair button when prompted and… nothing. App/site won’t find the hub. The ears flash green for a bit and then go back to solid green.

That is odd. Maybe reach out to their support? Or just try using this local version!

Yeah very. I thankfully got it off amazon so I ended up returning it. Sure Petcare support is a ghost and doesn’t respond. Telephone support is long distance to UK only it seems. Will try a new one and see if that hub was just jank.

Weird. The interactions I had with their support team were awesome. Good luck with the new hub!

I would suspect @jscolp that the hub was already registered to an existing account and as @flyize suggested the only option is to go back via support to get the hub un-linked. The onboarding process is you need to connect on the same internet facing IP as the hub and login via https://surepetcare.io/ when the hub boots up. But if the hub is linked to an account that doesn’t work so going via support is the only option. I have found their twitter fairly good, but it can take a day or so for them to respond.
On the “local” edition yes you can download the firmware using:

pethublocal firmware -sn Hxx-0xxxxx
pethublocal credentials -sn Hxx-0xxxxx -mac 0000xxxxxxxx

And that will download the firmware locally.
Then you can start with a local pethubconfig.json and work offline, but you will need to ideally download the credentials and firmware from surepet simulating the hub first before you begin.
It’s on my todo… but work commitments and health issues have really removed any time for me to work on this for the last 3-4 weeks.

1 Like

Thanks Peter! That makes sense, must have been pre-registered. When I get a proper hub I’ll give it a go.

Thanks for your project and all your work. Will be happy to contribute document updates or things like that when I find time as well.

I’m banging my head over one question:

I’ve seen that the pets are configured globally in “pethubconfig.json” and not per device (cat flap). And I try to find a solution for this demand:

Our current cat flap connect lets the cats pass from the house into a secured outdoor area next to the house (which they can access 24/7). My plan is to replace a mechanical cat flap in the fence which is the passway for the cats to the “outside world” by a second cat flap connect, so I can control at which times the cats can leave the secured outdoor area into the “big outside”.

But there is currently only one global status sensor per cat: Inside/Outside/Lookedin/Lookedout

How can I get a status sensor per cat flap? That means, for each cat I want to know:

  • Is the cat inside or outside the home area (secured outdoor, flap #2)
  • Is the cat inside the house (flap #1)

Any ideas/comments? (@peterl )

With @peterl’s local version, I’m not so sure. However, I did it with the cloud version and NR.

In my case, we have a door from inside to a screened in porch. Then another door from the porch to outside. The easiest way for me to do it was to query the cloud and get the 20 latest events. If one of them matched cat house>porch, then change the cat’s status from outside to inside.

I posted the JSON somewhere here. Maybe this thread. It might give you some ideas to go on.

Hi @flyize ,

that’s exactly the setup I want to do. But without the cloud :wink:

As far as I understand Peters awesome message documentation, PHL should know which device has sent the message (also the cloud knows as the push message contains “Cat x left the house through [Device name]”)

So it should be possible to get not only one global state in the MQTT data for the pet, but in addition a state per device (door/flap).

I’ve put my thoughts into a Github issue: https://github.com/PetHubLocal/pethublocal/issues/10

Unfortunately I have no Python knowledge, so I’m not able to do this. In general it does not sound too complicate to me …

Personal question:
How is the cat flap doing in your screened porch? I guess it’s just protected from rain but exposed to high/low temperatures and outside humidity?
I want to install the second one into a gate of our secured outdoor area and build a “Weather roof” around the inside part …

They function just fine. One of them has been out there for probably 3+ years. The other one can occasionally be exposed to rain, so I just put masking tape over the battery compartment for some water resistance.

edit: And while I feel like a know a good bit of python, I’ve not yet been able to understand a single addon, or file, I’ve looked at. :frowning:

Good to hear that they survive with some protection. Where are you located, so I can get some idea about the weather conditions?

Tampa, FL. So yeah, they get abused.