Sureflap Connect - Pet Door

@benleb
I’m trying to test your code.
I’ve taken the files from your pull request and put them in as a custom component.
Am I oversimplifying things to think that this method should work?

I’ve created a config based on the one in the pull request and the feeders, hub and pets are available in my front end.
Am the moment I seem to be able to monitor connectivity and battery levels.
The presence of the cats does not seem to change from Away. (I don’t have any flaps).

Is there any more functionality with the feeders that should be available?

Thanks.

This is all implemented stuff currently, yes.

Ah okay, the case without a flap is currently not covered so it would not change the state of the pet. Probably this sensor should not be created in such a case…

Here some json snippets about the information (stripped some IDs and such) I can get specific to feeders. As I do not own one, I am not sure which information should be exposed as a sensor in Home assistant. So, what would you guys want? :smiley:

Feeder itself:

{
    "control": {
        "bowls": {
            "settings": [
                {
                    "food_type": 2,
                    "target": 150
                }
            ],
            "type": 1
        },
        "fast_polling": false,
        "lid": {
            "close_delay": 20
        },
        "training_mode": 0
    },
    "status": {
        "version": {
            "device": {
                "hardware": 0,
                "firmware": 406
            }
        },
        "battery": 5.378,
        "learn_mode": null,
        "online": true,
        "signal": {
            "device_rssi": -83,
            "hub_rssi": -67.5
        }
    }
}

Pet:

{
    "id": 999,
    "name": "Test",
    "species_id": 1,
    "version": "Mw==",
    "created_at": "2018-12-27T12:13:26+00:00",
    "updated_at": "2018-12-27T12:14:02+00:00",
    "position": {
        "tag_id": 123,
        "device_id": 2337,
        "where": 2,
        "since": "2020-01-17T08:48:32+00:00"
    },
    "status": {
        "activity": {
            "tag_id": 123,
            "device_id": 2337,
            "where": 2,
            "since": "2020-01-17T08:48:32+00:00"
        },
        "feeding": {
            "tag_id": 123,
            "device_id": 1337,
            "change": [
                -27.39,
                12.32
            ],
            "at": "2020-01-17T08:48:23+00:00"
        }
    }
}
1 Like

I’d be happy to send you the Json from my feeders.
What email address could I send a file to?
I don’t really see the need to strip out the IDs to send it to you.
I’m assuming you are looking at the data from /timeline/household/xxxxx

It’s not the most confidential data in the world for me.

I’d be interested in.

  1. Is the cat eating?
  2. When did it last eat?
  3. How much at the last meal?
  4. How much today?
  5. How much food is in the feeder?
  6. When was it last refilled?
1 Like

Are you just polling data?
Or are you getting “push” type info into your API ?

It looks like this is showing the last feed for that cat.
This would be the first bit of information I would be looking for.

Which feeder and what they ate from each half bowl.

In my case I have one large bowl, so it shows the second figure as zero.

1 Like

@benleb
I’ve pm’d you some of my feeder json with some comments, hope it helps.

Thanks

Okay thanks! Will work on this as next feature for the integration. The list of interesting information posted by @BruceH5200 looks good to, its now my new todo list :smiley:

Unfortunately its just pulling :confused: The company behind does not want that we use their API and so there is no doc or any nice features like push

2 Likes

ok, glad to hear you are going to look at this. I guess pulling is fine.
the 1st feature for me, would be the “last eaten” info, which I think is in the main pet file that you are already polling?

Let me know when you have something to test and I’ll try the code for you.

If you need access to my account, I don’t really see a problem with giving it to you.

There is a core update, after that i got a fault message, i allready removed the " Household_id" but that dont give a solution…

The Price and Promo is still working. Just bought :slight_smile:

just upgraded to: 106.0

now i get this error:

Invalid config for [surepetcare]: expected int @ data[‘surepetcare’][‘flaps’][0]. Got OrderedDict([(‘id’, 365133), (‘name’, ‘xxxx’)])
expected int @ data[‘surepetcare’][‘pets’][0]. Got OrderedDict([(‘id’, xxx), (‘name’, ‘xxx’)]). (See /config/configuration.yaml, line 568).

surepetcare:
  username: !secret surepetcareemail
  password: !secret surepetcarepw
  flaps: [{id: !secret superpetcareflapid, name: xxx}]
  pets: [{id: !secret superpetcaremitziid, name: xxx}]

Not on 0.106.x yet due as I’m waiting on some hardware replacements, however I did read through the release notes yesterday and noticed that the integration docs at https://www.home-assistant.io/integrations/surepetcare/ only show ids without names for flaps and pets (as well as household id being removed).

Thanks to a other community member i solved the problem:

just removing the " id: " part solved the problem!

The name part is still working

I solved the problem by removing the " id: " part from the flaps and pets part

and removing the houshold id offcource

Oh sorry, my fault :pensive: PRs fixing the docs are opened: https://github.com/home-assistant/home-assistant.io/pull/12197 & https://github.com/home-assistant/home-assistant.io/pull/12198

See the example in the docs how the configuration should look like for now: https://www.home-assistant.io/integrations/surepetcare/#configuration

Hi @benleb.

Just updated and I’m trying to figure out the changed sensor states to repair some automations.
I can see that the binary_sensor for a flap lock status has been replaced with a sensor, however I haven’t tracked down a list of possible states (other than my current ‘Unlocked’ state).

Any chance you could point me in the right direction please?

Sure…^^ :joy::joy: the possible states are listed in this file, starting at line 263 :slight_smile: https://github.com/benleb/surepy/blob/88ddb71b77d274f9dc0a7a32f695c6c22d54e885/surepy/init.py

Thank you.

Are they translated to mixed case in the sensor, eg: "CURFEW_LOCKED to “Curfew Locked” etc.?

Yes currently they are capitalized with this function. But I am considering to change this to use title-casing with title() in the future.

Ah, ok thankyou.

For the moment then, my example CURFEW_LOCKED would be “Curfew locked”.

I guess I’ll just go with:

  trigger:
    - platform: state
      entity_id: sensor.flap_back_door_status

to be safe if there might be further changes afoot.

Hey,
Now the feeders are also added, I wondered if anyone had any luck with using the data from them.

Such as how much eaten by weight, how much added by weight, When they eat or when it is topped up.

Cheers

1 Like