Sureflap Connect - Pet Door

Thanks for the detailed write-up (and of course to all those who contributed)! FYI for those who haven’t used custom components before, be aware that when you start using them the time to check the server config (and/or to reboot) may take longer than it used to before. Just be patient as if your overall configuration is large then it might take a few minutes to complete.

I’ve finally taken the plunge and ordered one of these due to a second cat moving in, so need to keep one inside without preventing the other from going out.

For anyone in the UK thinking about one of these I just managed to get one for £110.49: https://fetch.co.uk/sureflap-microchip-cat-flap-connect-with-hub-410872011 - £129.99 £132.99 from Fetch (Ocado) and currently doing a 15% off first orders with WELCOME15. I’m not affiliated at all, just seems like a good deal. I’ll also try to remember to edit this when it’s no longer valid…

1 Like

Hi all again, I’ve just installed HACS and therefore removed all my custom-cards. I have reinstalled all of them but the “card-moder” (https://github.com/thomasloven/lovelace-card-modder) has been deprecated and replaced by “card-mod” that can be installed from HACS. However, I cant get my “Picture-cards” to work now. Is there anyone who have a working picture card (the picture of the cat changes depending on the cat’s status) with “card-mod”?

Diffrent pictures or just diffrent colour?
When home it is the normal picture, when away its black / white

- type: image
  entity: person
  image: /local/logo/xxxxx.png
  state_image:
       home: /local/logo/xxxx.png
  state_filter:
       home: brightness(100%) saturate(1.5)
       not_home: brightness(80%) saturate(0.1)

I see that it’s some days since you ordered it. But in order to achieve what you want, individual controll of exits, you do need the dual scan model. Those has a scanner on the inside as well as the standard outside scanner,

Yes, exactly. Got it setup and working, with monitoring in Home Assistant. Very happy with it so far. The new cat is kept inside while incumbent cat is allowed out, but with a curfew set.

Thanks so much for this. I was able to get the custom component setup pretty easily from the directions here. It works great, however I really need to be able to lock/unlock. Hopefully this will be developed later.

I was able to use the smartthings Smart App to control the flap’s locking/unlocking from home assistant. I don’t currently have a smartthings hub, but was able to get it working. I signed up for a smartthings account, installed the smart app and device handlers and then linked home assistant to smartthings. The new version of the smartthings app allows you to connect devices without a hub. This is very kludgy and the lag is pretty bad considering its Home Assistant -> Smartthings -> Sure Pet -> Sure Pet Hub -> Flap. Even though it is laggy, it is very reliable so far. For me the lag isn’t that bad considering I use it to lock while away/night and unlock morning/home.

Happy to have been of some help :slight_smile: I know it is missing some functionality, it seems @benleb is otherwise occupied since he hasn’t kept up the work on the pull request on github to have this as a native integration in HA. I would love to complete it myself, but time is scarce these days as I just had my second child a month ago :stuck_out_tongue:

Thanks @benleb for the Sureflap Custom Component.

Amazon Alexa > IFTTT > Webhook > HA > NodeRed > HA > Sonos Speakers

Me: Alexa, trigger an update on the cats.
Sonos Speakers: Your cats are out, [Cat #1] for 30 minutes and [Cat #2] for 1 hour.

#winning :wink:

That’s amazing! Would you be able to provide any instructions on those steps?

Just brought on of these and just set it up. I have 4 sensors working flap, flap battery and 2 cats

Do you have a config you can share to provide this data.

image

All the examples in this thread seem to be for the older custom component and the entities are now different (or I still don’t understand templates yet)

And please tell me more about your Alexa setup this sound like a great piece of work.

So I’ve simplified it a little since my last post…

Now, I just ask Alexa “Where are the cats?” and the Sonos Speaker reports if they’re in or out and if they’re out, for how long.

Full chain is: Alexa >> HA >> NodeRed >> HA >> Sonos

Working through the chain…

  • Alexa has a routine which is triggered by “Where are the cats”. The output of this routine is for Alexa to turn on an input_boolean I set-up in HA.

  • In NodeRed, I have two flows.

  1. The first flow, which is triggered once per minute, checks the status of the binary_sensor of the cats (taken from the Sure Pet Care custom component from @benleb). This flow determines if each cat is in or out and when out also saves the time since the last change (these are saved as global.variables as they are used on other NodeRed flows I have)
  2. The second flow is triggered by the input_boolean which Alexa turns on. This flow executes some JS which takes the global.variables from the previous flow and builds a text message (which cat is where and for how long) and then passes the output to an HA script via a service call. It also turns off the input_boolean which triggered this flow so Alexa can trigger it again at a later time.

  • Back in HA, the script which is called from NodeRed uses the Google TTS service to create a .mp3 file which is pushed to the Sonos Speakers. https://pastebin.com/TjhQwRS6

It may not be pretty, but it works.

My better half thinks I’m insane.

1 Like

The basics make sense but can’t work out how the first flow saves the variables or how the message is constructed.

Can you export the node red flow and post so I can import them to understand.

https://pastebin.com/D1UjUkUh

Some great work here.

So imported the flows and modified to match my entities. (I had to recreate the nodes that connected to HA. Think it might have been that the sever data copied with the import)

Been working on the final stage as I need to send response to echo devices but think this is close.

Ok so I worked out most of the sensor now using the history sensor.

Can we still get the hub and flap online status. I can’t find an entity with the data or attributes to provide this information.

I can get the hub from a nmap but should be good to know the flap is still connected.

approved & ready to merge :slight_smile: may be included in next HA release :slight_smile:

7 Likes

hey,
im getting this error

2020-01-08 16:21:11 ERROR (SyncWorker_6) [homeassistant.loader] Error parsing manifest.json file at /config/custom_components/surepetcare/manifest.json: Expecting value: line 7 column 1 (char 6)

i downloaded the files from here: https://github.com/home-assistant/home-assistant/tree/886a9496001fd8d3b11dbd97481223286246fc68/homeassistant/components/surepetcare

is there another location?

ignore - “right-click” and “save-as” doesnt work

already started to sweat :sweat_smile: :smile: