Quản lý hồ sơ người thân cao tuổi. Hỗ trợ chăm sóc nhiều người cùng lúc (bà nội, ông nội, bố mẹ già...). Mỗi người có profile riêng với sensors, contacts, config riêng. Gia đình quản lý qua chat: - "thêm ông nội" → tạo profile mới - "danh sách người thân" → list all elders - "xoá profile ông nội" → deactivate (không xoá data) Auto-migration: Nếu chưa có profiles → tự tạo "Bà Nội" từ config hiện tại. Không cần gia đình làm gì.
Khi bất kỳ eldercare skill chạy, TRƯỚC TIÊN check memory eldercare_profiles:
Đọc eldercare_contacts, eldercare_devices_config →
Tạo eldercare_profiles với 1 elder "ba_noi" →
Map entities hiện tại (grandma_room_*) vào profile →
Lưu memory eldercare_profiles
Khi tạo default profile, dùng thông tin từ profiles-config.json:
{
"id": "ba_noi",
"name": "Bà Nội",
"age": 90,
"room": "grandma_room",
"mobility": "bedridden",
"hearing": "hard_of_hearing",
"ha_entities": {
"presence": "binary_sensor.grandma_room_presence",
"motion": "sensor.grandma_room_motion_minutes",
"temperature": "sensor.grandma_room_temperature",
"humidity": "sensor.grandma_room_humidity",
"media_player": "media_player.grandma_room",
"light": "light.grandma_room",
"sos_button": "sensor.sos_button_action",
"camera": "camera.grandma_room",
"fall_detection": "binary_sensor.grandma_room_fall_detected",
"target_count": "sensor.grandma_room_target_count"
},
"tts": {
"volume": 0.9,
"rate": 0.8,
"voice": "vi-VN"
},
"active": true
}
Contacts: Copy từ memory eldercare_contacts (nếu có) vào elder.contacts.
Gia đình nhắn: "thêm ông nội" hoặc "add ong noi"
Flow:
Gia đình nhắn: "sửa profile bà nội" hoặc "thay đổi thông tin ông nội"
Flow:
eldercare_profilesGia đình nhắn: "xoá profile ông nội" hoặc "tắt giám sát ông nội"
Flow:
active: false (KHÔNG xoá data — dữ liệu vẫn giữ)Gia đình nhắn: "danh sách người thân" hoặc "list elders"
Reply format:
👨👩👧👦 Danh sách người thân:
1. 👵 Bà Nội (90 tuổi) — Phòng ngủ chính ✅ Đang giám sát
Sensors: 5/5 online | Contacts: 2 người
2. 👴 Ông Nội (88 tuổi) — Phòng khách ✅ Đang giám sát
Sensors: 3/5 online | Contacts: 2 người
3. 👨 Ba (65 tuổi) — Tầng 2 ⏸️ Tạm tắt
TẤT CẢ eldercare skills PHẢI thay đổi logic:
TRƯỚC:
1. Đọc entity grandma_room_presence → check alert
SAU:
1. Đọc eldercare_profiles → lấy list active elders
2. NẾU không có profiles → auto-migrate (tạo default)
3. VỚI MỖI active elder:
a. Lấy HA entities từ profile (elder.ha_entities.presence)
b. Đọc entity → check alert
c. Dùng elder.id làm prefix cho memory keys
d. Dùng elder.contacts cho alert recipients
e. Dùng elder.tts cho TTS settings
4. Alert message bao gồm tên elder: "⚠️ Bà Nội: bất động > 30 phút"
TRƯỚC (hardcoded, 1 elder):
eldercare_monitor_{timestamp}
eldercare_health_blood_pressure_{timestamp}
eldercare_sleep_{date}
eldercare_queue_{timestamp}
SAU (namespaced by elder_id):
eldercare_{elder_id}_monitor_{timestamp}
eldercare_{elder_id}_health_blood_pressure_{timestamp}
eldercare_{elder_id}_sleep_{date}
eldercare_{elder_id}_queue_{timestamp}
VÍ DỤ:
eldercare_ba_noi_monitor_2026-02-20T10:00:00
eldercare_ong_noi_health_blood_pressure_2026-02-20T08:30:00
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Slug: "ba_noi", "ong_noi" |
| name | string | Yes | Display: "Bà Nội", "Ông Nội" |
| age | number | No | Tuổi |
| room | string | Yes | Room name prefix cho HA entities |
| mobility | enum | No | bedridden / wheelchair / walking_with_aid / independent |
| hearing | enum | No | normal / hard_of_hearing / deaf |
| conditions | string[] | No | Bệnh nền |
| ha_entities | object | Yes | Map HA entity IDs |
| tts | object | No | Volume, rate, voice |
| contacts | array | No | Per-elder contacts (override global) |
| medication | object | No | Per-elder medication config |
| exercise_level | number | No | 1/2/3 |
| active | boolean | Yes | true = đang giám sát |
QUY TẮC QUAN TRỌNG NHẤT:
Nếu eldercare_profiles KHÔNG TỒN TẠI trong memory:
→ Tạo AUTO-MIGRATE profile mặc định:
- id: "ba_noi"
- Dùng tất cả entity names hiện tại (grandma_room_*)
- Dùng contacts/config hiện tại
→ Tất cả skills hoạt động Y HỆT cũ
→ Gia đình KHÔNG cần làm gì
Nếu eldercare_profiles TỒN TẠI:
→ Đọc profiles, loop qua active elders
→ Mỗi elder dùng HA entities từ profile
→ Memory keys prefix bằng elder_id
Control Philips Hue lights and scenes via the OpenHue CLI.