I have to write documentation for my changes and test the mL estimations some more before I create a PR. You can feel free to use everything else that I have so far…however, aside from the extra functionality, be aware that I have removed some of the options in my yaml that I don’t particularly need (e.g., dashboard_import has been removed since I use my own yaml and don’t want it syncing with what is on the repo).
Hi @RobertD502 ,
I bought a Fresh Element Gemini and it works well if I set the manual feed text input in the device overview.
Now I want to do this via an automation. I tried with the service “input_text.set_value” but I cannot even find the entity there. If I set the name I get an error in the log
WARNING (MainThread) [homeassistant.helpers.service] Referenced entities text.trockenfutter_automat_manual_feed are missing or not currently available (the name should be correct …)
Now I tried to set the entity directly via the developer tools. This changes the entity but no food is dispensed. After some time it switches back to “0,0”. Any hints how I can make this work with automations?
Thanks a lot for your help and the great work with the integration!
The manual feed entity for the Gemini feeder is a text entity, not an input_text entity. Therefore, you need to use the text.set_value service, not input_text.set_value.
From what I can see in Home Assistant logs it does seem to send passive data but very sporadically, anywhere from (very roughly) 15 - 45 minutes apart. I have found killing the app and reconnecting forces the data to update which makes sense (and is handy for testing) and leads me on to my next question…
Regarding your comment below instead of a BLE integration would it be possible to force or emulate a connection to the app eg every 5 or 10 minutes to get consistent data?
I have not investigated if the fountain advertises its data passively, but I’d assume an active connection is required since, even with petkit’s BLE relay, an active connection to the fountain is made before any data is sent to the relay device. It would also explain why the PetKit app won’t update any fountain data / notify you about the water level being empty unless it is open and establishes an active connection to the water fountain.*
The integration already emulates what the app does: uses another PetKit device as a BLE relay (via the cloud) when connecting remotely. Regarding timing: the next release will include a higher period of time between BLE relay initiations and even a separate option for users to change it if they want to. From my own testing with different polling intervals over the past several months, their water fountains are just inconsistent with data, no way around it. I’ve even encountered using their app to connect directly (no BLE relay) to the water fountain and it states that water is running when physically I can see the water fountain is completely out of water.
Do you plan to add support for these devices? If you do, how soon can we expect it? I want to decide for the devices for my cat and you’re the deciding factor!
hi is there any update on the petkit yumshare support? i just bought the dual hopper and it doesn’t seem to be picking it up. i have two - a solo and a dual hopper. only the solo is working. thanks
I took some inspiration from your script as well as @RobertD502 's library, plus a metric ton of packet sniffing, and managed build a relatively simple python library around it, to expose most of the controls to MQTT, to enable HA’s MQTT Discovery.
It supports connecting to the W5-family of Petkit Water Fountains via Bluetooth Low Energy, without any Petkit WiFi enabled products.
There’s a few caveats, in terms of the secret being exchanged with the device, and scheduling of Do Not Disturb as well as Lights Out. Hopefully I get around to address the last two - but will have a hard time fixing (correct) generation of secrets, as I only have two devices and thus not nearly enough to reverse engineer the algorithm used.
So, for a bit of shameless self-promotion and plugging, you can find the library here, should it tickle your fancy: PetkitW5BLEMQTT
Change the path to the correct, for your python site-packages directory. You can find the path this way: python -c "import site; print(site.getsitepackages())"
To find the address of your petkit device, you can run this command: bluetoothctl scan le
PetKit devices will be prefixed with “Petkit” in the name
Afterwards you run the script this way: python main.py --address "A1:B2:C3:D4:E5:F6" --mqtt --mqtt_broker "broker.example.com" --mqtt_port 1883 --mqtt_user "user" --mqtt_password "password" --logging_level "INFO"
Remeber to change the arguments to suit your environment.
I’ll be adding a systemd service file in the future, until then the script can be run inside screen to achieve session persistency.
Please note - as the secret is not implemented, you will need to restart the script after the first run, to ensure that the non-compliant secret has been set to the device. This will stop the app from working, until power has been cycled!