I’ve created a new binding for the Sure Petcare family of Internet connected pet flaps and feeders. It’s my first attempt of a binding development and the code is still relatively alpha, but it has been running in my local OpenHAB installation for a couple of weeks without any issues.
Restrictions / TODO
The Sure Petcare API is not publicly available and this binding has been based on observed interactions between their mobile phone app and the cloud API.
If the Sure Petcare API changes, this binding might stop working.
The current version of the binding supports only cat/pet flaps. Feeders are not yet supported as I don’t own one yet.
The binding is currently read-only. I.e. no changes to the Sure Petcare devices can be made through the binding.
I would appreciate if people can give me some feedback before I submit an official PR.
I’d like to wait until the code has been accepted by the PR reviewers and then I’m happy to create a build for 2.4. I’m running 2.4 myself at the moment.
Since this is my first OpenHAB contribution, I’m not sure how long the review process takes.
I know its in a early state but I’m missing the SET pet location function. thats why i will stay on my javascript rule solution for now… anyway… its great to see movement on the surepetcare binding solution front.
I’ll take a look at it in the next days and maybe i can came up with a PR for the feeders.
a nice binding you have here!
I’ve created my own a while ago and been using it since but it needs some refactoring as I created it when I was short on time.
Perhaps some of my work can be used in your binding.
We have a Pet Flap and some Feeders.
I have some more endpoints and JSON requests/replies.
I grabbed them by using the app in Chrome after pressing F12.
Sounds good. Holger has also added quite a few more features and the latest version now supports feeders as well as flaps.
Would you be able to share your code, so that we can have a look at the differences and make it as efficient as possible?
At this point my code isn’t really in a shareable state I’m afraid
The idea was to enhance and clean up somewhere in November and release it by the end of the year.
I checked your binding and there are no effeciency improvements to be taken from my version
It’s already really complete and moving at a fast pace.
I do have fast polling as a value which can be set, you already have it in the feedback but it’s read only.
Fast Polling: by default the Feeder and Flap check the chip on first activating and from then on use the proximity sensors to detect the pet.
So if an authorzied pet starts eating, an unauthorized pet puts his head next the the authorized one and the authorized one leaves, the feeder will stay open.
If you enable Fast Polling it will continuously use the chip to detect the cat and close when the authorzied one leaves (does use more battery).
I also experienced inconsistencies with our 3 feeders where the actual total amount eaten doesn’t match the calculated result of each feeding.
I used endpoint: https://app.api.surehub.io/api/report/household/<householdId>/pet/<petId>/aggregate?from=2019-10-29&to=2019-10-29
to get the daily report and then calculate through the feed
Are any of you experiencing the same issues?
I also had following endpoints which might be handy as reference:
api/me
api/notification
api/start
api/household
api/timeline/household/
api/product
api/tag
I just tested the binding and it only lists our pets but none of the devices.
I get following message:
Exception caught during topology cache update: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at path $.devices[4].control.curfew
in the binding you expect an array in curfew while in my case it’s a single value:
I also have 2 feeders… but didnt noticed that for now… will investigate this in the next days… thanks for pointing this. I also liked to have had this value in the binding at a later point.
we do use the values in the thing.xml and do the translations via .properties files.
There are 5 types of locking mode…Mode 0 is also used by curfew(which is IMHO wrong from the API), but even if a curfew is set (active or inactive) the API never respond we expected mode 4…
I also played alot with the API endpoints and noticed that you can limit the timeline by ?page_size=5
If i remember correctly this was changed from 1 curfew to 4 curfews… mid of this year…
Multiple curfew settings for Microchip Cat Flap Connect.
Can you please test to delete you current curfews and add them again.
I couldn’t find any way to add or remove a curfew and found in the Google Play description of teh app following:
one curfew per day for the Microchip Pet Door Connect or up to four curfews per day for the Microchip Cat Flap Connect
and we indeed have the Pet Door Connect so it makes sense.
I’m not sure if they will implement multiple curfews for this device but if not, this would need to be treated differently or ignored.
The product_id is 3.
If you need me to test some stuff just let me know.
Great, if you can help testing it. I’ll build you a jar for the latest 2.5.0 release in the next 2 days. Just need to get my build env sorted out again.