{"id":51331039,"url":"https://github.com/jamesecc/ha-presence-sim","last_synced_at":"2026-07-01T23:01:45.745Z","repository":{"id":367296044,"uuid":"1277379672","full_name":"jamesecc/ha-presence-sim","owner":"jamesecc","description":"Home Assistant integration that learns your light/energy usage and runs a realistic, randomized away-mode presence simulation.","archived":false,"fork":false,"pushed_at":"2026-06-25T11:08:23.000Z","size":1717,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-25T12:13:44.115Z","etag":null,"topics":["hacs","home-assistant","home-automation","integration","presence-simulation","security"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jamesecc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-22T21:00:43.000Z","updated_at":"2026-06-22T22:30:46.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/jamesecc/ha-presence-sim","commit_stats":null,"previous_names":["jamesecc/ha-presence-sim"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/jamesecc/ha-presence-sim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesecc%2Fha-presence-sim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesecc%2Fha-presence-sim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesecc%2Fha-presence-sim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesecc%2Fha-presence-sim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamesecc","download_url":"https://codeload.github.com/jamesecc/ha-presence-sim/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesecc%2Fha-presence-sim/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35025983,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-01T02:00:05.325Z","response_time":130,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacs","home-assistant","home-automation","integration","presence-simulation","security"],"created_at":"2026-07-01T23:01:42.939Z","updated_at":"2026-07-01T23:01:45.737Z","avatar_url":"https://github.com/jamesecc.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Presence Simulator\n\nA Home Assistant custom integration that **learns** how your home normally uses\nlights and energy over the week, then replays a **realistic, randomized**\nversion of that activity while you're away — so anyone watching the house can't\ntell it's empty.\n\n## What it does\n\n1. **Learns** – every 5 minutes it samples the entities you tell it to *monitor*\n   (lights, switches, power/energy sensors, media players, …) and builds a\n   per-entity, per-time-of-week probability model (the chance each thing is\n   \"active\" in each 30-minute slot, for each day of the week). Power/energy\n   sensors count as \"active\" above a configurable wattage threshold.\n2. **Simulates** – when away mode is on, every time slot it decides which of\n   your *controlled* entities (lights, switches, …) to turn on/off, drawn from\n   the learned probabilities but with deliberate randomness so the pattern never\n   repeats identically day to day:\n   - probabilistic on/off per slot (not a fixed replay),\n   - a chance to deviate from the learned habit (`randomness`),\n   - random timing *jitter* within each slot so changes don't all happen on the\n     clock tick,\n   - a minimum *dwell* time so lights don't flicker,\n   - a cap on how many controlled entities are on at once,\n   - quiet overnight hours where almost everything stays off.\n   - Controlled entities you never monitored fall back to your home's overall\n     activity profile.\n\n   When away mode turns off, anything the simulator switched on is turned back\n   off so you don't come home to a lit-up house.\n\n## Install\n\n**Via HACS (recommended):** HACS → ⋮ → *Custom repositories* → add this repo's\nURL with category **Integration** → install **Presence Simulator** → restart\nHome Assistant.\n\n**Manually:** copy `custom_components/presence_simulator/` into your Home\nAssistant `config/custom_components/` folder and restart HA.\n\nThen **Settings → Devices \u0026 Services → Add Integration → Presence Simulator**.\n\n## Configure (all in the UI)\n\n- **Step 1 – Entities**: pick entities to *monitor* and entities to *control*.\n- **Step 2 – Behaviour**: slot size, randomness, min dwell, jitter, max\n  concurrent fraction, power threshold, and quiet hours. Sensible defaults are\n  provided. All of this is editable later via **Configure**.\n\n## Entities created\n\n- `switch.presence_simulator_away_simulation` – turn on to start simulating.\n- `sensor.presence_simulator_learning_coverage` – % of the weekly schedule\n  observed at least once (let it run ~1 week for full coverage).\n- `sensor.presence_simulator_observations` – total samples collected.\n\n## Services\n\n- `presence_simulator.reset_model` – wipe learned history.\n- `presence_simulator.run_step` – force a simulation step now (for testing).\n- `presence_simulator.export_model` – returns a model summary (response data).\n\n## Example away-mode automation\n\nLet it learn for at least a few days first. Then flip the switch based on\npresence — e.g. when everyone leaves:\n\n```yaml\nalias: Presence Simulator - follow occupancy\ntrigger:\n  - platform: state\n    entity_id: group.family   # or zone.home person count, alarm armed_away, etc.\n    to: \"not_home\"\n    for: \"00:10:00\"\n  - platform: state\n    entity_id: group.family\n    to: \"home\"\naction:\n  - service: \"switch.turn_{{ 'on' if trigger.to_state.state == 'not_home' else 'off' }}\"\n    target:\n      entity_id: switch.presence_simulator_away_simulation\nmode: single\n```\n\nOr tie it to your alarm: turn the switch on when armed `away`, off when\ndisarmed.\n\n## Notes\n\n- The model is persisted, so it survives restarts and keeps improving.\n- Changing the slot size resets the model (bucket layout changes).\n- This is a deterrent, not a guarantee; combine with other security measures.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesecc%2Fha-presence-sim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamesecc%2Fha-presence-sim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesecc%2Fha-presence-sim/lists"}