Provide problem entity for SurePetcare integration

The recent API outage showed some weaknesses in the handling of abnormal conditions in the integration. In particular, except for the implausible status of pets, there was no apparent indication of a problem unless one checked the rarely-used SurePetcare web application. If one relied entirely on the mobile app, everything seemed to be all right. This lead, among other effects, to people instantly suspecting the integration to be at fault.

The situation could be improved if the SurePetcare integration exposed an entity of type “problem” with the following behavior:
The entity returns “normal” as long as the following criteria are met:

  • All devices have at least 15% battery remaining
  • All devices show as connected
  • All APIs are reachable and return codes in the 200-399 range (n.b. this would also catch failed authentications)
  • All APIs return sane data matching the expected structure, having all relevant fields present and filled

In case one or more of the criteria are not met, the entity has the status “problem”.

As an added bonus, the integration might file a repair with details of the problem whenever it set the entity to “problem” status

Implementing this would offer a quick canary to determine whether or not the data from the various entities of the integration can be trusted.

It would be fantastic to have this feature!

Especially since problems always seem to occur when we’re on holiday :slight_smile: . One time, the cats couldn’t get out of the house, and last time, they had no food because of a location error that I didn’t notice for three days! :disappointed:

1 Like

I have similar experiences. Once the cat flap would just lock up entirely after the timed curfew and the cats would frantically try to get in. Thankfully I saw them struggling on a camera (which I wisely keep pointed at the flap as a backup) and managed to fix the problem by repeatedly locking and unlocking the flap in the app. Another time the flap just failed open, letting in any cat, chipped or no (which is actually better imo, because while the cats may be facing unfriendlies in their home, at least they have a roof over their head.

In short, the reliability of the SurePetcare firmware and software is not the best, and every little effort to alert the user to an abnormal condition would help greatly.