benleb / surepy

🐾 Library & CLI to monitor and control the Pet Door & Cat Flap Connect 🚪 the Pet Feeder Connect 🍽 and the Felaqua 💦 sold by Sure Petcare
https://pypi.org/project/surepy/
MIT License
77 stars 36 forks source link

New Features - Exit Permissions, Add/Remove Pet from a door #13

Open Ashitaka57 opened 3 years ago

Ashitaka57 commented 3 years ago

Hello there, First, thanks for the work achieved so far. I've started to develop a domoticz plugin based on last version of your lib, using python 3.9.1 , and it's working well.

I would ask if you were kind to add some new features like this :

I'm not sure that I had captured the correct parameters but I think so. EXIT PERM DENIED https://app.api.surehub.io/api/device/[DeviceNumber]/tag/[PetID] request method : PUT {"profile":3} EXIT PERM AUTHORIZED https://app.api.surehub.io/api/device/[DeviceNumber]/tag/[PetID] request method : PUT {"profile":2}

I'm not sure that I had captured the correct parameters but I think so. UNASSIGNED https://app.api.surehub.io/api/device/[DeviceNumber]/tag/[PetID] request method: DELETE {} ASSIGN https://app.api.surehub.io/api/device/[DeviceNumber]/tag/[PetID] request method: PUT {}

(For info ;p I'm using 4 doors (big + small) and 7 cats.)

Regards, Ash,

Ashitaka57 commented 3 years ago

any news on those 3 features?

zackpollard commented 2 years ago

@benleb I'm looking at adding this functionality to the API. Is this something you would be willing to review a PR for if I put the time into this? If yes is there any steer that you want to give on how you would like this implemented, given that some of these features are only available on the small Microchip Cat Flap Connect model so it will require a larger split per device than there is currently. For context, I am looking at updating the API so I can then add these extra details into home assistant and allow changing entry/exit permissions from there. This would allow a way of creating a custom curfew per cat which the app currently doesn't allow. I just want a confirmation that you are around to review and merge a change such as this as I don't want to put my time into this if there's no chance of it getting merged. Cheers in advance!

benleb commented 2 years ago

@benleb I'm looking at adding this functionality to the API. Is this something you would be willing to review a PR for if I put the time into this?

for short, yes absolutely! I will answer the rest later today, sorry :)

zackpollard commented 2 years ago

@benleb I'm looking at adding this functionality to the API. Is this something you would be willing to review a PR for if I put the time into this?

for short, yes absolutely! I will answer the rest later today, sorry :)

Excellent, not a problem, whenever you have a chance is good, I won't be starting on it for a couple of days anyway!

NicolasGuilloux commented 1 year ago

Hello guys! Is there any news about these features? I ping since the last message was more than 1 year ago and somebody talked about a MR but I can't find it.

I think the more appreciated one would be exit permissions since there is not automation with Add/Remove a pet from a door is not something that I can think of. Tell me your ideas if I'm wrong though.

Cheers guys!

jspiekstra commented 1 year ago

@benleb I have added this feature today. I want to request allowance for a push request so you can review and merge (when you like it).

durosity commented 3 months ago

Was this ever merged in? I'd love to be able to set individual pets to indoor only without having to use the Sure app!

NicolasGuilloux commented 3 months ago

@durosity I don't think anybody maintains this repo anymore. Last commits seem to be only maintenance, and there is no answer for new features. It also appears according to Github that @benleb does not have a lot of activity for the last 6 months/1 year. I see no PR from @jspiekstra neither, so I assume it has been dropped.

I'm no python guy, sadly. But I would love to be a tester if somebody forks this repo and implement this. The SurePet application has been remade completely, but it was a nightmare to use before. Now I'm just looking for automation.

Use case : I have a cat that is really scared by everything, and the only motivation he gets to come home is the food. But we noticed that closing the door for 2 hours everytime he come home makes him less affraid of everything. I don't want to jail him in the house, but forcing him a little to meet the other cats, the dog and us have really great effects on him.

benleb commented 3 months ago

dont worry, I am here ;) just ping me again of I miss something 👍 but yes, I cared a little less about this in the last time... maybe I can change this again :) 👍

@zackpollard / @jspiekstra sorry seems I forgot to reply -_- does anyony of you (still) have working code for this? Happy to review/merge then 👍

jspiekstra commented 3 months ago

@benleb @durosity I do have the working code for it. I will try to make a pull request somewhere coming weekend or the week after..

NicolasGuilloux commented 3 months ago

I checked the API to implement it on my side. So far, I've found the route that edit the Exit Permission.

PUT https://app-api.production.surehub.io/api/device/:deviceId/tag/:petId Payload: {"profile":<profileId>}

Profile ID Can go out
1 x
2 x
3
bushbrother commented 2 months ago

Hi all - Following this with interest as I have a new cat that I want to allow out in the day, but keep in at night - while my other cat is allowed in/out all the time. The curfew mode is no good as it applies to all pets (stupid design!). My only option is to manually adjust the indoor only permission manually at the moment.

I want to automate this using my HA instance, and found this is not exposed via any of the existing integrations so I was exploring doing it direct with the API.

If I simply want to set my cat as indoor only permission then remove it at a certain time, can I make these calls already? Do I need the above PR to complete? I could not see the ability to do it via CLI.

bushbrother commented 2 months ago

@benleb @durosity I do have the working code for it. I will try to make a pull request somewhere coming weekend or the week after..

@jspiekstra - any chance you can push this PR?

bushbrother commented 2 months ago

So I got this working in Postman!

I was slightly confused by this:

PUT https://app-api.production.surehub.io/api/device/:deviceId/tag/:petId
Payload: {"profile":<profileId>}

This creates a new pet in my catflap, the issue here was :petId should actually be :tagId that I got from the information from SureHA plugin in homeassistant ... now it works.

bushbrother commented 2 months ago

@benleb - I have created a PR for the above ability to set "indoor only" or "outdoor" pets. See #212