Journal

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

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

13 พฤษภาคม 2569 · 1 นาที

ปัญหาการทานยาในผู้สูงอายุไทย

ตามข้อมูลกรมการแพทย์ไทย ผู้สูงอายุที่ทานยาหลายชนิด (Polypharmacy) มีอัตราการทานยาผิดหรือลืมทานสูงถึง 35-50% สาเหตุหลัก:

  • ลืมทานยาเพราะมีหลายมื้อ (เช้า, กลางวัน, เย็น, ก่อนนอน)
  • ทานยาซ้ำเพราะจำไม่ได้ว่าทานแล้วหรือยัง
  • ขาดผู้ดูแลที่อยู่ตลอดเวลาเมื่อลูกหลานออกไปทำงาน

ผลที่ตามมาจากการทานยาไม่สม่ำเสมอ:

  • ควบคุมโรค (เบาหวาน, ความดัน, หัวใจ) ไม่ได้
  • ต้องเข้าโรงพยาบาลฉุกเฉินเพิ่มขึ้น

สถาปัตยกรรมระบบ: Weight Sensor + Home Assistant

วิธีที่ง่ายและราคาถูกที่สุด:

ใช้ตาชั่งดิจิตอลที่รองรับ ESPHome หรือ Bluetooth + Weight Sensor โดยวางกล่องยาบนตาชั่ง เมื่อผู้สูงอายุหยิบยาออก น้ำหนักจะเปลี่ยน Home Assistant ตรวจจับว่า มีการหยิบยา แล้ว

ตัวเลือก Hardware:

  • Xiaomi Smart Scale 2: 600-900 บาท รองรับ BLE Passive Scan ใน HA
  • HX711 + Load Cell DIY: 150-300 บาท ประกอบเอง ผ่าน ESPHome
  • Smart Pill Dispenser: 2,000-5,000 บาท ครบวงจร แต่ราคาสูง

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: "💊 เวลาทานยาเช้า"
      message: "กรุณาทานยาชุดเช้า 3 เม็ด"

ตรวจสอบว่าทานยาแล้วหรือยัง: 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: "✅ คุณยายทานยาเช้าแล้ว เวลา {{ now().strftime('%H:%M') }}"

แจ้งเตือนเมื่อลืมทานยา

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: "⚠️ คุณยายยังไม่ทานยาเช้า"
      message: "ถึง 09:30 แล้ว ยังไม่พบการทานยาเช้า กรุณาโทรตรวจสอบ"

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: "📊 รายงานทานยาประจำสัปดาห์"
      message: >-
        สรุปการทานยา 7 วันที่ผ่านมา
        🌅 ยาเช้า: {{ states('counter.medication_morning_taken') }}/7 วัน
        🌇 ยาเย็น: {{ states('counter.medication_evening_taken') }}/7 วัน
        🌙 ยาก่อนนอน: {{ states('counter.medication_night_taken') }}/7 วัน

สิ่งที่ต้องพิจารณาก่อนติดตั้ง

  • ผู้สูงอายุต้องยินยอมและเข้าใจว่าระบบทำงานอย่างไร
  • เริ่มจากยาที่สำคัญที่สุดก่อน ไม่ต้องติดตามทุกชนิดพร้อมกัน
  • ทดสอบกับผู้สูงอายุก่อนใช้งานจริง 1-2 สัปดาห์
  • มีแผนสำรองถ้าระบบล่ม: แจ้งสมาชิกครอบครัวให้โทรตรวจสอบ

คำถามที่พบบ่อย

ระบบ Weight Sensor ติดตามการทานยาทำงานอย่างไร?
วางกล่องยาบนตาชั่ง Smart Scale หรือ Load Cell เมื่อผู้สูงอายุหยิบยา น้ำหนักลดลง Home Assistant ตรวจจับการเปลี่ยนแปลงและบันทึกว่า ทานยาแล้ว ถ้าน้ำหนักไม่เปลี่ยนตามเวลาที่กำหนด ระบบแจ้งว่า ลืมทาน
ราคา Hardware ระบบติดตามทานยาเริ่มต้นเท่าไร?
เริ่มต้นที่ HX711 + Load Cell DIY ราคา 150-300 บาท หรือ Xiaomi Smart Scale 2 ราคา 600-900 บาท ทั้งสองรุ่นรองรับ Home Assistant Smart Pill Dispenser ราคา 2,000-5,000 บาท ครบวงจรแต่ราคาสูง
ระบบแจ้งครอบครัวอย่างไรเมื่อผู้สูงอายุลืมทานยา?
ถ้า Weight Sensor ไม่ตรวจพบการเปลี่ยนแปลงภายใน 30-60 นาทีหลังเวลาทานยา HA ส่ง Alert ไปยัง LINE Group ครอบครัวทันที พร้อมเวลาและประเภทยาที่ยังไม่ทาน ครอบครัวโทรตรวจสอบหรือขอให้เพื่อนบ้านช่วยได้
Weekly Medication Report บน LINE มีข้อมูลอะไรบ้าง?
สรุปการทานยาครบ 7 วันแบ่งตามมื้อ เช้า/เย็น/ก่อนนอน แสดงเป็น X/7 วัน ช่วยให้ครอบครัวเห็นแนวโน้มระยะยาวว่าช่วงเวลาใดที่ผู้สูงอายุมักลืม และปรับโปรโตคอลดูแลได้