Yeah i’ve seen some topics where is was mentioned that we cant kept the commit history… But the most important thing is, that we get all the functions and a working binding, which hopefully get merged soon
I’ve downloaded the jar and will definetly test this the next couple days.
I have seen this thread about the API binding and the brilliant work @scherer has done.
Is anyone interested in building a local surepet instance and reverse engineering the MQTT protocol used by the hub as it connects to AWS IOT MQTT endpoint?
My intention is to have an agent that listens to the mqtt topic and then publishes to another topic so I can integrate it into Home Assistant as a dynamic mqtt client, I assume there would be similar integration possibilities with OpenHAB??
Feel free to private message me if anyone is interested in this project.
How do you envision this? Mimic a 2nd hub that can peek into events from the original one? Or write a “man in the middle” proxy that spies on the traffic between the hub and the cloud? I read that currently the SSL certs are not validated by the hub so this could be done but might be hard to come up with an easy to setup configuration for this.
I’m interested too to make this a local only thing to not rely on the cloud.
I have created a docker compose that spins up a web server and mqtt mosquito server instance on TLS to simulate the hub and aws iot endpoints with self signed certs. The web server downloads the credentials from the hub . api . surehub . io and saves them locally as you need a set of valid credentials for the hub to then connect to the MQTT endpoint as then the mosquito server also listens on a TLS endpoint to simulate aws iot for the hub to connect to. Then you need to update your local DNS with static entries for the two domains the hub queries to point to your local instance IPs rather than the ones on the internet. Fairly easy to do with many routers to have a static DNS entry, but not on very low end ISP supplied ones.
So far I have the majority of messages for pets coming in and out decoded and last night decoded the feeder messages. It is currently pointing to home assistant putting messages on a mqtt topic for HA to pick up, but equally it could send messages to openhab.
Looking for some folks who may be able to assist further ideally with MIPS PIC32MX6xx disassembly to have a look through the firmware and able to sniff zigbee traffic as there might be the possibility to have the devices connect to a local zigbee gateway as it seems Miwi is fairly close to zigbee.
Thank you Holger! I know from experience that the development of a binding takes a lot of time and dedication, very happy with the binding to be able to monitor our cats in OpenHAB!
One thing I like is the ability to see the battery voltage. We use rechargeble batteries and due to the lower voltage the official app starts complaining way too soon about low batteries. I learned that a voltage of 4.6V means the flap is no longer working so now can create a custom OpenHab notification when the voltage reaches 4.7V
Hi @jwveldhuis . I finally managed to get the 2 approvals for the first version of the binding to be merged. Now I’m happy to extend it. Actions should be easy to add and I’ll have a look at the lock status and look through.
Hi @plambrechtsen . Do I understand you correctly. The app connects to the API, then downloads some MQTT connection information and credentials and then connects to the MQTT broker? I would be interested to have a look at your reverse-engineered messages to see if we can get a better user experience listening to MQTT messages, rather than polling the REST API.
may I ask you to give a little bit more detailed description of the things you described here, because I use also some SureFlap API calls, but they are slowly. In my solution based on the description of GitHub - alextoft/sureflap: Basic PHP Examples for SureFlap API (IoT cat flap) the API calls take between 5 to 45 sec. And if I got it right than is your solution much faster. I do need a fast response of the SureFlap status change of a cat who comes or goes through a SureFlap catalpa and I understood you that you do have for this a solution.
I’ve made pretty good progress so far and am integrating it into home assistant via MQTT discovery topics so it should be very easy to plug into openhab.
It’s a docker compose that spins up a web server, local MQTT TLS endpoint, logging and pethub which does the translation into human readable topics than the binary string you get from the hub and if you redirect the dns domain the hub uses to make the connection to the cloud.
So if you weren’t sure this runs the whole cloud backend within your local network after you make a single change on your local dns to point the first call the hub makes to a local web server instead of the cloud service. And then the rest is local traffic and the cloud service and surepet app and api are no longer used.
Doesn’t seem to be much interest here but I figured out one of the last puzzles yesterday so if you wanted to fully MITM the traffic back to the cloud service and you don’t mind soldering a TTL console cable onto the hub PCB I have written a script to take the console output created during a firmware update and find the password for the certificate the hub uses to talk to the cloud service.
In case you or anyone else is getting this updateThingCurfews error. I’m using version 3.1.0 of the binding. I had this exception, we have a feeder and cat-flap on the system. I’ll see if I can find the json for @scherer. To fix it I found on the cat flap if you create a Curfew and then disable it the error goes away. I’m just guessing the response changed from null to an array showing disabled curfews looking at the debug, as its reading the one I entered, but as false. Now the binding boot’s up successfully. If I can find the old json output in the log’s, I’ll post the delta’s around anything mentioning curfews.
Hopefully this helps anyone else with this same exception.
Ran into a recent issue when upgrading to OH4 with this binding not being able to login to cloud service. Not sure if anyone else is seeing issues. Think I have figured it out but need a maintainer’s help to correct it.