Sureflap Connect - Pet Door

hm outages? I implemented some stuff in my sureha integration… lets hope there is no relation :sweat_smile:

@the others… Surepetcare integration update & config flow by benleb · Pull Request #53399 · home-assistant/core · GitHub that’s the PR pushing the core integration to almost the level of GitHub - benleb/sureha: dev branch of the Home Assistant surepetcare integration - but I think that one will not go through without some remarks in the review, so could take some days :confused:

3 Likes

I just saw on their twitter timeline:
https://twitter.com/SurePetcare/with_replies
Nothing to do with your integration I am sure, but who knows what surepet have done to the client API that you’re leveraging @benleb as they were saying you need to update the app.

Hi all.

Is this integration working on 2021.7.4? I’m still on 2021.5.0 as it works perfectly. I tried updating to 2021.7.4 but I had issues with locking/unlocking the door and the cats’ location wasn’t updating. Also in 2021.7.4 they’ve got rid of composite which I use for the cats’ location.

   - platform: composite
     name: Vaska
     entity_id:
      - binary_sensor.pet_vaska 

I would really like to update but don’t want to lose this integration! as it is one of my most important integrations.

Thanks

I’m using the beta, and it works fine.

Are you able to call service to lock/unlock the door?

Where do I find this version?

I’m going to do a test update and try it out as this (and my custom component securitas_direct) did not work when I tried to update last time. Funny enough this and the securitas_direct integrations are the two most important that I use and were the two that broke on updating

I currently use composite for my cat. I believe this has been discontinued in later versions of HA.
What do you use for your cat to show home or not_home?

Thanks

Sure, the lock service works as expected.

Ok so I have done the update and downloaded the code and put it in my custom_components folder

A step closer. Still not working though:

Logger: homeassistant.helpers.integration_platform
Source: loader.py:503
First occurred: 14:36:28 (6 occurrences)
Last logged: 14:37:08

Unexpected error importing sureha/system_health.py
Unexpected error importing sureha/logbook.py
Unexpected error importing sureha/group.py
Unexpected error importing sureha/media_source.py
Unexpected error importing sureha/significant_change.py
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/integration_platform.py", line 33, in _process
    platform = integration.get_platform(platform_name)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 498, in get_platform
    cache[full_name] = self._import_platform(platform_name)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 503, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'custom_components.sureha-dev.recorder'

Think I’ve got it

1 Like

Is composite no longer working in the latest HA?

I had a lovely badge for my cat that changed based on his location but I get an error now:

Platform error device_tracker.composite - Integration 'composite' not found.

Is this the way to sort out composite?

Thanks

Couldn’t you just use the binary_sensor created for the pet to show home/away?

All it shows is a picture of the cat

image

The fist badge is the composite I had before. The last badge is the binary sensor which doesn’t show anything…

Ahhh, maybe I don’t understand how badges work then, as I don’t use them. If you’re interested, here’s what mine looks like.

image

2 Likes

Thanks man got it working :slight_smile:

1 Like

How much delay are you experiencing?

I’ve tested setting the cat to inside on the Sure Petcare app and watching HA, there is at least a 2/3 min delay on mine

That’s not an unexpected delay, that’s simply how often we call the sure api (every 3min currently i think). This is some kind of „protection“ for us. Sure never agreed to this kind of usage but they also did nothing to stop or block us… So it’s something like an unspoken agreement at the moment and therefore I don’t want hammering their servers with calling the api every 10s or anything. For me that’s absolutely acceptable. If you have a case where that’s to much, we can talk about!

And about the device tracker… I also would like one and it’s partly implemented in my private repo but it’s not the highest prio task currently :confused:

2 Likes

Yes, I totally understand :+1:

I got it all working with the binary sensor and composite.

This is my favourite integration on HA so thank you so much for all your hard work

Since I’ve seen a lot of homebrew software rely on polling an endpoint, is it safe to assume its hard/impossible to get push notifications like the app does?

You could use the binary sensor to drive a device_tracker using the device_tracker.see service if you prefer.

1 Like

yes… One would have to „emulate“ an iOS or Android device (against Apple/Google, not just Sure Petcare) to achieve this. Push notifications are sent from Apple/Google servers and not from Sure and they send it just to „registered devices“ from their view…

I don’t know if someone has achieved this in general?! Writing some code to trick apple or google that far that they think it’s really one of their(!) devices…?

And my opinion… if someone has the skill to do this, it probably wouldn’t burned (as they will patch it ;)) for a smart cat flap…

1 Like

There is two ways to get more frequent updates. Either use my integration that takes the raw MQTT messages and use that or increasing to polling frequency but that may cause issues with sureflap getting grumpy with you.
The doors itself have around a 5-10 second delay from when the event occurs to when the MQTT message is sent anyway and it varies between devices connected to the hub from what I have seen.