{"id":31900515,"url":"https://github.com/adanowitz/HASSL","last_synced_at":"2025-10-13T12:08:32.190Z","repository":{"id":316286098,"uuid":"1062760141","full_name":"adanowitz/HASSL","owner":"adanowitz","description":"Home Assistant Simple Scripting Language","archived":false,"fork":false,"pushed_at":"2025-10-06T23:16:24.000Z","size":115,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-07T01:06:52.446Z","etag":null,"topics":[],"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/adanowitz.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":"2025-09-23T17:31:02.000Z","updated_at":"2025-10-06T23:16:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"7f7109d7-7453-40af-92a4-68a6eaf67e16","html_url":"https://github.com/adanowitz/HASSL","commit_stats":null,"previous_names":["adanowitz/hassl"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/adanowitz/HASSL","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adanowitz%2FHASSL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adanowitz%2FHASSL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adanowitz%2FHASSL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adanowitz%2FHASSL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adanowitz","download_url":"https://codeload.github.com/adanowitz/HASSL/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adanowitz%2FHASSL/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279015053,"owners_count":26085643,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"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":[],"created_at":"2025-10-13T12:02:00.804Z","updated_at":"2025-10-13T12:08:32.185Z","avatar_url":"https://github.com/adanowitz.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# HASSL\n\n\u003e **Home Assistant Simple Scripting Language**\n\nHASSL is a human-friendly domain-specific language (DSL) for building **loop-safe**, **deterministic**, and **composable** automations for [Home Assistant](https://www.home-assistant.io/).\n\nIt compiles lightweight `.hassl` scripts into fully functional YAML packages that plug directly into Home Assistant, replacing complex automations with a clean, readable syntax.\n\n---\n\n## 🚀 Features\n\n- **Readable DSL** → write logic like natural language (`if motion \u0026\u0026 lux \u003c 50 then light = on`)\n- **Sync devices** → keep switches, dimmers, and fans perfectly in sync\n- **Schedules** → declare time-based gates (`enable from 08:00 until 19:00`)\n- **Loop-safe** → context ID tracking prevents feedback loops\n- **Per-rule enable gates** → `disable rule` or `enable rule` dynamically\n- **Inline waits** → `wait (!motion for 10m)` works like native HA triggers\n- **Color temperature in Kelvin** → `light.kelvin = 2700`\n- **Auto-reload resilience** → schedules re-evaluate automatically on HA restart\n\n---\n\n## 🧰 Example\n\n```hassl\nalias light  = light.wesley_lamp\nalias motion = binary_sensor.wesley_motion_motion\nalias lux    = sensor.wesley_motion_illuminance\n\nschedule wake_hours:\n  enable from 08:00 until 19:00;\n\nrule wesley_motion_light:\n  schedule use wake_hours;\n  if (motion \u0026\u0026 lux \u003c 50)\n  then light = on;\n  wait (!motion for 10m) light = off\n\nrule landing_manual_off:\n  if (light == off) not_by any_hassl\n  then disable rule wesley_motion_light for 3m\n```\n\nProduces a complete Home Assistant package with:\n\n- Helpers (`input_boolean`, `input_text`, `input_number`)\n- Context-aware writer scripts\n- Sync automations for linked devices\n- Rule-based automations with schedules and `not_by` guards\n\n---\n\n## 🏗 Installation\n\n```bash\ngit clone https://github.com/adanowitz/hassl.git\ncd hassl\npip install -e .\n```\n\nVerify:\n\n```bash\nhasslc --help\n```\n\n---\n\n## ⚙️ Usage\n\n1. Create a `.hassl` script (e.g., `living_room.hassl`).\n2. Compile it into a Home Assistant package:\n   ```bash\n   hasslc living_room.hassl -o ./packages/living_room/\n   ```\n3. Copy the package into `/config/packages/` and reload automations.\n\nEach `.hassl` file compiles into an isolated package — no naming collisions, no shared helpers.\n\n---\n\n## 📦 Output Files\n\n| File                       | Description                                   |\n| -------------------------- | --------------------------------------------- |\n| `helpers_\u003cpkg\u003e.yaml`       | Defines all helpers (booleans, text, numbers) |\n| `scripts_\u003cpkg\u003e.yaml`       | Writer scripts with context stamping          |\n| `sync_\u003cpkg\u003e_*.yaml`        | Sync automations for each property            |\n| `rules_bundled_\u003cpkg\u003e.yaml` | Rule logic automations + schedules            |\n\n---\n\n## 🧠 Concepts\n\n| Concept      | Description                                                     |\n| ------------ | --------------------------------------------------------------- |\n| **Alias**    | Maps short names to HA entities (`alias light = light.kitchen`) |\n| **Sync**     | Keeps multiple devices aligned across on/off, brightness, etc.  |\n| **Rule**     | Defines reactive logic with guards, waits, and control flow.    |\n| **Schedule** | Defines active time windows, reusable across rules.             |\n| **Tag**      | Lightweight metadata stored in `input_text` helpers.            |\n\n---\n\n## 🔒 Loop Safety \u0026 Context Tracking\n\nHASSL automatically writes the **parent context ID** into helper entities before performing actions.\\\nThis ensures `not_by any_hassl` and `not_by rule(\"name\")` guards work flawlessly, preventing infinite feedback.\n\n---\n\n## 🕒 Schedules That Survive Restarts\n\nAll schedules are restart-safe:\n\n- `input_boolean.hassl_schedule_\u003cname\u003e` automatically re-evaluates on startup.\n- Triggers are set for both start and end times.\n- Missed events (like mid-day restarts) are recovered automatically.\n\n---\n\n## 📚 Documentation\n\nFor full grammar and detailed semantics, see the [HASSL Language Specification](./HASSL_Specification.md).\n\nFor a hands-on guide, check out the [Quickstart](./quickstart.md).\n\n---\n\n## 🧩 Contributing\n\nContributions, tests, and ideas welcome!\\\nTo run tests locally:\n\n```bash\npytest tests/\n```\n\nPlease open pull requests for grammar improvements, new device domains, or scheduling logic.\n\n---\n\n## 📄 License\n\nMIT License © 2025\\\nCreated and maintained by [@adanowitz](https://github.com/adanowitz)\n\n---\n\n**HASSL** — simple, reliable, human-readable automations for Home Assistant.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadanowitz%2FHASSL","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadanowitz%2FHASSL","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadanowitz%2FHASSL/lists"}