Sureflap Connect - Pet Door

Just moved to 2021.2.1 and the locked-state service is present and operational!

Only thing missing now is being able to set curfew state. The (rather unlogical) logic of the Sure Petflap is that when you move out of curfew mode into any locked/unlocked state, you lose any previous curfew mode and have to re-set it from the Sure application.

I’m not sure how this can be done; on the app, it seems to re-send the curfew parameters (start and end times) out to the flap each time you set curfew mode. I may be wrong on this but it’s the impression I get from using the app.

Nice! My plan is to ditch the curfew mode and just have an automation which locks and unlocks the flap based on the sun rise and sunset times.

That’s definitely a thought. I’ll need to progress my HA skills a bit first though! Still on a steep learning curve!

  • @Eeeeeediot - the homeassistant.update_entity service doesn’t work with this integration at the moment. I’ve got plans for how to fix that, but I’ve got vastly more plans than I have time to implement them, so we’ll see how that goes
  • @bda55 - A card for this would be awesome! I’ve rigged up a simple UI for mine using https://github.com/jcwillox/lovelace-paper-buttons-row

      - type: entities
        title: Cats
        entities:
          - type: "custom:paper-buttons-row"
            buttons:
              - entity: "sensor.pet_flap_lounge_cat_flap"
                name: "Unlocked"
                icon: "mdi:lock-open-variant"
                state_styles:
                  "Unlocked":
                    icon:
                      color: "rgb(5, 147, 255)"
                    text:
                      color: "rgb(5, 147, 255)"
                tap_action:
                  action: "call-service"
                  service: "surepetcare.set_lock_state"
                  service_data:
                    flap_id: 4xxxxxx
                    lock_state: "unlocked"
              - entity: "sensor.pet_flap_lounge_cat_flap"
                name: "In-only"
                icon: "mdi:lock"
                state_styles:
                  "Locked_in":
                    icon:
                      color: "rgb(5, 147, 255)"
                    text:
                      color: "rgb(5, 147, 255)"
                tap_action:
                  action: "call-service"
                  service: "surepetcare.set_lock_state"
                  service_data:
                    flap_id: 4xxxxx
                    lock_state: "locked_in"
          - entity: binary_sensor.pet_astrid
          - entity: binary_sensor.pet_chell
  • As far as curfew mode goes, I don’t think there is a whole lot of use in implementing support for that in HA - you can achieve the same thing using automations. Personally I don’t unlock the flap automatically, but have an automation that:
    • Check at 40 minutes before sunset if the flap is unlocked and noone is home. If so, it locks the flap then notifies me, including information about which cats are still outside
    • Checks again at 20 minutes before sunset, if the flap is unlocked it locks the flap and notifies me
2 Likes

Thanks for all your efforts on this, its looking great! Your automation using sunset is similar to what I was thinking.

Are there any plans to implement pet status override from HA? I can’t see any recent discussion on this. My 2 cats regularly confuse the flap as to who is in and out.

A pet status override would be great. We often open a door and a cat will use the opportunity to avoid the flap.

@benleb has added support for changing the status of a pet to surepy (the library the integration uses), but its not been added to the home assistant integration itself yet.

My current priority is getting the update_entity service fixed then adding support for setting pet state

1 Like

OK Thanks :slight_smile:

Excellent, @insertjokehere @benleb where can we buy you guys coffee/beer/stuff?

Thanks for this post . It really helped me out :slight_smile:

I am using a filter to show outside and inside status with different icons and another filter card to show locked and unlocked.

I’m wondering if there is a way to create a badge that shows mdi:home when my cat is in and a different icon for when he is out?

Also, what is the ideal scan_interval? I see there are some posts on this and with my setup there is a delay of around a minute. This I would like to get down a little as I plan to use the flap to turn on and off my alarm panel when me and my wife are out. The automation would turn the alarm on when my cat is out and turn it off when he is in but the delay will set it off. I thought maybe a motion sensor camera could trigger an automation to check for the flap status change.

That is very generous, Ben has done vastly more work than I have

Thank you so much for all of your hard work on this project.

I think I have everything availbale up and running.

Question: Do you know if it is possible to make my cat’s status badge the same as a device_tracked badge showing home and away like it is for my wife and I?

image

Ive used this for a while now and don’t display the location information.

I took a close up picture of the cat and converted a copy to black and white.
I then use these pictures to donate whether the cats in (colour pic.) or out (B/W pic.) Works well.

      - type: picture-entity
        entity: binary_sensor.pet_bo
        show_name: false
        show_state: false
        state_image:
          'on': /local/bo_in.jpg
          'off': /local/bo_out.jpg
1 Like

That’s really cool.

Thanks

Hi guys,

First of all thank you for this great integration! I just got this upp and running and everything is working OK. I´m running the latest HA version. Enyone else get this in the logg:

Logger: homeassistant.util.async_
Source: util/async_.py:129
First occurred: 9:20:31 PM (1 occurrences)
Last logged: 9:20:31 PM

Detected I/O inside the event loop. This is causing stability issues. Please report issue for surepetcare doing I/O at homeassistant/components/surepetcare/init.py, line 114: device_data = await surepy.device(device[CONF_ID])

Looks like there is an open issue for this.

image

I used the composite device tracker to turn the binary sensor into a device_tracker and then created a person for my cat and used the composite device tracker.

device_tracker:
  - platform: composite
    name: Nero
    # time_as: device_or_local
    entity_id:
      - binary_sensor.pet_nero
1 Like

Awesome thank you! Works perfectly :slight_smile:

I have started to experience issues with the Sure PetCare integration connecting on startup. If I reboot HA I find that more often than not, the Sure PetCare integration fails to startup … I can usually get it to connect after a series of reboots, but I wondered if anyone else is experiencing issues. I suspect the Sure PetCare servers are slow to respond so the integration times out.

I am running HA 2021.2.3, and have only seen these issues since I updated.

Yeah me too but iv had them for a while so not only a 2021.2.3 issue