surepy icon indicating copy to clipboard operation
surepy copied to clipboard

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

Open Ashitaka57 opened this issue 4 years ago • 15 comments
trafficstars

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 :

  • [ ] possibility to set exit permissions for each pet on Microchip Cat Flap Connect (on the small one, because you can't do that on the big one.)

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}

  • [ ] possibility to assign/unassign a pet from any door. (the pet id are stored on the server, and you can attach/detach them via the app from each door.) <- I'm using this as an enter+exit permissions on each door (big one + small one) and you don't need to remove/create the pet profile so it's easy to use this way.

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 {}

  • [ ] gather the Exit permissions per pet on a door. (you can find them in the app submenu)

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

Regards, Ash,

Ashitaka57 avatar Feb 17 '21 08:02 Ashitaka57

any news on those 3 features?

Ashitaka57 avatar Aug 24 '21 12:08 Ashitaka57

@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!

zackpollard avatar Jan 15 '22 00:01 zackpollard

@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 :)

benleb avatar Jan 15 '22 14:01 benleb

@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!

zackpollard avatar Jan 15 '22 23:01 zackpollard

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!

NicolasGuilloux avatar Apr 04 '23 07:04 NicolasGuilloux

@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).

jspiekstra avatar Jul 05 '23 22:07 jspiekstra

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!

durosity avatar Jun 17 '24 08:06 durosity

@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.

NicolasGuilloux avatar Jun 19 '24 15:06 NicolasGuilloux

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 👍

benleb avatar Jun 19 '24 15:06 benleb

@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 avatar Jun 19 '24 19:06 jspiekstra

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

NicolasGuilloux avatar Jun 21 '24 12:06 NicolasGuilloux

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 avatar Jul 12 '24 10:07 bushbrother

@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 avatar Jul 12 '24 14:07 bushbrother

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 avatar Jul 19 '24 10:07 bushbrother

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

bushbrother avatar Jul 20 '24 14:07 bushbrother