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

**URL:** <https://community.homey.app/t/app-pro-sure-petcare-app-sureflap-pet-door-sureflap-cat-flap/24127>\
**Category:** Apps\
**Tags:** app, presence\
**Created:** [January 9, 2020, 6:36pm UTC](https://community.homey.app/t/app-pro-sure-petcare-app-sureflap-pet-door-sureflap-cat-flap/24127 "2020-01-09T18:36:48Z")\
**Posts on this page:** 11\
**Page:** 19

<div class="post-metadata">

**Author:** ![pvdspek](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/pvdspek/32/120831_2.png) [@pvdspek](https://community.homey.app/u/pvdspek)\
**Post date:** [June 19, 2026, 4:57pm UTC](https://community.homey.app/t/app-pro-sure-petcare-app-sureflap-pet-door-sureflap-cat-flap/24127/369 "2026-06-19T16:57:13Z")

</div>

Hi, great app.

However I’d love to have a status indicator on the tile, showing the battery level of the cat flap.

---

<div class="post-metadata">

**Author:** ![gtankovics](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gtankovics/32/49363_2.png) [@gtankovics](https://community.homey.app/u/gtankovics)\
**Post date:** [July 23, 2026, 8:44am UTC](https://community.homey.app/t/app-pro-sure-petcare-app-sureflap-pet-door-sureflap-cat-flap/24127/371 "2026-07-23T08:44:47Z")

</div>

Great application. Status indicator on tiles should be great or hub LED controls as well.

Exp. if a pet is inside the hub light will be on if it is out it will be off. During night should decrease the light intensity

---

<div class="post-metadata">

**Author:** ![Ollifant69](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ollifant69/32/8191_2.png) [@Ollifant69](https://community.homey.app/u/Ollifant69)\
**Post date:** [August 16, 2026, 7:35pm UTC](https://community.homey.app/t/app-pro-sure-petcare-app-sureflap-pet-door-sureflap-cat-flap/24127/372 "2026-08-16T19:35:31Z")

</div>

Hi Koktail, thank you for the nice SurePet-flap app for Homey !

The flowcards ‘a pet left the house’ en ‘“find pet” has left the house’ or came back home variants seem not to work as I expect. I cannot add the name of the pet, this is preventing the Homey Flow to execute. Do I do something wrong, or is this a bug in the flowcards ?

kr, Ollifant

SOLVED , homey app logoff , logon : name visible in the flowcard.

---

<div class="post-metadata">

**Author:** ![sverrelp](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sverrelp/32/168183_2.png) [@sverrelp](https://community.homey.app/u/sverrelp)\
**Post date:** [August 23, 2026, 1:26pm UTC](https://community.homey.app/t/app-pro-sure-petcare-app-sureflap-pet-door-sureflap-cat-flap/24127/373 "2026-08-23T13:26:13Z")

</div>

**Future request:** Make the app do global timeline in Homey 🙂

---

<div class="post-metadata">

**Author:** ![Koktail](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/koktail/32/51498_2.png) [@Koktail](https://community.homey.app/u/Koktail)\
**Post date:** [September 9, 2026, 12:31pm UTC](https://community.homey.app/t/app-pro-sure-petcare-app-sureflap-pet-door-sureflap-cat-flap/24127/374 "2026-09-09T12:31:06Z")

</div>

Changes in 3.0.0 (test):

- Added support for the Felaqua Connect water dispenser
- Added a flow condition card to check whether a pet is home
- Added insights for the bowl weight, so you can track feeding over time
- Improved translations for flow cards and store texts, now including Arabic

---

<div class="post-metadata">

**Author:** ![RayCokes](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/raycokes/32/12452_2.png) [@RayCokes](https://community.homey.app/u/RayCokes)\
**Post date:** [September 24, 2026, 6:55pm UTC](https://community.homey.app/t/app-pro-sure-petcare-app-sureflap-pet-door-sureflap-cat-flap/24127/375 "2026-09-24T18:55:24Z")

</div>

Hi there,

When a feeder plate is filled. Only testing works if flow. The flow itself does not start with that.

Any hint?

---

<div class="post-metadata">

**Author:** ![sverrelp](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sverrelp/32/168183_2.png) [@sverrelp](https://community.homey.app/u/sverrelp)\
**Post date:** [October 10, 2026, 5:51pm UTC](https://community.homey.app/t/app-pro-sure-petcare-app-sureflap-pet-door-sureflap-cat-flap/24127/376 "2026-10-10T17:51:27Z")

</div>

. Hidden

---

<div class="post-metadata">

**Author:** ![Thomas\_Veivag](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/thomas_veivag/32/16677_2.png) [@Thomas\_Veivag](https://community.homey.app/u/Thomas_Veivag)\
**Post date:** [October 18, 2026, 8:57pm UTC](https://community.homey.app/t/app-pro-sure-petcare-app-sureflap-pet-door-sureflap-cat-flap/24127/377 "2026-10-18T20:57:54Z")

</div>

Continuing the discussion from [[APP][Pro] Sure Petcare App - (Sureflap Pet Door/Sureflap Cat Flap)](https://community.homey.app/t/app-pro-sure-petcare-app-sureflap-pet-door-sureflap-cat-flap/24127):

Hi! First of all, thank you for maintaining the Sure Petcare app for Homey.

I recently ran into an issue where the app suddenly started failing every 60 seconds with `AxiosError: Request failed with status code 401`.

After inspecting the stored `token` in the app settings, I found the root cause:

1. The JWT bearer token issued by `https://app.api.surehub.io/api/auth/login` has a fixed **1-year expiration (`exp`)**.
2. Once that 1-year timestamp passes, the app continues polling every minute using the expired token from `homey.settings.get('token')` and emits an error log event on every poll. Restarting the app does not renew the token either, because the expired `token` string is still present in settings.

**Suggested improvement — a built-in `refreshToken()` function in the app:** Since the app already stores `username` and `password` in `homey.settings`, adding a dedicated `refreshToken()` method in the app class would solve this completely:

1. **Proactive check on startup & daily timer:** Decode the JWT `exp` claim locally in `refreshToken()`, and if the token is missing or expires within the next 14 days, automatically authenticate against `/api/auth/login` using the stored credentials and save the new token via `homey.settings.set('token', newToken)`.
2. **Reactive fallback on HTTP 401:** If any API poll returns `HTTP 401 Unauthorized`, call `refreshToken()` once (with a cooldown/backoff guard to prevent login loops if a user changed their password) and retry the request.
3. **Optional Flow Action Card / Settings button:** Expose `refreshToken()` as a Flow action card (_“Refresh authentication token”_) or a button in the app settings page so users can also trigger a manual token refresh without having to re-enter their credentials.

Thanks again for your work on the app!

---

<div class="post-metadata">

**Author:** ![Thomas\_Veivag](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/thomas_veivag/32/16677_2.png) [@Thomas\_Veivag](https://community.homey.app/u/Thomas_Veivag)\
**Post date:** [October 18, 2026, 9:03pm UTC](https://community.homey.app/t/app-pro-sure-petcare-app-sureflap-pet-door-sureflap-cat-flap/24127/378 "2026-10-18T21:03:07Z")

</div>

I Use this for now:

// Auto-renew Sure Petcare 1-year JWT token if \< 14 days remaining

const settings = await Homey.apps.getAppSettings({ id: ‘com.sure-petcare’ });

if (!settings || !settings.username || !settings.password) {

return;

}

let needsRenewal = false;

let deviceId = ‘552961069’;

if (!settings.token) {

needsRenewal = true;

} else {

try {

```
const parts = String(settings.token).split('.');

const payloadJson = Buffer.from(parts\[1\], 'base64').toString('utf8');

const payload = JSON.parse(payloadJson);

if (payload.device_id) deviceId = String(payload.device_id);

const daysLeft = (payload.exp \* 1000 - Date.now()) / (1000 \* 3600 \* 24);

log('Sure Petcare token days left:', Math.round(daysLeft));

if (daysLeft < 14) {

  needsRenewal = true;

}

```

} catch (err) {

```
needsRenewal = true;

```

}

}

if (!needsRenewal) {

return;

}

const res = await fetch(‘[https://app.api.surehub.io/api/auth/login](https://app.api.surehub.io/api/auth/login)’, {

method: ‘POST’,

headers: {

```
'Content-Type': 'application/json',

'Accept': 'application/json, text/plain, \*/\*',

'User-Agent': 'Mozilla/5.0 (Linux; Android 13) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Mobile Safari/537.36',

'Origin': 'https://surepetcare.io',

'Referer': 'https://surepetcare.io/'

```

},

body: JSON.stringify({

```
email_address: settings.username,

password: settings.password,

device_id: deviceId

```

})

});

if (!res.ok) {

throw new Error('SureHub login failed with HTTP ’ + res.status);

}

const json = await res.json();

const newToken = json && json.data && json.data.token;

if (!newToken) {

throw new Error(‘SureHub login response did not contain token’);

}

await Homey.apps.setAppSetting({

id: ‘com.sure-petcare’,

name: ‘token’,

value: newToken

});

await Homey.apps.restartApp({ id: ‘com.sure-petcare’ });

await Homey.notifications.createNotification({

excerpt: ‘Sure Petcare: Innloggingstoken ble automatisk fornyet for 1 nytt år!’

});

---

<div class="post-metadata">

**Author:** ![Koktail](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/koktail/32/51498_2.png) [@Koktail](https://community.homey.app/u/Koktail)\
**Post date:** [October 26, 2026, 3:14pm UTC](https://community.homey.app/t/app-pro-sure-petcare-app-sureflap-pet-door-sureflap-cat-flap/24127/379 "2026-10-26T15:14:45Z")

</div>

I don’t own any Sure Petcare product anymore and have transferred the app to @sverrelp. Thank you for improving the app for the community! 🙏

---

<div class="post-metadata">

**Author:** ![sverrelp](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sverrelp/32/168183_2.png) [@sverrelp](https://community.homey.app/u/sverrelp)\
**Post date:** [October 26, 2026, 3:59pm UTC](https://community.homey.app/t/app-pro-sure-petcare-app-sureflap-pet-door-sureflap-cat-flap/24127/380 "2026-10-26T15:59:51Z")

</div>

I am grateful for the trust placed in me to take over such a great app.

I already have a completely redeveloped version, but since I don’t yet fully understand the existing architecture or potential bugs, I need to evaluate whether to integrate it with new features or take a different approach.

The new features include widgets, app-level settings, and a brand-new driver for pets. I’ve also added new flow cards. My primary goal is to ensure that these new features are working optimally. After that, I’ll decide whether to implement them into the existing app!

[Previous page](https://community.homey.app/t/app-pro-sure-petcare-app-sureflap-pet-door-sureflap-cat-flap/24127.md?page=18)
