Skip to main content

petnetizen-feeder

Python BLE library for controlling Pet Netizen / CloudPets / Du smart feeders and pet toys without any cloud account or app pairing. Used by the netizen_ble Home Assistant integration.

Supported devices

BLE name prefix Device type Notes
Du-F*, Du-W* Standard feeder / water dispenser All Du- prefix feeders
DU-F14B F14B V2 protocol variant
DU-CP01B CP01B Interactive ball feeder
Du-TC02 TC02 Laser cat teaser
JK-* JK feeder Different service UUID
ALI-* ALI feeder Different service UUID
PET-*, FEED-* Standard feeder

Installation

pip install petnetizen-feeder
# or
uv add petnetizen-feeder

Quick start

import asyncio
from petnetizen_feeder import FeederDevice, FeedSchedule, Weekday

async def main():
    feeder = FeederDevice("E6:C0:07:09:A3:D3")
    await feeder.connect()

    await feeder.feed(portions=2)

    await feeder.set_schedule([
        FeedSchedule(weekdays=Weekday.ALL_DAYS, time="08:00", portions=1, enabled=True),
        FeedSchedule(weekdays=Weekday.WEEKDAYS, time="18:00", portions=2, enabled=True),
    ])

    await feeder.disconnect()

asyncio.run(main())

Discovery

from petnetizen_feeder import discover_feeders, FeederDevice

async def main():
    # Returns [(address, name, device_type), ...]
    devices = await discover_feeders(timeout=10.0)
    if not devices:
        print("No devices found")
        return

    address, name, device_type = devices[0]
    print(f"{name} @ {address} ({device_type})")

    feeder = FeederDevice(address, device_type=device_type)
    await feeder.connect()
    info = await feeder.get_device_info()
    print(info)  # {"device_name": "...", "device_version": "..."}
    await feeder.disconnect()

device_type values: "standard", "jk", "ali", "f14b", "cp01b", "tc02".

API reference

discover_feeders(timeout=10.0)

BLE scan returning [(address, name, device_type)]. Recognises devices by name prefix (Du, JK, ALI, PET, FEED, TC) — same logic as the Android app.

FeederDevice(address, verification_code="00000000", device_type=None)

Main device controller. device_type is auto-detected from the BLE name when using discover_feeders(); pass it explicitly if you have the address only.

Connection

Method Returns Notes
connect() bool Up to 3 attempts; returns only once the link has stayed up for ~1 s
disconnect() —
ensure_connected() bool Reconnects if dropped (up to 3 attempts, one WARNING if all fail)
is_connected bool Property
disconnected_callback — Pass to establish_connection(..., disconnected_callback=...) when supplying a connection_factory, so link drops are logged with their exact time

Connection behaviour (Du-W11B, fw 110): session setup enables notifications, then sends the verification code (same order as the Android app, so the EB 06 01 01 verdict is visible). The feeder drops links that never send the code within ~4–5 s; an authenticated link stays up for minutes even when idle. Setup waits until ~1 s after link-up before reporting success and retries if the link died; one test session saw about half of fresh links dropped 2–3 s after link-up (not reproduced since).

Polling: queries return as soon as the feeder replies. State the feeder pushes after verification (feeding status, fault, child lock, prompt sound, power, LED, auto-lock) is served from FeederBLEProtocol.last_state for 30 s without a query, and a query the firmware never answers is not re-sent for 10 minutes.

Tested through an ESPHome Bluetooth proxy running ESPHome 2026.10.0. Before that update, the same proxy failed every connection while enabling notifications (error 19).

Feeder control

Method Returns Notes
feed(portions=1) bool 1–15 portions
set_schedule(schedules) bool List of FeedSchedule
query_schedule() list[dict] Current schedule from device
sync_time(dt=None) — Syncs device clock (default: now)
get_device_info() dict device_name, device_version
factory_reset() bool

State queries

Method Returns Notes
get_battery_level() int | None 0–100 %
get_child_lock_status() bool | None
get_prompt_sound_status() bool | None
get_fault_status() int | None 0 = ok
get_feeding_status() str | None idle, feeding, done, failed
get_do_not_disturb() dict | None {enabled, start_time, end_time}
get_last_feed_result() dict | None Cached from last notification

Switches

Method Notes
set_child_lock(locked)
set_sound(enabled) Prompt sound / reminder tone
set_led(enabled)
set_auto_lock(enabled)
set_atmosphere_light(enabled)
set_long_ring(enabled)
set_do_not_disturb(enabled, start_time="22:00", end_time="08:00")

