PETLIBRO Smart-Home-Integration, kostenlos und Open Source

PETLIBRO feeders and Dockstream fountains: food, meals, water, filter, pump, battery.
Die Dokumentation dieser Integration wird von ihrem Autor geschrieben und ist bisher nur auf Englisch verfügbar.
This integration brings the connected PETLIBRO devices into Gladys: the smart feeders (Granary, Air, One RFID, Space, Polar wet food) and the Dockstream water fountains, through the PETLIBRO cloud (the one of the PETLIBRO app). Unofficial, not affiliated with PETLIBRO.
Development version (0.1). Built from the community clients of the PETLIBRO API (the Home Assistant integration and homebridge-petlibro-2) and tested with simulated answers, not with a real account yet. Feedback is welcome on the GitHub repository.
Before you start: a second PETLIBRO account
PETLIBRO allows one session per account: when Gladys signs in with the account of your phone, the PETLIBRO app is signed out, and the other way round. So, like the Home Assistant and Homebridge integrations recommend, give Gladys its own PETLIBRO account, and share your devices with it:
- Create a second PETLIBRO account with another e-mail address (in the app, on another phone, or after signing out of your main account).
- Sign in to the PETLIBRO app with your main account, open each device and share it with the e-mail of the second account (the share option of the device settings; its wording depends on the app version). Accept the share on the second account if the app asks.
- In Gladys, enter the e-mail and password of the second account.
The shared devices then show up in Gladys, and the PETLIBRO app stays signed in on your phone. If you use the same account in both places anyway, the integration notices that its token keeps being refused right after its sign-in: it waits 15 minutes, tries once more, then stops and asks for a second account.
What you get
One Gladys device per PETLIBRO device:
| Device | In Gladys |
|---|---|
| Dry food feeder (Granary, Granary Camera, Air, One RFID, Space) | "Feed now" button, "Feeding plan" switch, food level (low/normal; one per hopper on the two-hopper Granary), dispensed today (portions), meals today, last meal (portions), desiccant (% of its cycle, days left, "Desiccant replaced" button), battery, battery low, on mains power, online |
| Polar wet food feeder | food level, temperature, cleaning (% of its cycle, days left, "Cleaned" button), battery, battery low, online |
| Dockstream fountain (Dockstream, Dockstream RFID, Dockstream 2, 2 Cordless) | "Pump" switch (Dockstream 2), water (low/normal against the low-water threshold set in the app, Dockstream 2), water level %, water left (mL), drunk today (mL), drinks today, filter (% of its cycle, days left, "Filter replaced" button), cleaning (% of its cycle, days left, "Cleaned" button), battery, charging and on mains power (Cordless), error, online |
- Portions are counted as the PETLIBRO app counts them (a twelfth of a cup on most feeders; the Air's portions are half as big).
- The consumables (desiccant, filter, cleaning) are shown in the Gladys maintenance category: the percent of the cycle left (the cycle set in the PETLIBRO app, 30 days for instance), next to the days left. After changing the filter or the desiccant, or cleaning the fountain, press the matching button: PETLIBRO restarts the countdown.
- The last meal is dated with the time it was dispensed, not with the time of the reading.
- The badge of each device shows
cloud;unreachablewith an orange dot when PETLIBRO reports the device offline, plainunreachablewhen PETLIBRO does not answer.
Not supported yet: the Luma litter box, the camera of the Granary Camera feeder, the plates and the lid of the Polar (its own manual feeding), editing the feeding plans, and the light, sound, child lock and display settings. The first Dockstream generation cannot stop its pump: it has no "Pump" switch.
Installation
- Install the integration from the Gladys store.
- In the Configuration tab, enter the e-mail and the password of the PETLIBRO account (preferably the second account, see above). Save.
- The status says "Connected to PETLIBRO: 3 devices".
- Open the Discovery tab and add the devices you want to follow. Their values arrive as soon as they are added.
The Test the connection button signs in again if needed, reads the account and lists its devices.
Buttons, switches and feeding from a scene
- Feed now dispenses the number of portions of the "Portions of the Feed button" option (1 by default, up to 10).
- The Feed with a PETLIBRO feeder scene action dispenses any number of portions: 1 to 48, 1 to 16 on the Air Smart Feeder. Another number fails with the accepted range.
- Feeding plan turns the feeding schedule of the feeder on or off; Pump starts or stops the pump of a Dockstream 2. The switch shows the value PETLIBRO reports at the next reading, 15 seconds after the command.
- PETLIBRO refuses a command when the device is offline: the error message shows in Gladys.
A meal asked from Gladys does not fire the "Meal dispensed" trigger, so a scene cannot loop on it.
Scenes
Two scene triggers:
- Meal dispensed: a feeder dispensed a meal, from its plan, the app or its
own button. Variables
feeder_name,portionsandat(UTC). The filter can target a feeder. - PETLIBRO alert: a device starts reporting a problem: food running low,
water running low, battery low, desiccant to replace, filter to replace,
cleaning due (0 days left), or a device error. The filter can target a
device and some alerts; variables
device_nameandmessage. An alert fires once when it starts, again only after it cleared.
The first reading after a start fires nothing, and meals older than 15 minutes found after an outage are only recorded. The other values (water level %, battery…) work with the usual "Device state changed" trigger: for a first generation Dockstream, which reports no low-water threshold, use its water level.
How often it reads
Every 2 minutes by default (60 to 900 seconds): the live state of each device, plus the meals of the day of each dry food feeder and the pump and drinks of each fountain. The list of meals itself is read only when the count of the day changes, and at least every 30 minutes. The device list is read again every 30 minutes and on a Discovery scan. On errors the integration waits 1, 2, 5, 10 then 15 minutes. It signs in at most once every 15 minutes and keeps its token across restarts.
Options
| Option | Default | Purpose |
|---|---|---|
| E-mail, password | — | a PETLIBRO account, preferably a second one your devices are shared with |
| Time zone of the devices | Gladys's zone | PETLIBRO counts the meals of the day in it (IANA name) |
| Refresh interval (s) | 120 | how often the devices are read |
| Portions of the Feed button | 1 | what "Feed now" dispenses (1 to 10) |
| Language of the feature names | French | names of the features and alert messages |
Troubleshooting
- "PETLIBRO refused the sign-in": check the e-mail and the password in the PETLIBRO app. The integration does not retry by itself: it waits for a change or a click on Test the connection.
- "PETLIBRO knows no account with this e-mail": check the e-mail.
- "PETLIBRO refused the token right after the sign-in": the same account is signed in to the PETLIBRO app. Use a second account your devices are shared with.
- A device is
unreachablewith an orange dot: PETLIBRO reports it offline (Wi-Fi, power). Check it in the app. - A model is missing: the litter box and other devices are not supported yet; the test button counts them. Open an issue on the GitHub repository.
Privacy
The e-mail and password are stored by Gladys as a secret (never sent back to
the browser). The integration sends the e-mail and an MD5 hash of the
password to the PETLIBRO server (api.us.petlibro.com, the one the app uses
in every country) to open a session, like the app does; it keeps the token in
its /data folder. PETLIBRO, Granary and Dockstream are trademarks of their
owner; this integration is not affiliated with PETLIBRO.
Konfigurationseinstellungen
Diese Einstellungen fragt PETLIBRO in seinem Konfigurationsbildschirm in Gladys ab.
| Einstellung | Typ | Pflichtfeld | Beschreibung |
|---|---|---|---|
| Your PETLIBRO account | section | Nein | Brings your PETLIBRO devices into Gladys through the PETLIBRO cloud: food level, meals of the day, last meal, feeding plan and desiccant of the feeders (Granary, Air, One RFID, Space, Polar), water level, pump, filter and cleaning of the Dockstream fountains, batteries, plus a feed button, a scene action and scene triggers. PETLIBRO allows one session per account: use a second PETLIBRO account your devices are shared with (see the guide), otherwise the app and Gladys sign each other out. Then add the devices from the Discovery tab. Unofficial, not affiliated with PETLIBRO. |
| PETLIBRO e-mail | string | Ja | |
| PETLIBRO password | secret | Ja | |
| Time zone of the devices | string | Nein | Leave empty to use the time zone of Gladys. Otherwise an IANA name such as Europe/Paris: PETLIBRO counts the meals of the day in it. |
| Refresh interval (s) | number | Nein | How often the devices are read, in seconds (60 to 900). Two or three requests per device. |
| Portions of the Feed button | number | Nein | How many portions the "Feed now" button of a feeder dispenses (1 to 10). The scene action takes any number. |
| Language of the feature names | select | Nein | Used for the names of the features and the alert messages. |
So installierst du PETLIBRO in Gladys
- Öffne in Gladys Integrationen: PETLIBRO erscheint im Katalog neben den nativen Integrationen, mit einem Community-Badge.
- Klicke auf Installieren. Gladys lädt das Docker-Image (
ghcr.io/lm1lc3n7/gladys-petlibro:0.1.1) herunter, startet es in einer vom Kern isolierten Sandbox und erzeugt die Oberfläche der Integration (Geräte, Erkennung und Konfiguration). - Öffne den Bildschirm Konfiguration der Integration, fülle die Einstellungen aus und speichere.
- Du kannst sie auch direkt über die URL ihres Repositorys installieren: https://github.com/LM1LC3N7/gladys-petlibro.
PETLIBRO benötigt Gladys >=5.1.0. Der Katalog in Gladys wird stündlich aktualisiert, eine neue Version ist also spätestens eine Stunde nach ihrer Veröffentlichung verfügbar.
Du nutzt Gladys noch nicht? Es ist kostenlos und Open Source: folge der Installationsanleitung, um loszulegen.
Über externe Integrationen
PETLIBRO ist eine externe Integration: eine Community-Integration, die als Docker-Container verpackt und auf GitHub veröffentlicht wird. Gladys installiert sie mit einem Klick und führt sie in einer vom Kern isolierten Sandbox aus. Sie wird von LM1LC3N7 veröffentlicht und gepflegt, nicht vom Gladys-Kernteam.
- Alle Integrationen durchsuchen, native und aus der Community
- Deine eigene externe Integration bauen und veröffentlichen
- Quellcode auf GitHub — Quelle dieser Dokumentation