Sureflap Connect - Pet Door

Sure flap sounds like a great name for a booty call lol sorry not helpful I know.

1 Like

I will try to reinstall it

The backend library has been updated and i need to update the frontend Hass module.

At the moment i have a bit much on my plate. but i hope to update it later this month.

1 Like

Reinstalled everything but still get the platform not found error.
Any tips?

try installing the module globally (pip install without the -t option) :slight_smile:

Has anyone tried to intercept the MQTT backend interface?

The Hub has two open TCP connections, one HTTPS (amazon) and one encrypted MQTT (xively). The cats movements is reported over MQTT and I’d love to use these reports instead of polling the frontend web server.

// Peter

1 Like

I was interested in this catflap - apart from the need to use a third party service (partly due to privacy - I don’t really want my cat’s movements being shared to a third party; but also for concerns about longevity - the pet door has a control panel which allows access to most features, but the smaller cat door requires the android app to access pretty much any setting).

So would be interested in a way of using this without needed the amazon\xively services.

One route would be to intercept the hub to server communications - which might be possible with some DNS spoofing in the local router as long as the hub isn’t doing detailed validation on the ssl certificates.

A cleaner route might be to intercept the communication between the flap and the hub - i.e. to create a “virtual hub” replacing the official hub. I suspect the communication is via standard 802.11 wifi with some mechanism to negotiate the SSID and\or key between the flap and the hub, but I don’t know how easy that would be (or how keen sureflap would be on that idea).

Matthew

hello

can you please send me a
installing dokumentation
configuration dokumentation and
some sample API calls

for the rcastberg/sure_petcare

thank you

Klaus

I finally got it working! Thank you @rcastberg :slight_smile:

My situation

  • First itme HA user
  • Home Assistant 0.80.1 installed in my LXC container (no HASS or raspberry pi)
  • Sureflap Catdoor Connect

Steps

  1. Went in to my HA directory: cd /root/.homeassistant/

  2. git clone https://github.com/rcastberg/sure_petcare.git

  3. Tried ./sure_petcare/sp_cli.py to verify I can connect to API with credentials

  4. Added sure_username and sure_password to secrets.yaml

  5. mkdir -p custom_components/sensor and place sure_petflap.py in there

  6. ./sure_petcare/sp_cli.py ls_pets to find name of pet

  7. Copy sensors.yaml, binary_sensors.yaml and groups.yaml into HA directory and change name of pet

  8. As i am an HA noob :slight_smile:, i didnt knew i had to include these 3 files in my configuration.yaml:

    sensor: !include sensors.yaml
    binary_sensor: !include binary_sensors.yaml
    group: !include groups.yaml
    
  9. Install sure python package: pip install /root/.homeassistant/sure_petcare/sure_petcare/ -t /root/.homeassistant/deps/

  10. Restart home-asssistant service, got some errors:

in "/root/.homeassistant/binary_sensors.yaml", line 3, column 7
expected <block end>, but found '<block mapping start>'
in "/root/.homeassistant/binary_sensors.yaml", line 13, column 8

Found out it was because indentation in sample config was wrong. Changed the binary_sensors.yaml etc to two spaces indent.

  1. Got more errors:
  File "/root/.homeassistant/custom_components/sensor/sure_petflap.py", line 59, in setup_platform
    username = config.get(CONF_USERNAME)
NameError: name 'CONF_USERNAME' is not defined

Fixed it by making a quick hacky change to /custom_components/sensor/sure_petflap.py . I commented out import homeasssistant so is_hass_component wouldnt throw an exception. As said i dont use HASS.

Afterwards, it is working fine :smiley:
(This was last night, described steps afterwards so there might be one missing…)

4 Likes

Hello
is it possible to run the rcastberg code without Home Assistant? only on a raspbian operating system?
If yes can you please say me how?
Thank you

Klaus

Very interested in getting this up and running but using haas.io, will this work on the hass.io platform running on a RPi 3

1 Like

Yes, it looks like it will run using Hassio

1 Like

Thats great, how do I go about installing this as Ive only been using hassio for about a month now so still learning.

1 Like

Same here, great project. I’d love to see a step by step write up.

1 Like

I have copied over the folders to the relevant places and after restating I’ve got a Sure Cat Flap Status panel come up with:
Hub online Status - Disconnected
Flap online Status - Disconnected
Sure Flap - Locked

I now believe I need to run the ‘pip install . -t /config/deps/’ but not sure how to do this in hassio, any pointers please as I don’t want to crash things again and have to do a new hassio install on my RPi.

When I look in the ‘config/deps/’ folder, I only have ‘lib’ in there.

I would be grateful of some help on this. I don’t know where to start to populate the /deps/ folders with the necessary folders or files

Now that my cat flap has arrived and I’ve used it I have to say that I’m quite impressed with it.

I now think that the only thing I need HA to do with it is to have Google Assistant announce which cat has gone in/out over my Google home minis.

Is there a simpler way?

I can’t get this to work. Whatever I do I get:
Platform not found: sensor.sure_petflap

And in Putty I get the following error with step 9:
-bash: -bash:: command not found

Can someone explain me how I get to run this exactly? Where do I have to copy the files exactly? And why can’t I install the python package?

Thanks in advance!

Is it possible to make an hassio addon of this?

4 Likes

I build a pip package for this which makes installation much easier: https://pypi.org/project/sure-petcare

This is NOT maintained or anything else by the author of the code, rcastberg. If he will provide a pip package sometimes, i will remove this one.

3 Likes