CP01B (interactive ball feeder)

Method Notes
get_cp01b_state() Returns dict of all CP01B DP values
set_cp01b_operation_mode(value) 0–5
set_cp01b_rotation_mode(value) 0–5
set_cp01b_volume(value) 0–100
set_cp01b_playback_frequency(value) 0–10
set_cp01b_sound_effect(value) 0–10
set_cp01b_auto_mode_countdown(value) 0–60 minutes
set_cp01b_fun_mode(value) 0–10
set_cp01b_prompt_sound(enabled)

TC02 (laser cat teaser)

Method Notes
get_tc02_state() Returns dict of all TC02 DP values
set_tc02_operation_mode(value) 0–5
set_tc02_rotation_mode(value) 0–5
set_tc02_color_rgb(r, g, b) 0–255 each channel
set_tc02_mood_light_mode(value) 0–10
set_tc02_led_color(value) 0–255
set_tc02_sound_effect(value) 0–10
set_tc02_playback_frequency(value) 0–10
set_tc02_volume(value) 0–100
set_tc02_auto_mode_countdown(value) 0–60 minutes

FeedSchedule(weekdays, time, portions, enabled=True)

Param Type Notes
weekdays list[str] or Weekday ["mon", "wed"] or Weekday.ALL_DAYS
time str "HH:MM"
portions int 1–15
enabled bool

Weekday

Constants: SUNDAY, MONDAY, …, SATURDAY, ALL_DAYS, WEEKDAYS, WEEKEND.

Model features

from petnetizen_feeder import model_features, decode_fault_flags

f = model_features("Du-W11B_E6C00709A3D3")   # advertised BLE name
f.child_lock, f.do_not_disturb               # True, False
decode_fault_flags(0x05)                     # stuck_grain + out_of_food

model_features() mirrors the Pet Netizen app's per-model feature list and returns None for models it doesn't know.

Protocol

Tuya BLE, EA/AE framing:

TX: EA [cmd] [len] [data…] 00 AE
RX: EB [cmd] [len] [data…] [crc8] AE

Service UUID 0000ae30 (standard, CP01B, TC02), 0000fff0 (JK), 0000ffff (ALI). Default verification code 00000000 — no cloud pairing required. The feeder answers SET_FAMILY_ID with EB 06 01 01 (accepted) or EB 06 01 00 (rejected); the reply is only visible if notifications are enabled first. Right after verification the feeder pushes its state unprompted (05 time-sync request, 0E, 09, 0A, 0D, 0F, 10, 12, then the 0C/0B feed records).

Reverse engineered from the Pet Netizen Android app (JADX).

Requirements

  • Python 3.12+
  • bleak for BLE
  • Linux: user in bluetooth group (sudo usermod -aG bluetooth $USER)

Development

uv sync --all-extras
uv run pytest tests/ -v

Releasing

Bump version in pyproject.toml, commit, then:

git tag v0.x.y && git push origin v0.x.y

CI publishes to PyPI automatically on tag push.

License

MIT — based on reverse engineering of the Petnetizen Android app for educational and personal use.

Metadata

Release files for petnetizen-feeder 0.11.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for petnetizen-feeder 0.11.0
File Size Uploaded Provenance Actions
petnetizen_feeder-0.11.0.tar.gz 63.2 kB Without provenance Details for petnetizen_feeder-0.11.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for petnetizen-feeder 0.11.0
File Interpreter ABI Platform Actions
petnetizen_feeder-0.11.0-py3-none-any.whl Python 3 none any Details for petnetizen_feeder-0.11.0-py3-none-any.whl

Total release size: 93.0 kB

Release files / petnetizen_feeder-0.11.0.tar.gz

Download URL petnetizen_feeder-0.11.0.tar.gz
Size 63.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1cdd888bb41b8746c868badf4142147632e92223418df8379cc858517a8c70d4
BLAKE2b-256 checksum
How to use checksums
692fb368c00c8e1d8e523a9741a9d71464011806f9cb1d1ae1b7ee6d60207ee3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / petnetizen_feeder-0.11.0-py3-none-any.whl

Download URL petnetizen_feeder-0.11.0-py3-none-any.whl
Size 29.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c400e2b5edd9a33b4b1dbe80f622bbb16534f19b5b959a0e15b41cc86f80efea
BLAKE2b-256 checksum
How to use checksums
ade1009eaf1419dc6f1cd12696924d50bbe2259d2ff5a72948239db069f523a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for petnetizen-feeder 0.11.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.11.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page