I built a small Home Assistant custom integration to track medication doses, and figured I'd share it.
The problem: to-do lists and calendar reminders tell you what to do, but they don't track whether a specific dose was actually given, don't nag, and don't sync that "done" state across the people sharing the responsibility. For something like medication, especially when more than one person is involved, I wanted a clear shared record plus reminders that keep reminding until acknowledged.
It started as a way to manage my dogs' daily meds, but it works for people too.
UI configuration: add a patient (pet or person), pick who to notify, then add doses (time + medications). No YAML for the schedule.
A switch per dose (on = given today), auto-created, grouped per patient, with the meds shown in the name.
Per-patient settings: notify target, daily reset time, nag window, and re-nag interval, all in the UI.
Companion automations (included) send actionable, nagging, missed-dose reminders that sync across every Companion app, so anyone in the household can mark a dose given and everyone sees it.
"All doses given" sensor per patient, for dashboards and automations.
Bundled dashboard card (summary + auto-entities).
Install
HACS, Custom repositories, add https://github.com/magikh0e/ha-medication-reminder-hacs as an Integration, install, restart. Then Settings, Devices & Services, Add Integration, Medication Reminder. Full setup (including the companion automations) is in the README.
This is alpha and not yet in the default HACS store, so it's a custom-repository install for now. It's a reminder aid, not a medical device. Validate it on your own setup and keep a backup method until you trust it. Confirm dosing schedules with your doctor or vet.
For medications that require more than one dose per day, is there logic for which can be skipped, and which need to be combined if one has been forgotten and the next is due to be taken? This can be the cause for many overdoses and unwanted medical intervention if not managed properly.
Is there an aggregate for each person/dog entity which gives an overall status of All OK'/'outstanding issues to be addressed' so we can have a go/nogo red/green 'all is well' dashboard that can be glanced at?
Great questions, and the first one is important enough that I want to be careful with it.
On skip-vs-combine logic for missed doses: No, and deliberately so. The integration tracks each dose as given / not-given with a timestamp, and flags a missed dose, but it does not decide whether a forgotten dose should be skipped or doubled up. That decision is entirely medication-specific (some meds you skip and never double, some you take if within X hours, etc.) and it's a prescriber's call. Encoding "combine if forgotten" is exactly the kind of automation that causes the overdoses you're describing, so the tool intentionally stays a tracking-and-reminder aid and leaves the dosing decision to the human following their doctor's or vet's instructions.
What it does give you toward managing that safely: each dose shows when it was actually given, so you can see the real interval since the last dose, plus a missed-dose alert. A safe enhancement I'd consider is an optional per-medication minimum interval that warns if you try to mark a dose given too soon after the previous one (a guardrail against double-dosing) but it would warn, never auto-combine.
On an aggregate "all OK" status: Partially there already. Each patient gets a binary_sensor that is on when all their doses are given today, with total / given / remaining / pending attributes, so you can build a red/green card off it. One caveat to be honest about: that sensor reads "all given," which is only fully green at end of day, earlier it's "not all given" simply because doses aren't due yet. For a true go/nogo "all is well vs outstanding issue" glance, what you'd actually want is an overdue status (a dose past its time and still not given), which I think is a worthwhile addition and I'll look at adding a per-patient OK / overdue status sensor.
For nurses quarters, remotely located son/ daughter/ carer, or even a busy carer on site, to have a red/green panel/ light/ beeper/alert/ siren/ beeper/ pager/ email/ camera sitting in the background, especially for people with dementia, is the holy grail.
Green means all is well - move onto the next pressing task. Red/flashing - investigate further. Your panel in the picture above should be the second panel - the first should be the simple red/green, silent or flashing one.
Simple requirement. Not often met. Sure, drill down to see what needs to be done, but often the forest is overlooked while we examine the trees.
It has to work. Always. Reliably. Robust. No exceptions. Do that and we'll love you forever.
The "forest, not the trees" point lands hard. You're right that the red/green belongs on top and the detail grid is the drill-down. I'll add a per-patient "needs attention" status (a problem binary sensor: green = all well, red = a dose is overdue and needs investigating), and a simple status panel that's just that red/green, sitting above the detail card.
Because it's a standard HA entity, you can wire it to whatever fits the setting: a light, a siren, a pager/email, a flashing card, a camera trigger. One sensor, many outputs.
On robustness, fully agree it has to fail safe. The status re-evaluates on a timer, not just on changes, so a dose crossing into "overdue" flips it red even if nobody touches anything. And it errs toward showing a problem rather than a false "all clear", because a false green is the dangerous failure mode here, not a false red.
I'll get this into the build tonight. It's quick code-wise since it reuses what's already there, and I'll make sure it's time-driven and fails safe. Reliability has been my priority from day one with this, which is why the timing rides on HA's proven automation engine instead of custom code logic.
Thanks again for these. This actually started as a way to keep on top of my own dogs' daily meds, a couple of them are on a multi-dose seizure schedule where a missed or doubled dose genuinely matters, so your framing around a reliable, glanceable indicator for care settings hit close to home.
It shipped in v0.6.0. Each patient now has a "needs attention" sensor (a standard problem binary sensor): green when all is well, red the moment a dose goes overdue. There's a simple red/green status panel that sits above the detail grid (your "forest, then trees"), and an optional flashing version via card-mod. Since it's just a normal entity, you can as easily drive a lamp, siren, pager, or notification off it for a physical alert that's visible across the room.
On the reliability you stressed: the status re-evaluates on a timer, not just on changes, so a dose crossing into "overdue" trips it red with nobody touching anything. And it fails safe toward "problem" rather than a false "all clear," because a false green is the dangerous direction here. The reminder timing itself rides on Home Assistant's automation engine rather than custom code, for the same reason.
I also credited you in the README for the suggestions. The framing around a fail-safe indicator for care settings genuinely shaped the feature.
It's in the latest release if you want to try it and tell me where it falls short.
Blushes. I'm embarrassed. Just throwing out ideas, having worked in the carer industry as well.
The weight sensor sensitive enough to detect the drop in weight in the packaging, so positive confirmation the medication was dispensed?
The camera(s), positioned to watch the medication go down, and not be hidden under the tongue and thrown under the bed, to be found later today, this week, this month, or whenever somebody cleans the room. Especially important for the paranoid and demented ones. The dog that vomits it up as soon as you go around the corner, and the birds hide the evidence as they efficiently peck everything up?
Soon we will have embedded NFC style chips in each tablet, and a stomach monitor to monitor it arriving on time, to replace the 'open wide, say aargh' method of administration, along with a hearty slap on the shoulders to make sure it goes down! Have we really progressed?
No need to blush, these are good, and it shows you've done the work. You've put your finger on the real gap: the app records "marked given," which is a trust signal, not proof of ingestion.
The useful design point is that the integration treats "given" as a single signal (a switch flips on), and it doesn't care what flips it. So a lot of your ideas are wireable today:
A load cell under the blister pack or pill organiser (cheap with an ESPHome HX711) detects the weight drop and marks the dose given automatically. Hands-free confirmation that it was dispensed.
An NFC tag on the bottle, tap to confirm. Same thing, one signal in.
A button, a camera-triggered automation, whatever. The tool just needs "this dose happened" and reasons from there.
Where it gets genuinely hard, and you nailed it, is the difference between dispensed and actually down and staying down. The under-the-tongue trick, the spit-it-out, the dog that brings it back up round the corner, the birds tidying the evidence. That's a human-verification problem, not an automation one. The most a system can honestly do is prompt for confirmation, timestamp it, maybe attach a camera snapshot to the event, and flag the gaps. It can't see down a throat, and I'd be wary of anything that claims it can.
As for the ingestible-chip-and-stomach-monitor future: the tech exists in pieces (smart pills are real), but I'm with you on "have we progressed?" The fanciest sensor still doesn't replace someone paying attention. Best case, the automation handles the boring, reliable part (did the dose happen on time, flag it if not) so the human attention is freed up for the part only a human can do: watching that it actually went down.
Some medicines are dispensed with repeats, others for short periods, and other by a fixed amount of doses.
Some ask for an initial introduction phase of half strength, then full strength, and a tapering does at the end.
Some suppliers will combine all your doses and medications into a readily followed blister pack.
Some medicines are two in the morning, one at lunchtime and another before bed.
Others are 'as required especially painkillers. Paracetamol can have side effects if taken too often and large doses. Addictions can arise if abused, so alerts for over-medication need to be allowed for.
Is your data entry capable of easy entry of all these combinations?
Do you have the 'same as before' option available?
Great questions, and they hit the real complexity. Honest rundown of where it stands:
Handled today:
Multi-dose daily schedules (two in the morning, one at lunch, one before bed) are the core case. You add a dose per time slot, each with its meds.
A blister-pack-style slot works via the medications field: one dose entry per time, listing everything in that slot (e.g. "Keppra, Phenobarbital, Trazodone").
Not yet, and worth being upfront about:
Finite courses (a 10-day antibiotic, a fixed dose count). Right now it assumes an ongoing daily schedule with no end date, so a course end-date / count is a clear addition.
Titration (half-strength intro, full, then taper). The schedule is static, so today you'd edit it manually at each phase. Automated phased schedules are a bigger piece.
Repeats / refill tracking. Not modelled yet.
The important one: PRN / "as required." You've put your finger on the case the current design doesn't fit at all. It's schedule-based, and as-needed meds aren't. And you're right that this is exactly where over-medication risk lives (paracetamol ceilings, dependency with the stronger painkillers). That needs its own dose type: an "as needed" med with a minimum interval and a max per 24 hours, where logging a dose checks against both and warns or blocks rather than silently allowing it. That's the safety feature, not a nice-to-have, so I'll prioritise it.
"Same as before": not currently, each dose is entered individually. A duplicate-dose / clone-a-schedule option would make complex regimens much faster to enter, and I'll add it to the list.
So the everyday "fixed times, multiple meds" case is solid; courses, titration, and especially PRN-with-limits are real gaps, and the PRN one is what I'd build first because it's about safety.
how can i set the dose at weekly? on a selected day?
and what about time?
if i select 18:00 hour (we use) il gett 6 pm....
24 hours setting would be great....
24-hour time: quick fix. The display currently hard-codes 12-hour (6 PM), but the time you enter is already 24-hour under the hood, it's just the label that converts. I'll make it a setting so you can pick 24-hour (18:00). Easy one, ill get that in on the next release today.
Update - 24-hour is done, it's in v0.7.0: Configure โ Reminder settings โ Time format โ 24-hour, and your doses show as 18:00 instead of 6 PM.
(One heads-up: that controls the entity names. If you use the bundled dashboard summary card, it formats times itself, so change %-I:%M %p to %H:%M in that card's template to get 24-hour there too.)
Weekly / specific-day doses: not supported yet, the schedule is daily-only right now, but they're on the roadmap That's a real gap and a fair ask.
The right fix is a "days of the week" option per dose, so a dose can be Mondays only, or Mon/Wed/Fri, etc. A bit more work than the time format, but I'll get to it.
Thanks for both, they make it usable outside a strict daily routine.
Day-of-week scheduling is now in v0.8.0. When you add a dose you now pick which days of the week it applies to (defaults to every day), so "Mondays only" or "Mon/Wed/Fri" both work now. A dose only reminds, counts as pending, or flags overdue on its scheduled days.
One heads-up if you're running the companion automations: re-copy companion-automations.yaml, since the reminder logic now checks the scheduled days. Existing doses default to every day, so nothing changes for them.
it works like a charm....
i even builded the pills counter to it..
it counts how many pills there will be left after (meds-Given)
with help of counter helpers and a little yaml ...
ty....
This made my week. Seeing the day-of-week scheduling actually running, Methotrexaat on Wed, Foliumzuur Thu/Fri, Macrogol daily, is exactly what I hoped people would do with it. It also gives me some ideas to extend!
And the pill counter is brilliant. Counting how many doses are left after each one is marked given is genuinely useful, that is the kind of thing that stops you running out mid-week. Any chance you'd share the counter helper + template YAML? I'd love to point others to it, and honestly it makes a strong case for baking supply tracking and low-stock refill reminders right into the integration.
Bedankt for sharing this, and for the feedback that shaped the scheduling. Looks great.