[APP][Pro] Sure Petcare App - (Sureflap Pet Door/Sureflap Cat Flap)

Goodmorning

I too have multiple Pet Door Connects and would like to control them individually which does not seem to be possible as I cannot select a specific pet door under ‘THEN’, only the HUB it seems.

My use case is to close only the Pet Door in my Homeoffice door when I finish working there (by locking the door using a smart lock) and open it again when I return for work the next day (by unlocking the door) but that should not influence the Pet Door giving access to my house, that should remain open.

I’ve been reading through this whole thread but did not find any similar usecase except that of @Bernhard_Oberfrank who also owns multiple pet doors.

All suggestions in how to achieve my desired setup are welcome!
I’m using a Homey Pro 2023 V12.0.1 and V2.0.8 of the app
Thanks

Hello,
I have also found no solution to control different doors in flows but it is possible to set the status of each door in the devices manually - I will try to find a solution in Homey Script…

That would be great if you could manage that. I unfortunately am not savvy enough for that.

I was wondering if adding another hub might work as well (a costly solution of course for what seems to be a problem that should be easily fixed through a software setting), then each petdoor connects to its own hub. Not sure however if the Sureflap system allows two hubs in the same household…

Good luck with the script, hope you’ll find a way!

Hello,
I found the following code, but it does not work!


const email = ‘…’;
const password = ‘…’;
const deviceId = ‘…’;

async function lockCatFlap() {
try {
// Login to Sure Petcare
const loginResponse = await fetch(‘https://app.api.surehub.io/api/auth/login’, {
method: ‘POST’,
headers: {
‘Content-Type’: ‘application/json’
},
body: JSON.stringify({
email: email,
password: password
})
});

const loginData = await loginResponse.json();
const token = loginData.token;

// Lock the cat flap
await fetch(`https://app.api.surehub.io/api/device/${deviceId}/control`, {
  method: 'PUT',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': `Bearer ${token}`
  },
  body: JSON.stringify({
    locking: 0 // 2 = locked, 0 = unlocked
  })
});

console.log('Cat flap locked successfully');

} catch (error) {
console.error(‘Error locking cat flap:’, error);
}
}

lockCatFlap();

I think you should be able to add multiple sureflaps to the app.

Hi,
Yes, that is correct. You can add multiple flaps to the app but cannot control them individually in any other step then the IF step (so only as trigger for a flow). You cannot select them under AND or THEN (so as condition or output of a flow). There only the hub shows up which controls all individual devices simultaneously.

At least, I have not been able to do so :wink:

From a code perspective I cannot find that behavior what you describe. Can you give me an example of a flow that you want to achieve?

Yes sure,

When my smart lock locks my office (when the smart lock state is set to locked), the pet door installed in that office should keep all cats out (set state to exit only).
I will try to make some screenshots to make it more clear

Als = If
In this step I can see the individual pet door named Kattenluik Kantoor Paul
So i can trigger a flow using this individual pet flap

Dan = Then
In this step, the individual pet door is no longer selectable

What I can do, is instead of selecting a device, select the app. But then I can only select the Sure Petcare hub it seems and not this specific pet door anymore.

So what i want to achieve is that whenever my device named Kantoorslot is set to locked, the individual pet door named Kattenluik Kantoor Paul is set to keep all pets out

I can only achieve that for (what I believe is) the hub which also changes the state for the other pet door i have.

I hope this clarifies my intention a bit better
Thanks for taking the time to respond!