Haiven
Elderly care monitoring for Home Assistant. Tracks daily activity patterns using motion and presence sensors, detects routine deviations, and alerts caregivers.
Read SAFETY.md before installing. THIS IS NOT A MEDICAL SYSTEM - it was built as a personal project, it’s at best a wellness / wellbeing support aid. No warranties and doesn’t replace human care, love and decency, but can take the edge off some of the anxiety of caring for someone at a distance.
What it does
- Tracks wake time, bedtime, and room-to-room movement using 3 sensors
- Gives a daily routine verdict (On track, A little off, Off track) against the person’s own last 28 days, with the reason, alongside a 5-level safety status (normal to critical)
- Sends morning, afternoon, and evening summaries to carers, in plain text or (optionally) worded by an AI agent
- Alerts on missed wake times, prolonged inactivity, unusual bathroom visits, and more
- Care circle tracking — knows which carer is nearest during an alert
- Home and away: tells the carers when the person goes out and when they are back, for trips of 15 minutes or more
- Dashboard with live status, activity timeline, and weekly trends
- Drift Watch: catches a routine sliding slowly over a month, the kind of change a day-to-day average can’t see
- Sensor coverage screen: shows exactly what stops working when a sensor goes offline, not just that it did
- Fewer false alarms: a seven-night calibration and a “visitor here” setting quieten alerts without dropping any
- Optional camera: one still after an alert, sent as a follow-up, with an optional AI description. Off by default
- Fault alerts: tells every carer when a sensor or the camera stops reporting or a battery runs low, and a hub watchdog for when the hub itself goes offline
- Ask (optional, admins only): a read-only chat over the recorded data, for questions such as “have night bathroom visits changed since the summer?”
What you need
Hardware (3 sensors): you can add more but will need to configure for that.
- Main room: Motion or presence sensor (MMW radar, Zigbee PIR, etc.). I use a RingCamera with motion events. So can also parse snapshots through to check if needed (works okayish)
- Bedroom: Motion or Presence sensor with zone support if want in bed detection
- Bathroom: battery motion (PIR) sensor, Zigbee or Bluetooth
Software:
- Home Assistant 2024.10 or later
- kiosk-mode, optional, through HACS or downloaded into
/config/www/kiosk-mode/. configuration.yaml loads it from /hacsfiles/kiosk-mode/; change that to /local/kiosk-mode/ for a direct download, or remove the line to go without. It hides Home Assistant’s header and sidebar on the dashboard.
- Optional AI wording. AI wording is optional and off by default. With it off, summaries and alerts are plain text built on the hub and no activity data is sent to any AI provider. To turn it on, install a conversation agent (the Anthropic Conversation integration gives
conversation.claude_conversation, the default), then switch on input_boolean.haiven_ai_summaries. Expect roughly $1-5 a month on Claude Haiku 4.5.
Privacy: with AI wording off, activity data stays on the hub and only the alert text leaves, through the notification channel. With it on, each summary and alert also sends the person’s recent activity (rooms, times, bathroom visits, wake and bedtime) to your AI provider. An alert still sends as plain text if the AI call fails.
Quick start
# 1. Clone somewhere OTHER than /config (it already holds your setup)
git clone https://github.com/hazzap123/haiven.git ~/haiven
cd ~/haiven
# 2. Set your sensor entity IDs. This rewrites every .yaml and .js file in
# the clone, so run it here, never inside /config.
bash scripts/setup.sh
# 3. Copy the Haiven files into /config
cp -r packages scripts www www-src lovelace themes /config/
cp haiven_sensors_3sensor.yaml haiven_persons.yaml haiven_zones.yaml /config/
Do not overwrite your own configuration.yaml, automations.yaml, scripts.yaml or scenes.yaml. If you have none of your own yet, copy Haiven’s. Otherwise merge by hand: add Haiven’s homeassistant.packages, frontend, lovelace, shell_command, command_line, recorder and sensor blocks to your configuration.yaml, and append Haiven’s automations and scripts to yours. Copying over them deletes every automation and script you made in the UI.
Then, in /config:
- Copy
~/haiven/secrets.yaml.example to /config/secrets.yaml (or merge it into yours) and fill in your values.
- Edit
haiven_persons.yaml with your household members and packages/haiven_care_circle_inputs.yaml with carer details.
- Restart Home Assistant.
- Set the expected wake time, bedtime and thresholds on the dashboard’s Settings screen (see the Quick Start). They have no defaults.
See docs/setup/QUICKSTART.md for the full 30-minute setup guide. Ask is a separate, optional install: see docs/setup/ASK.md.
Documentation
| Guide |
Description |
| Safety and limits |
Read first: what it is not, what can fail, what leaves the house, consent |
| Install |
Two paths: already on Home Assistant, or new to it |
| Scope |
What Haiven is for, and the rules every change keeps |
| Remote access |
Home Assistant Cloud for carers’ phones, Tailscale and SSH for you, and the test before the hub moves |
| Full setup prompt |
Planning the home and routine, sensors, install, tests, a week of calibration against real data, handover |
| First install prompt |
A prompt for an AI coding assistant to walk you through the install |
| House profile |
Template for adapting the rules to one home, with the prompt |
| Quick Start |
30-minute fast path |
| Complete Setup |
Full installation guide |
| Care Circle |
Contact and notification setup |
| Ask |
Optional read-only chat over the data: install, cost, privacy |
| Entity Reference |
All entity IDs |
| Sensor Guides |
Hardware configuration |
| Troubleshooting |
Problem solving |
How it works
Haiven triangulates location from 3 sensors to build a picture of daily activity:
An example day (your times will differ):
| Time |
Example Pattern |
Primary Sensor |
| 06:30-07:30 |
Wake — first kitchen motion |
Kitchen |
| Daytime |
Kitchen/living room activity |
Kitchen |
| 21:00-22:30 |
Bedtime routine |
Bathroom then Bedroom |
| Night |
Occasional bathroom visits |
Bathroom |
Deviations from this pattern trigger escalating alerts — from a gentle “check in” to urgent notifications to the nearest carer.
Architecture
configuration.yaml # Main config — includes all packages
├── automations.yaml # All automation logic
├── haiven_sensors_3sensor.yaml # Template sensors (status, scoring, timing)
├── scripts.yaml # Notification and utility scripts
├── scripts/ # Python helpers the packages below shell out to
│ ├── night_stats.py # Rebuilds each night from the activity log
│ ├── drift_stats.py # Slow-drift detection over a month of nights
│ ├── movement_today.py # Today's movement vs a 7-day average
│ ├── routine_stats.py # Daily routine verdict vs the last 28 days
│ └── ask_days.py # One row per day, for Ask
├── packages/
│ ├── haiven_care_circle_inputs.yaml # Contact configuration
│ ├── haiven_monitoring_inputs.yaml # Thresholds and state machines
│ ├── haiven_comms_inputs.yaml # Summary and alert text
│ ├── haiven_bathroom_night.yaml # Night bathroom monitoring
│ ├── haiven_circle_tracking.yaml # Care circle location sensors
│ ├── haiven_drift.yaml # Drift Watch: a month of nights vs a frozen baseline
│ ├── haiven_night_insights.yaml # Nightly bathroom-visit and downstairs-trip stats
│ ├── haiven_movement.yaml # Today's all-room movement vs a 7-day average
│ ├── haiven_routine.yaml # Daily routine verdict and the 30-day strip
│ ├── haiven_faults.yaml # Sensor and camera offline, low battery, hub watchdog
│ ├── haiven_pause.yaml # Visitor present and calibration
│ └── haiven_camera.yaml # Optional: a still after an alert
├── haiven_persons.yaml # Person entities
├── haiven_zones.yaml # Geographic zones
├── www-src/ # Dashboard card source (deployed to www/ by setup.sh)
│ ├── haiven-cards.js
│ └── haiven-loader.js
├── lovelace/
│ └── haiven_default.yaml # Dashboard
└── ha_integrations/
└── haiven_chat/ # Ask: optional custom integration (copy to custom_components/)
Contributing
Bug reports, sensor guides and fixes are welcome. See CONTRIBUTING.md. The tests run without Home Assistant: pip install pytest pyyaml jinja2 && pytest.
Licence
MIT — see LICENSE.
评论