Skip to content

Scheduled feed raw sensor always returns status 0 (pending) for already dispensed meals #293

Description

@zufivan

System Health details

System Information

version core-2026.7.4
installation_type Home Assistant OS
dev false
hassio true
docker true
container_arch amd64
user root
virtualenv false
python_version 3.14.6
os_name Linux
os_version 6.18.37-haos
arch x86_64
timezone Europe/Zurich
config_dir /config
Home Assistant Cloud
logged_in true
subscription_expiration 17 giugno 2027 alle ore 02:00
relayer_connected true
relayer_region eu-central-1
remote_enabled true
remote_connected true
remote_server eu-central-1-14.ui.nabu.casa
alexa_enabled true
google_enabled true
cloud_ice_servers_enabled true
certificate_status ready
instance_id 16c256db988f44f9aa7b90ce112176a7
iot_state connected
iot_tries 0
certificate_expire_date 1 ottobre 2026 alle ore 23:31
certificate_fingerprint 0990a444caded087a8640bd769524368e774843c
certificate_alternative_names undefined
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
HACS
GitHub API ok
GitHub Content ok
GitHub Web ok
HACS Data ok
GitHub API Calls Remaining 5000
Installed Version 2.0.5
Stage running
Available Repositories 3466
Downloaded Repositories 33
Home Assistant Supervisor
host_os Home Assistant OS 18.1
update_channel stable
supervisor_version supervisor-2026.07.3
agent_version 1.9.0
docker_version 29.5.3
disk_total 48.5 GB
disk_used 30.0 GB
nameservers 10.1.1.1
healthy true
supported true
host_connectivity true
supervisor_connectivity true
ntp_synchronized true
virtualization vmware
board ova
supervisor_api ok
version_api ok
installed_addons Samba share (12.10.0), Mosquitto broker (7.1.0), eufy-security-ws (3.1.0), Wmbusmeters (W-MBus to MQTT) (3.0.0-RC1), Advanced SSH & Web Terminal (24.0.1), Frigate (Full Access) (0.17.2), Tailscale (0.28.1), ESPHome Device Builder (2026.7.3), MariaDB (3.0.1)
Dashboards
dashboards 3
resources 17
views 74
mode yaml
Network Configuration
adapters lo (disabled), enp3s0 (enabled, default, auto), hassio (disabled), docker0 (disabled), tailscale0 (disabled), veth5bfa476 (disabled), veth112c3d5 (disabled), veth4987626 (disabled), veth089aadc (disabled), vethac1eeec (disabled), vethc4bdcb4 (disabled), vethd26a95e (disabled), vethf013ae8 (disabled)
ipv4_addresses lo (127.0.0.1/8), enp3s0 (10.1.1.21/24), hassio (172.30.32.1/23), docker0 (172.30.232.1/23), tailscale0 (100.103.234.27/32), veth5bfa476 (), veth112c3d5 (), veth4987626 (), veth089aadc (), vethac1eeec (), vethc4bdcb4 (), vethd26a95e (), vethf013ae8 ()
ipv6_addresses lo (::1/128), enp3s0 (fe80::9ae6:5b97:2b74:1471/64), hassio (fd0c:ac1e:2100::1/48, fe80::acd8:e4ff:fed4:4b20/64), docker0 (fd44:8fe2:a0d2::1/64, fe80::bc8d:b2ff:fe69:45db/64), tailscale0 (fd7a:115c:a1e0::e633:ea1b/128, fe80::be64:c7bf:8319:298d/64), veth5bfa476 (fe80::64a1:8aff:fe60:fe2c/64), veth112c3d5 (fe80::7c6c:aff:fe3b:40dd/64), veth4987626 (fe80::b49d:7ff:fe94:c5f2/64), veth089aadc (fe80::e4cc:cbff:fe6e:8bab/64), vethac1eeec (fe80::c841:60ff:fe93:1ddb/64), vethc4bdcb4 (fe80::5854:22ff:fe69:9899/64), vethd26a95e (fe80::c4d:9ff:feae:5cbc/64), vethf013ae8 (fe80::f01f:e5ff:fe85:93a2/64)
announce_addresses 10.1.1.21, fe80::9ae6:5b97:2b74:1471
Recorder
oldest_recorder_run 23 luglio 2026 alle ore 17:05
current_recorder_run 29 luglio 2026 alle ore 23:33
estimated_db_size 864.81 MiB
database_engine mysql
database_version 11.4.10
Spotify
api_endpoint_reachable ok

Integration version ?

1.27.0

In which region is your Petkit application registered?

Switzerland

Device type

Feeder

Checklist

  • I have enabled debug logging for my installation.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

I believe there is a bug in the generation of the raw scheduled feed sensor.

The sensor:

sensor.<my_feeder>_dati_distribuzione_raw

always returns status 0 (pending) for scheduled meals that have already been successfully dispensed.

As a result, integrations such as dispenser-schedule-card show previous meals as "Skipped" instead of "Dispensed", even though the Petkit app confirms they were successfully dispensed.

Current raw value

Example at 15:55:

0,7,0,10,0,1,10,0,10,0,2,12,30,10,0,3,15,30,10,0,4,18,0,10,0,5,19,0,10,0,6,20,0,10,0,7,20,30,10,0

The meals scheduled at:

  • 07:00
  • 10:00
  • 12:30
  • 15:30

were successfully dispensed and are correctly shown as completed in the official Petkit app.

However, the raw sensor still reports status 0 for every entry.

Expected behavior

Past scheduled meals that have already been dispensed should return status 1 (or the appropriate completed status), for example:

0,7,0,10,1,1,10,0,10,1,2,12,30,10,1,3,15,30,10,1,4,18,0,10,0,5,19,0,10,0,6,20,0,10,0,7,20,30,10,0

Possible cause

Looking at the source code, it seems that get_raw_feed_plan_from_schedule() builds the raw sensor by matching scheduled entries with device_records.feed.

It appears that this matching is failing, causing every scheduled entry to fall back to:

state = status_lookup.get(t, 0)

As a result, every meal remains in the pending state even after it has actually been dispensed.

Could this be caused by the matching logic using only item.time instead of a unique identifier or timestamp?

Thanks for your work on this integration!

Reproduction steps

any time

Debug logs

always

Diagnostics dump

No response

Metadata

Metadata

Assignees

Labels

BugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions