{"id":28477554,"url":"https://github.com/andrew-codechimp/ha-label-state","last_synced_at":"2026-03-08T00:32:39.471Z","repository":{"id":296222262,"uuid":"987004256","full_name":"andrew-codechimp/HA-Label-State","owner":"andrew-codechimp","description":"Label State helpers for Home Assistant","archived":false,"fork":false,"pushed_at":"2026-02-24T09:32:20.000Z","size":1486,"stargazers_count":29,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-02-24T15:32:24.670Z","etag":null,"topics":["hacs","hacs-integration","home-assistant","homeassistant","homeassistant-custom-component","homeassistant-integration"],"latest_commit_sha":null,"homepage":"","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/andrew-codechimp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","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},"funding":{"github":"andrew-codechimp","buy_me_a_coffee":"codechimp"}},"created_at":"2025-05-20T12:39:16.000Z","updated_at":"2026-02-24T09:32:25.000Z","dependencies_parsed_at":"2025-07-28T09:14:56.378Z","dependency_job_id":"771a115a-f6a3-4353-b608-e478691a7f81","html_url":"https://github.com/andrew-codechimp/HA-Label-State","commit_stats":null,"previous_names":["andrew-codechimp/ha-label-state"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/andrew-codechimp/HA-Label-State","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrew-codechimp%2FHA-Label-State","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrew-codechimp%2FHA-Label-State/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrew-codechimp%2FHA-Label-State/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrew-codechimp%2FHA-Label-State/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrew-codechimp","download_url":"https://codeload.github.com/andrew-codechimp/HA-Label-State/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrew-codechimp%2FHA-Label-State/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30238887,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-08T00:30:53.000Z","status":"ssl_error","status_checked_at":"2026-03-08T00:30:44.061Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","hacs-integration","home-assistant","homeassistant","homeassistant-custom-component","homeassistant-integration"],"created_at":"2025-06-07T16:37:17.117Z","updated_at":"2026-03-08T00:32:39.460Z","avatar_url":"https://github.com/andrew-codechimp.png","language":"Python","funding_links":["https://github.com/sponsors/andrew-codechimp","https://buymeacoffee.com/codechimp","https://www.buymeacoffee.com/codechimp"],"categories":[],"sub_categories":[],"readme":"# Label State\n\n[![GitHub Release][releases-shield]][releases]\n[![GitHub Activity][commits-shield]][commits]\n[![Downloads][download-latest-shield]]()\n[![HACS Installs][hacs-installs-shield]]()\n[![License][license-shield]](LICENSE)\n[![hacs][hacsbadge]][hacs]\n\nLabel State Helpers for Home Assistant\n\nYou can create state, not state and numeric state helpers which provide a binary sensor that turns on if any entity with an assigned label matches the criteria you specify.\n\nAn `entities` attribute is available which lists all entity id's that match the criteria.  \nAn `entity_names` attribute is available which lists either the device (entity) names or just the entity name if the entity is not part of a device, for all entities that match the criteria (useful for notifications).\n\n## Example use cases\n\n- Create a `critical sensors` label and create a State type Label State helper which turns on when any of those entities goes unavailable so you can get a notification.\n- Create a `must be on` label and create a Not State type Label State helper which turns on when any of those entities goes to any state but on so you can get a notification.\n- If you have appliances which should always draw a certain wattage create a Numeric State type Label State helper to turn on when any of those devices starts drawing 0 watts, triggering a notification.\n\n_Please :star: this repo if you find it useful_  \n_If you want to show your support please_\n\n[![\"Buy Me A Coffee\"](https://www.buymeacoffee.com/assets/img/custom_images/yellow_img.png)](https://www.buymeacoffee.com/codechimp)\n\n![Helper State](https://raw.githubusercontent.com/andrew-codechimp/ha-label-state/main/images/label_state.png \"Helper Label State\")\n\n![Helper Numeric](https://raw.githubusercontent.com/andrew-codechimp/ha-label-state/main/images/label_state_numeric.png \"Helper Label Numeric State\")\n\n## Installation\n\n### HACS\n\n[![Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.](https://my.home-assistant.io/badges/hacs_repository.svg)](https://my.home-assistant.io/redirect/hacs_repository/?owner=andrew-codechimp\u0026repository=HA-Label-State\u0026category=Integration)\n\nRestart Home Assistant\n\nIn the HA UI go to \"Configuration\" -\u003e \"Devices \u0026 services\" -\u003e \"Helpers\" click \"+\" and select \"Label State\"\n\n### Manual Installation\n\n\u003cdetails\u003e\n\u003csummary\u003eShow detailed instructions\u003c/summary\u003e\n\nInstallation via HACS is recommended, but a manual setup is supported.\n\n1. Manually copy custom_components/label_state folder from latest release to custom_components folder in your config folder.\n1. Restart Home Assistant.\n1. In the HA UI go to \"Configuration\" -\u003e \"Devices \u0026 services\" -\u003e \"Helpers\" click \"+\" and select \"Label State\"\n\n\u003c/details\u003e\n\n## Usage\n\nA new Label State helper will be available within Settings/Helpers or click the My link to jump straight there\n\n[![Open your Home Assistant instance and start setting up a new integration.](https://my.home-assistant.io/badges/config_flow_start.svg)](https://my.home-assistant.io/redirect/config_flow_start/?domain=label_state)\n\n## Tips \u0026 FAQ's\n\nLabel State can only monitor labels assigned to entities as it needs to know what entity in particular you want to monitor, since devices have many entities that could be switches/values it cannot automatically determine which you want to monitor. It will ignore labels added to anything but an entity.\n\n### Notification example\n\nUse the example below to create a notification automation listing the entities using the state_attr, replace the binary sensor with your own.  \nI like to have the trigger only activate if a labelled sensor has been unavailable for 5 minutes to avoid any planned restarts falsely triggering the automation.\n\n```\nalias: Critical Sensors Unavailable\ndescription: \"Create a notification if any sensors labelled as critical becomes unavailable for at least 5 minutes\"\ntriggers:\n  - trigger: state\n    entity_id:\n      - binary_sensor.critical_sensor_unavailable\n    to: \"on\"\n    for:\n      hours: 0\n      minutes: 5\n      seconds: 0\nconditions: []\nactions:\n  - action: persistent_notification.create\n    metadata: {}\n    data:\n      message: \u003e-\n        Critical sensors are unavailable {{\n        state_attr('binary_sensor.critical_sensor_unavailable', 'entity_names') |\n        join(', ') }}\nmode: single\n```\n\n### Markdown card example\n\nA markdown card you can add to dashboards showing the state of all your Label State sensors, thanks [@bcjmk](https://github.com/bcjmk)\n\n![Markdown Card](https://raw.githubusercontent.com/andrew-codechimp/ha-label-state/main/images/markdown-card-example.png \"Markdown Card\")\n\n```yaml\n{%- set integration_name = 'label_state' %}\n{%- set binary_sensors = integration_entities(integration_name) | select('match', '^binary_sensor\\.') | list %}\n\n# {{ integration_name.replace('_', ' ').title() }} Status\n\n{%- if binary_sensors %}\nItems to check: {{ binary_sensors | count }}\n\n{%- for sensor in binary_sensors %}\n{%- set label_name = state_attr(sensor, 'label_name') %}\n{%- set monitored_entities = label_entities(label_name) %}\n{%- set problem_ids = state_attr(sensor, 'entities') or [] %}\n{%- set sensor_state = states(sensor) %}\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e{{ state_attr(sensor, 'friendly_name') or sensor }}\u003c/b\u003e \u0026mdash; {% if sensor_state == 'off' %}✅ All OK{% elif sensor_state == 'on' %}⚠️ ALERT{% else %}❓ {{ sensor_state }}{% endif %}\u003c/summary\u003e\n\n**Monitored Entities:**\n{%- if monitored_entities %}\n{%- for entity in monitored_entities %}\n- {% if entity in problem_ids %}⚠️ {% endif %}[{{ state_attr(entity, 'friendly_name') or entity }}](/history?entity_id={{ entity }}) ({{ states(entity) }})\n{%- endfor %}\n{%- else %}\n- ❓ No entities found with label '{{ label_name }}'\n{%- endif %}\n\n\u003c/details\u003e\n\n{%- endfor %}\n{%- else %}\n❓ No binary sensors found for the integration '{{ integration_name }}'.\n{%- endif %}\n```\n\n\n### Translations\n\nYou can help by adding missing translations when you are a native speaker. Or add a complete new language when there is no language file available.\n\nLabel State uses Crowdin to make contributing easy.\n\n\u003cdetails\u003e\n\u003csummary\u003eInstructions\u003c/summary\u003e\n\n**Changing or adding to existing language**\n\nFirst register and join the translation project\n\n- If you don’t have a Crowdin account yet, create one at [https://crowdin.com](https://crowdin.com)\n- Go to the [Label State Crowdin project page](https://crowdin.com/project/label-state)\n- Click Join.\n\nNext translate a string\n\n- Select the language you want to contribute to from the dashboard.\n- Click Translate All.\n- Find the string you want to edit, missing translation are marked red.\n- Fill in or modify the translation and click Save.\n- Repeat for other translations.\n\nLabel State will automatically pull in latest changes to translations every day and create a Pull Request. After that is reviewed by a maintainer it will be included in the next release of Label State.\n\n**Adding a new language**\n\nCreate an [Issue](https://github.com/andrew-codechimp/HA-Label-State/issues/) requesting a new language. We will do the necessary work to add the new translation to the integration and Crowdin site, when it's ready for you to contribute we'll comment on the issue you raised.\n\n\u003c/details\u003e\n\n---\n\n[commits-shield]: https://img.shields.io/github/commit-activity/y/andrew-codechimp/HA-Label-State.svg?style=for-the-badge\n[commits]: https://github.com/andrew-codechimp/HA-Label-State/commits/main\n[hacs]: https://github.com/hacs/integration\n[hacsbadge]: https://img.shields.io/badge/HACS-Default-41BDF5.svg?style=for-the-badge\n[exampleimg]: example.png\n[license-shield]: https://img.shields.io/github/license/andrew-codechimp/HA-Label-State.svg?style=for-the-badge\n[releases-shield]: https://img.shields.io/github/release/andrew-codechimp/HA-Label-State.svg?style=for-the-badge\n[releases]: https://github.com/andrew-codechimp/HA-Label-State/releases\n[download-latest-shield]: https://img.shields.io/github/downloads/andrew-codechimp/HA-Label-State/latest/total?style=for-the-badge\n[hacs-installs-shield]: https://img.shields.io/endpoint.svg?url=https%3A%2F%2Flauwbier.nl%2Fhacs%2Flabel_state\u0026style=for-the-badge\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrew-codechimp%2Fha-label-state","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrew-codechimp%2Fha-label-state","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrew-codechimp%2Fha-label-state/lists"}