{"id":34775172,"url":"https://github.com/paradox460/homeassistant-pkl","last_synced_at":"2026-03-15T03:01:16.193Z","repository":{"id":305767935,"uuid":"1023873164","full_name":"paradox460/homeassistant-pkl","owner":"paradox460","description":"Pkl types for HomeAssistant config","archived":false,"fork":false,"pushed_at":"2025-07-21T22:04:01.000Z","size":373,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-21T23:15:21.441Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Pkl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paradox460.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2025-07-21T20:40:21.000Z","updated_at":"2025-07-21T22:04:05.000Z","dependencies_parsed_at":"2025-07-21T23:25:31.122Z","dependency_job_id":null,"html_url":"https://github.com/paradox460/homeassistant-pkl","commit_stats":null,"previous_names":["paradox460/homeassistant-pkl"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/paradox460/homeassistant-pkl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paradox460%2Fhomeassistant-pkl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paradox460%2Fhomeassistant-pkl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paradox460%2Fhomeassistant-pkl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paradox460%2Fhomeassistant-pkl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paradox460","download_url":"https://codeload.github.com/paradox460/homeassistant-pkl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paradox460%2Fhomeassistant-pkl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28024424,"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-12-25T02:00:05.988Z","response_time":58,"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-12-25T08:14:56.965Z","updated_at":"2025-12-25T08:14:57.500Z","avatar_url":"https://github.com/paradox460.png","language":"Pkl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Homeassistant Pkl types\n\n\u003e [!WARNING]\n\u003e Exert caution.\n\u003e\n\u003e This project was autogenerated from the HomeAssistant VSCode YAML, and can sometimes generate weird outputs.\n\u003e\n\u003e Some things, like the binary sensor below, work well. Others don't work at all and give you impossible type errors.\n\u003e\n\u003e Fortunately, Pkl is expressive enough you can generally write what you need\n\n\nThis package contains [Pkl](https://pkl-lang.org) types for Home Assistant YAML configuration files.\n\nThey are automatically generated from the [HomeAssistant VSCode plugin](https://github.com/keesschollaart81/vscode-home-assistant).\n\n## Usage\n\nIn a Pkl file, you can use them like this:\n\n```pkl\nimport \"package://pkg.pkl-lang.org/github.com/paradox460/homeassistant-pkl@2025.7.21#/type/IntegrationTemplate.pkl\"\n\nbinary_sensor = new Listing {\n  new {\n    name = \"Door Left Open\"\n    unique_id = name.sha1\n    icon = \"mdi:door-open\"\n    state = \"\"\"\n    {{ label_entities(\"door sensor\") | map(\"states\") |  select(\"equalto\", \"open\") | first == \"open\" }}\n    \"\"\"\n  }\n  new {\n    name = \"Doors Closed\"\n    unique_id = name.sha1\n    icon = \"mdi:door\"\n    state = \"\"\"\n    {{ label_entities(\"door sensor\") | map(\"states\") |  select(\"equalto\", \"closed\") | first == \"closed\" }}\n    \"\"\"\n  }\n}\n\noutput {\n  renderer = new YamlRenderer {}\n}\n```\n\nIf you run that pkl with `pkl eval`, you will get the following yaml output:\n\n```yaml\nbinary_sensor:\n- name: Door Left Open\n  unique_id: 88f60ebfff0f2811b3a0a3c84355704a78fc3d00\n  icon: mdi:door-open\n  state: '{{ label_entities(\"door sensor\") | map(\"states\") |  select(\"equalto\", \"open\") | first == \"open\" }}'\n- name: Doors Closed\n  unique_id: 4da710019ce071440e7752b22f2888d011983961\n  icon: mdi:door\n  state: '{{ label_entities(\"door sensor\") | map(\"states\") |  select(\"equalto\", \"closed\") | first == \"closed\" }}'\n```\n\n## Rationale\n\nWriting YAML isnt' really pleasant. Writing Pkl is pleasant. Thats my main motivation for this package.\n\nIf thats not a strong enough motivation for you, consider that you can make reusable objects (i.e. a binary sensor that only varies slightly for many different base entities) and iterate over them very quickly, generating a syntactically correct YAML without all the indentation tracking headaches.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparadox460%2Fhomeassistant-pkl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparadox460%2Fhomeassistant-pkl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparadox460%2Fhomeassistant-pkl/lists"}