Skip to content

fix(nedis_pilldispenser): correct dp 102 masks, add alarm status sensors - #6082

Draft
MartinNuc wants to merge 1 commit into
make-all:mainfrom
MartinNuc:fix-nedis-pilldispenser-dp102
Draft

fix(nedis_pilldispenser): correct dp 102 masks, add alarm status sensors#6082
MartinNuc wants to merge 1 commit into
make-all:mainfrom
MartinNuc:fix-nedis-pilldispenser-dp102

Conversation

@MartinNuc

@MartinNuc MartinNuc commented Sep 5, 2026

Copy link
Copy Markdown

I have this device (Nedis WIFIPD10WT) and tested all of this against it.

The dp 102 masks are the wrong width. The payload is 30 bytes but the masks are 32, so every field was read from the alarm-status bytes at the end of the payload instead of the status bytes at the start — everything decoded as 0 or off.

Real dp 102 payload from my device:

00002b001c0805030000b302000000000000000000070000000000000000

field before after
total compartments 0 28
loaded compartments 0 8
current compartment 0 5
remaining compartments 0 3
battery 0 43 %
plug / lid off correct

I also added sensors for the per-alarm status bytes (B21–B29). On my device dp 103 and dp 120 never arrive over the LAN, and are not answered when requested explicitly, so these bytes are the only local way to see whether a dose was taken. Confirmed live: alarm 2 went waitingmissedtaken_after_missing across a real dose.

Finally, the battery binary_sensor: its constraint compares integers (2, [0, 1, 3]) against battery_state, but that dp maps its values to strings first, so nothing ever matched and the entity stayed unknown. It now compares the mapped names, and reads off with battery_state: full on my device.

The config was originally created from the cloud data model in #3357 without hardware to test against, which is presumably why the mask alignment was never caught.

Screenshot 2026-09-05 at 21 26 50 Screenshot 2026-09-05 at 21 26 37 Screenshot 2026-09-05 at 21 26 26 Screenshot 2026-09-05 at 21 26 17

The dp 102 masks were aligned to the wrong end of the payload. The real
payload is 30 bytes, so masks of 32 bytes made every field decode from
the alarm status bytes (B21-B29) instead of B0-B7, and all of them read
0 or off. Masks are now the same width as the payload, with each byte in
its documented position.

Verified against real hardware (Nedis WIFIPD10WT): total compartments now
reads 28, loaded 8, and battery percent, plug and lid all match the
physical device.

Adds sensors for the per-alarm status bytes (B21-B29). These are the only
local source of "medication taken" on this device, as dp 103 and dp 135
are never sent over the LAN and are not answered when requested
explicitly.

Also fixes the battery binary_sensor constraint, which compared integers
against battery_state's mapped string values, so it never matched and the
entity stayed unknown.

Refs make-all#3357

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-project-automation github-project-automation Bot moved this to 👀 In review in Tuya Local Sep 5, 2026
@make-all make-all moved this from 👀 In review to 🏗 Stalled in Tuya Local Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: 🏗 Stalled

Development

Successfully merging this pull request may close these issues.

2 participants