{"definition_raw":"---\nid: frequently-used\ntitle: Rebuild the adaptive \"Frequently Used\" section on the HA home dashboard\nschedule: \"0 */6 * * *\"\ntimeout: 300\nretry: true\nenabled: true\nnotify_on: failure\nrun_as: shell\ncommand: \"python3 /home/lucienne/workspace/scripts/ha/frequently_used.py\"\ntags: [home-assistant, dashboard, lighting]\nruntime_profile: direct_python\n---\n\n**OVERRIDES runtime profile:** uses `direct_python` because this deterministic\nHome Assistant dashboard update script does not invoke Claude/Codex or any LLM\nAPI.\n\nEvery 6 hours. Keeps a \"Frequently Used\" grid at the top of the HA home\ndashboard, populated with the controls Elmar actually uses most.\n\nEach run:\n- reads the HA logbook for **user-initiated** control actions only \u2014 a real\n  person pressed it in the UI. Automation/occupancy-triggered changes and\n  physical-switch presses are excluded (no `context_user_id`).\n- appends events to `~/workspace/state/usage_events.jsonl` (HA recorder only\n  keeps ~10 days; the ledger lets scoring span months)\n- scores each entity with recency-weighted decay (half-life 14 days) so\n  controls you stop using fade out and get replaced\n- rewrites the top-8 grid on home view 0\n\nTunables in the script: `TOP_N`, `HALF_LIFE_DAYS`, `LEDGER_KEEP_DAYS`,\n`CONTROL_DOMAINS`, `SECTION_TITLE`.\n\nScript: `scripts/ha/frequently_used.py`. Idempotent \u2014 finds the existing\n\"Frequently Used\" title card and replaces only the grid after it.\n","id":"frequently-used","last_run":{"duration_s":16.2454,"log_path":"/home/lucienne/workspace/logs/task-runs/frequently-used/413830.log","output":"collected 0 new events | ledger 363 | ranked 42 entities\n   28.98  switch.garage\n   23.77  cover.garage_elmar\n   23.77  switch.sonoff_100113ef54\n   18.75  light.elmar_lamp\n   12.48  light.dining_lamp\n   12.22  light.lounge_lamp\n   11.23  cover.garage_gym\n   11.23  switch.sonoff_1001865d8d\ndashboard save: True \n","started_at":"2026-06-13T06:00:07.230972+02:00","status":"completed"},"next_run":"2026-06-13 12:00","next_run_iso":"2026-06-13T12:00:00+02:00","runs":[{"duration_s":16.2454,"finished_at":"2026-06-13T06:00:23.478416+02:00","id":413830,"log_path":"/home/lucienne/workspace/logs/task-runs/frequently-used/413830.log","output":"collected 0 new events | ledger 363 | ranked 42 entities\n   28.98  switch.garage\n   23.77  cover.garage_elmar\n   23.77  switch.sonoff_100113ef54\n   18.75  light.elmar_lamp\n   12.48  light.dining_lamp\n   12.22  light.lounge_lamp\n   11.23  cover.garage_gym\n   11.23  switch.sonoff_1001865d8d\ndashboard save: True \n","started_at":"2026-06-13T06:00:07.230972+02:00","status":"completed","task_id":"frequently-used","task_name":"Rebuild the adaptive \"Frequently Used\" section on the HA home dashboard"},{"duration_s":20.398425,"finished_at":"2026-06-13T00:00:24.926660+02:00","id":412776,"log_path":"/home/lucienne/workspace/logs/task-runs/frequently-used/412776.log","output":"collected 1 new events | ledger 363 | ranked 42 entities\n   29.34  switch.garage\n   24.07  cover.garage_elmar\n   24.07  switch.sonoff_100113ef54\n   18.98  light.elmar_lamp\n   12.63  light.dining_lamp\n   12.38  light.lounge_lamp\n   11.37  cover.garage_gym\n   11.37  switch.sonoff_1001865d8d\ndashboard save: True \n","started_at":"2026-06-13T00:00:04.525789+02:00","status":"completed","task_id":"frequently-used","task_name":"Rebuild the adaptive \"Frequently Used\" section on the HA home dashboard"},{"duration_s":30.624218,"finished_at":"2026-06-12T18:00:52.957870+02:00","id":411737,"log_path":"/home/lucienne/workspace/logs/task-runs/frequently-used/411737.log","output":"collected 4 new events | ledger 362 | ranked 42 entities\n   29.71  switch.garage\n   24.37  cover.garage_elmar\n   24.37  switch.sonoff_100113ef54\n   19.22  light.elmar_lamp\n   12.79  light.dining_lamp\n   12.53  light.lounge_lamp\n   11.51  cover.garage_gym\n   11.51  switch.sonoff_1001865d8d\ndashboard save: True \n","started_at":"2026-06-12T18:00:22.330355+02:00","status":"completed","task_id":"frequently-used","task_name":"Rebuild the adaptive \"Frequently Used\" section on the HA home dashboard"},{"duration_s":17.50115,"finished_at":"2026-06-12T12:03:53.364358+02:00","id":410709,"log_path":"/home/lucienne/workspace/logs/task-runs/frequently-used/410709.log","output":"collected 0 new events | ledger 358 | ranked 42 entities\n   30.07  switch.garage\n   24.67  cover.garage_elmar\n   24.67  switch.sonoff_100113ef54\n   19.45  light.elmar_lamp\n   11.94  light.dining_lamp\n   11.68  light.lounge_lamp\n   11.65  cover.garage_gym\n   11.65  switch.sonoff_1001865d8d\ndashboard save: True \n","started_at":"2026-06-12T12:03:35.859749+02:00","status":"completed","task_id":"frequently-used","task_name":"Rebuild the adaptive \"Frequently Used\" section on the HA home dashboard"},{"duration_s":16.458919,"finished_at":"2026-06-12T06:00:49.068067+02:00","id":409666,"log_path":"/home/lucienne/workspace/logs/task-runs/frequently-used/409666.log","output":"collected 0 new events | ledger 358 | ranked 42 entities\n   30.45  switch.garage\n   24.98  cover.garage_elmar\n   24.98  switch.sonoff_100113ef54\n   19.70  light.elmar_lamp\n   12.09  light.dining_lamp\n   11.83  light.lounge_lamp\n   11.80  cover.garage_gym\n   11.80  switch.sonoff_1001865d8d\ndashboard save: True \n","started_at":"2026-06-12T06:00:32.606616+02:00","status":"completed","task_id":"frequently-used","task_name":"Rebuild the adaptive \"Frequently Used\" section on the HA home dashboard"},{"duration_s":28.073687,"finished_at":"2026-06-12T00:00:30.889547+02:00","id":408613,"log_path":"/home/lucienne/workspace/logs/task-runs/frequently-used/408613.log","output":"collected 1 new events | ledger 358 | ranked 42 entities\n   30.83  switch.garage\n   25.29  cover.garage_elmar\n   25.29  switch.sonoff_100113ef54\n   19.94  light.elmar_lamp\n   12.24  light.dining_lamp\n   11.97  light.lounge_lamp\n   11.95  cover.garage_gym\n   11.95  switch.sonoff_1001865d8d\ndashboard save: True \n","started_at":"2026-06-12T00:00:02.812633+02:00","status":"completed","task_id":"frequently-used","task_name":"Rebuild the adaptive \"Frequently Used\" section on the HA home dashboard"},{"duration_s":22.382932,"finished_at":"2026-06-11T18:00:25.279178+02:00","id":407503,"log_path":"/home/lucienne/workspace/logs/task-runs/frequently-used/407503.log","output":"collected 0 new events | ledger 357 | ranked 42 entities\n   31.21  switch.garage\n   25.61  cover.garage_elmar\n   25.61  switch.sonoff_100113ef54\n   19.18  light.elmar_lamp\n   12.40  light.dining_lamp\n   12.12  light.lounge_lamp\n   12.10  cover.garage_gym\n   12.10  switch.sonoff_1001865d8d\ndashboard save: True \n","started_at":"2026-06-11T18:00:02.893568+02:00","status":"completed","task_id":"frequently-used","task_name":"Rebuild the adaptive \"Frequently Used\" section on the HA home dashboard"},{"duration_s":19.503622,"finished_at":"2026-06-11T12:00:22.716063+02:00","id":406387,"log_path":"/home/lucienne/workspace/logs/task-runs/frequently-used/406387.log","output":"collected 0 new events | ledger 357 | ranked 42 entities\n   31.60  switch.garage\n   25.93  cover.garage_elmar\n   25.93  switch.sonoff_100113ef54\n   19.42  light.elmar_lamp\n   12.55  light.dining_lamp\n   12.25  cover.garage_gym\n   12.25  switch.sonoff_1001865d8d\n    4.41  light.nicolette_lamp\ndashboard save: True \n","started_at":"2026-06-11T12:00:03.209304+02:00","status":"completed","task_id":"frequently-used","task_name":"Rebuild the adaptive \"Frequently Used\" section on the HA home dashboard"},{"duration_s":15.676272,"finished_at":"2026-06-11T06:00:46.983907+02:00","id":405291,"log_path":"/home/lucienne/workspace/logs/task-runs/frequently-used/405291.log","output":"collected 0 new events | ledger 357 | ranked 42 entities\n   32.00  switch.garage\n   26.25  cover.garage_elmar\n   26.25  switch.sonoff_100113ef54\n   19.66  light.elmar_lamp\n   12.71  light.dining_lamp\n   12.43  light.lounge_lamp\n   12.40  cover.garage_gym\n   12.40  switch.sonoff_1001865d8d\ndashboard save: True \n","started_at":"2026-06-11T06:00:31.304923+02:00","status":"completed","task_id":"frequently-used","task_name":"Rebuild the adaptive \"Frequently Used\" section on the HA home dashboard"},{"duration_s":18.422508,"finished_at":"2026-06-11T00:05:45.881989+02:00","id":404254,"log_path":"/home/lucienne/workspace/logs/task-runs/frequently-used/404254.log","output":"collected 7 new events | ledger 357 | ranked 42 entities\n   32.39  switch.garage\n   26.57  cover.garage_elmar\n   26.57  switch.sonoff_100113ef54\n   19.90  light.elmar_lamp\n   12.86  light.dining_lamp\n   12.58  light.lounge_lamp\n   12.55  cover.garage_gym\n   12.55  switch.sonoff_1001865d8d\ndashboard save: True \n","started_at":"2026-06-11T00:05:27.456654+02:00","status":"completed","task_id":"frequently-used","task_name":"Rebuild the adaptive \"Frequently Used\" section on the HA home dashboard"},{"duration_s":22.243317,"finished_at":"2026-06-10T18:00:25.149868+02:00","id":403150,"log_path":"/home/lucienne/workspace/logs/task-runs/frequently-used/403150.log","output":"collected 11 new events | ledger 350 | ranked 42 entities\n   30.80  switch.garage\n   26.91  cover.garage_elmar\n   26.91  switch.sonoff_100113ef54\n   19.15  light.elmar_lamp\n   13.03  light.dining_lamp\n   12.74  light.lounge_lamp\n   10.71  cover.garage_gym\n   10.71  switch.sonoff_1001865d8d\ndashboard save: True \n","started_at":"2026-06-10T18:00:02.902706+02:00","status":"completed","task_id":"frequently-used","task_name":"Rebuild the adaptive \"Frequently Used\" section on the HA home dashboard"},{"duration_s":170.309063,"finished_at":"2026-06-10T12:03:14.941024+02:00","id":402116,"log_path":"/home/lucienne/workspace/logs/task-runs/frequently-used/402116.log","output":"Self-healed (attempt 1): collected 0 new events | ledger 339 | ranked 42 entities\n   27.24  cover.garage_elmar\n   27.24  switch.sonoff_100113ef54\n   19.39  light.elmar_lamp\n   11.17  light.dining_lamp\n   10.88  light.lounge_lamp\n    9.83  cover.garage_gym\n    9.83  switch.sonoff_1001865d8d\n    4.63  light.nicolette_lamp\ndashboard save: True \n","started_at":"2026-06-10T12:00:24.626429+02:00","status":"completed","task_id":"frequently-used","task_name":"Rebuild the adaptive \"Frequently Used\" section on the HA home dashboard"},{"duration_s":15.731028,"finished_at":"2026-06-10T06:00:46.888067+02:00","id":401021,"log_path":"/home/lucienne/workspace/logs/task-runs/frequently-used/401021.log","output":"collected 5 new events | ledger 337 | ranked 42 entities\n   30.55  switch.garage\n   27.58  cover.garage_elmar\n   27.58  switch.sonoff_100113ef54\n   18.63  light.elmar_lamp\n   11.31  light.dining_lamp\n   11.01  light.lounge_lamp\n    9.96  cover.garage_gym\n    9.96  switch.sonoff_1001865d8d\ndashboard save: True \n","started_at":"2026-06-10T06:00:31.154239+02:00","status":"completed","task_id":"frequently-used","task_name":"Rebuild the adaptive \"Frequently Used\" section on the HA home dashboard"},{"duration_s":19.347463,"finished_at":"2026-06-10T00:05:32.048366+02:00","id":399985,"log_path":"/home/lucienne/workspace/logs/task-runs/frequently-used/399985.log","output":"collected 0 new events | ledger 332 | ranked 42 entities\n   30.92  switch.garage\n   27.92  cover.garage_elmar\n   27.92  switch.sonoff_100113ef54\n   13.80  light.elmar_lamp\n   11.45  light.dining_lamp\n   11.15  light.lounge_lamp\n   10.08  cover.garage_gym\n   10.08  switch.sonoff_1001865d8d\ndashboard save: True \n","started_at":"2026-06-10T00:05:12.697497+02:00","status":"completed","task_id":"frequently-used","task_name":"Rebuild the adaptive \"Frequently Used\" section on the HA home dashboard"},{"duration_s":21.445148,"finished_at":"2026-06-09T18:00:24.516313+02:00","id":398877,"log_path":"/home/lucienne/workspace/logs/task-runs/frequently-used/398877.log","output":"collected 17 new events | ledger 332 | ranked 42 entities\n   31.31  switch.garage\n   28.27  cover.garage_elmar\n   28.27  switch.sonoff_100113ef54\n   13.98  light.elmar_lamp\n   11.59  light.dining_lamp\n   11.29  light.lounge_lamp\n   10.20  cover.garage_gym\n   10.20  switch.sonoff_1001865d8d\ndashboard save: True \n","started_at":"2026-06-09T18:00:03.067460+02:00","status":"completed","task_id":"frequently-used","task_name":"Rebuild the adaptive \"Frequently Used\" section on the HA home dashboard"},{"duration_s":18.294851,"finished_at":"2026-06-09T12:00:21.262378+02:00","id":397829,"log_path":"/home/lucienne/workspace/logs/task-runs/frequently-used/397829.log","output":"collected 0 new events | ledger 315 | ranked 42 entities\n   30.69  switch.garage\n   23.58  cover.garage_elmar\n   23.58  switch.sonoff_100113ef54\n   14.15  light.elmar_lamp\n   10.73  light.dining_lamp\n   10.42  light.lounge_lamp\n    9.32  cover.garage_gym\n    9.32  switch.sonoff_1001865d8d\ndashboard save: True \n","started_at":"2026-06-09T12:00:02.963889+02:00","status":"completed","task_id":"frequently-used","task_name":"Rebuild the adaptive \"Frequently Used\" section on the HA home dashboard"},{"duration_s":15.716126,"finished_at":"2026-06-09T06:00:44.069872+02:00","id":396756,"log_path":"/home/lucienne/workspace/logs/task-runs/frequently-used/396756.log","output":"collected 0 new events | ledger 315 | ranked 42 entities\n   31.08  switch.garage\n   23.87  cover.garage_elmar\n   23.87  switch.sonoff_100113ef54\n   14.33  light.elmar_lamp\n   10.86  light.dining_lamp\n   10.55  light.lounge_lamp\n    9.44  cover.garage_gym\n    9.44  switch.sonoff_1001865d8d\ndashboard save: True \n","started_at":"2026-06-09T06:00:28.352020+02:00","status":"completed","task_id":"frequently-used","task_name":"Rebuild the adaptive \"Frequently Used\" section on the HA home dashboard"},{"duration_s":19.597822,"finished_at":"2026-06-09T00:00:34.281426+02:00","id":395742,"log_path":"/home/lucienne/workspace/logs/task-runs/frequently-used/395742.log","output":"collected 0 new events | ledger 315 | ranked 42 entities\n   31.46  switch.garage\n   24.17  cover.garage_elmar\n   24.17  switch.sonoff_100113ef54\n   14.51  light.elmar_lamp\n   11.00  light.dining_lamp\n   10.68  light.lounge_lamp\n    9.56  cover.garage_gym\n    9.56  switch.sonoff_1001865d8d\ndashboard save: True \n","started_at":"2026-06-09T00:00:14.680001+02:00","status":"completed","task_id":"frequently-used","task_name":"Rebuild the adaptive \"Frequently Used\" section on the HA home dashboard"},{"duration_s":21.718648,"finished_at":"2026-06-08T18:00:52.396790+02:00","id":394694,"log_path":"/home/lucienne/workspace/logs/task-runs/frequently-used/394694.log","output":"collected 62 new events | ledger 315 | ranked 42 entities\n   31.85  switch.garage\n   24.47  cover.garage_elmar\n   24.47  switch.sonoff_100113ef54\n   14.69  light.elmar_lamp\n   11.13  light.dining_lamp\n   10.82  light.lounge_lamp\n    9.67  cover.garage_gym\n    9.67  switch.sonoff_1001865d8d\ndashboard save: True \n","started_at":"2026-06-08T18:00:30.675007+02:00","status":"completed","task_id":"frequently-used","task_name":"Rebuild the adaptive \"Frequently Used\" section on the HA home dashboard"},{"duration_s":18.149566,"finished_at":"2026-06-08T12:00:20.864243+02:00","id":393683,"log_path":"/home/lucienne/workspace/logs/task-runs/frequently-used/393683.log","output":"collected 0 new events | ledger 253 | ranked 42 entities\n   14.87  light.elmar_lamp\n   14.15  switch.garage\n    9.80  cover.garage_gym\n    9.80  switch.sonoff_1001865d8d\n    9.26  light.dining_lamp\n    8.93  light.lounge_lamp\n    6.67  cover.garage_elmar\n    6.67  switch.sonoff_100113ef54\ndashboard save: True \n","started_at":"2026-06-08T12:00:02.711366+02:00","status":"completed","task_id":"frequently-used","task_name":"Rebuild the adaptive \"Frequently Used\" section on the HA home dashboard"}],"runs_limit":20,"schedule":"0 */6 * * *","schedule_label":{"description":"Every 6 hours at :00","is_custom":false,"label":"Every 6h","sort":3,"sort_time":""},"stats":{"avg_duration":26.736486833333334,"completed":30,"failed":0,"timeout":0,"total":30},"task":{"_description":"**OVERRIDES runtime profile:** uses `direct_python` because this deterministic\nHome Assistant dashboard update script does not invoke Claude/Codex or any LLM\nAPI.\n\nEvery 6 hours. Keeps a \"Frequently Used\" grid at the top of the HA home\ndashboard, populated with the controls Elmar actually uses most.\n\nEach run:\n- reads the HA logbook for **user-initiated** control actions only \u2014 a real\n  person pressed it in the UI. Automation/occupancy-triggered changes and\n  physical-switch presses are excluded (no `context_user_id`).\n- appends events to `~/workspace/state/usage_events.jsonl` (HA recorder only\n  keeps ~10 days; the ledger lets scoring span months)\n- scores each entity with recency-weighted decay (half-life 14 days) so\n  controls you stop using fade out and get replaced\n- rewrites the top-8 grid on home view 0\n\nTunables in the script: `TOP_N`, `HALF_LIFE_DAYS`, `LEDGER_KEEP_DAYS`,\n`CONTROL_DOMAINS`, `SECTION_TITLE`.\n\nScript: `scripts/ha/frequently_used.py`. Idempotent \u2014 finds the existing\n\"Frequently Used\" title card and replaces only the grid after it.","_file":"frequently-used.md","_path":"/home/lucienne/workspace/tasks/frequently-used.md","command":"python3 /home/lucienne/workspace/scripts/ha/frequently_used.py","enabled":true,"id":"frequently-used","notify_on":"failure","retry":true,"run_as":"shell","runtime_profile":"direct_python","schedule":"0 */6 * * *","tags":["home-assistant","dashboard","lighting"],"timeout":300,"title":"Rebuild the adaptive \"Frequently Used\" section on the HA home dashboard"}}
