Journal

Smart Home Medication Reminder System: Automation to Alert Elderly Residents and Report Adherence to Family via LINE

ระบบเตือนทานยาสมาร์ทโฮม: Automation แจ้งเตือนผู้สูงอายุและรายงานสถานะให้ครอบครัวผ่าน LINE

May 13, 2026 · 1 min read
Smart Home Medication Reminder System: Automation to Alert Elderly Residents and Report Adherence to Family via LINE

Medication Problems in Thai Elderly

According to Thailand Department of Medical Services data, elderly patients on multiple medications (polypharmacy) have a 35-50% rate of incorrect or missed doses. Primary causes:

  • Forgetting — multiple times per day (morning, noon, evening, bedtime)
  • Double-dosing — unable to remember whether already taken
  • No caregiver present all day when adult children are at work

Consequences of inconsistent medication:

  • Poor control of chronic conditions (diabetes, hypertension, heart disease)
  • Increased emergency hospitalizations

System Architecture: Weight Sensor + Home Assistant

Simplest and lowest-cost approach:

Place a pill box on a digital scale that supports ESPHome or Bluetooth. When the elderly person takes pills, the weight changes. Home Assistant detects the reduction and confirms medication was taken.

Hardware options:

  • Xiaomi Smart Scale 2: 600-900 THB — BLE passive scan in HA
  • HX711 + Load Cell DIY: 150-300 THB — ESPHome self-assembly
  • Smart Pill Dispenser: 2,000-5,000 THB — complete solution but higher cost

Medication Reminder Automation

yaml
alias: "Morning Medication Reminder"
trigger:
  - platform: time
    at: "08:00:00"
condition:
  - condition: state
    entity_id: binary_sensor.elderly_home
    state: "home"
action:
  - service: tts.speak
    target:
      entity_id: media_player.elderly_room_speaker
    data:
      message: "ถึงเวลาทานยาเช้าแล้วครับ/ค่ะ กรุณาหยิบยาจากกล่องสีแดง"
      language: th
  - service: notify.mobile_app_elderly
    data:
      title: "💊 Morning Medication Time"
      message: "Please take morning pills — 3 tablets"

Confirming Medication Was Taken: Weight Sensor

yaml
alias: "Medication Taken Confirmation"
trigger:
  - platform: numeric_state
    entity_id: sensor.pill_box_weight
    below: 150
    for:
      minutes: 2
condition:
  - condition: time
    after: "07:30:00"
    before: "09:00:00"
action:
  - service: counter.increment
    target:
      entity_id: counter.medication_morning_taken
  - service: input_boolean.turn_on
    target:
      entity_id: input_boolean.medication_morning_done
  - service: notify.line_family_group
    data:
      message: "✅ Grandmother took morning medication at {{ now().strftime('%H:%M') }}"

Alert When Medication Is Missed

yaml
alias: "Medication Missed Alert"
trigger:
  - platform: time
    at: "09:30:00"
condition:
  - condition: state
    entity_id: input_boolean.medication_morning_done
    state: "off"
  - condition: state
    entity_id: binary_sensor.elderly_home
    state: "home"
action:
  - service: tts.speak
    target:
      entity_id: media_player.elderly_room_speaker
    data:
      message: "ยังไม่ได้ทานยาเช้า กรุณาทานยาด้วยนะครับ/ค่ะ"
      language: th
  - service: notify.line_family_group
    data:
      title: "⚠️ Morning medication not yet taken"
      message: "09:30 reached — no medication detection. Please call to check."

Weekly Medication Report

yaml
alias: "Weekly Medication Adherence Report"
trigger:
  - platform: time
    at: "20:00:00"
condition:
  - condition: time
    weekday:
      - sun
action:
  - service: notify.line_family_group
    data:
      title: "📊 Weekly Medication Report"
      message: >-
        Medication adherence past 7 days:
        🌅 Morning: {{ states('counter.medication_morning_taken') }}/7 days
        🌇 Evening: {{ states('counter.medication_evening_taken') }}/7 days
        🌙 Bedtime: {{ states('counter.medication_night_taken') }}/7 days

Setup Considerations

  • The elderly person must consent to and understand how the system works
  • Start with the most critical medications first — no need to track all at once
  • Test with the elderly resident for 1-2 weeks before full deployment
  • Have a backup plan if the system goes offline: family members notified to call and check

Questions & answers

How does a weight sensor medication tracking system work?
Place the pill box on a smart scale or load cell. When the elderly person takes pills, the weight decreases. Home Assistant detects the change and records medication as taken. If weight does not change by the scheduled time, the system reports a missed dose.
What is the starting hardware cost for a medication tracking system?
Starting at 150-300 THB for an HX711 + Load Cell DIY build, or 600-900 THB for a Xiaomi Smart Scale 2 — both supported by Home Assistant. A Smart Pill Dispenser at 2,000-5,000 THB is a complete solution but at higher cost.
How does the system notify the family when medication is missed?
If the weight sensor detects no change within 30-60 minutes past the scheduled medication time, HA sends an alert to the family LINE group immediately — including the time and which medication was missed. The family can call to check or ask a neighbor to assist.
What information does the weekly medication report on LINE contain?
A 7-day adherence summary broken down by time of day — morning, evening, and bedtime — displayed as X/7 days. This helps the family identify which medication times are most frequently missed and adjust the care protocol accordingly.

Related reading