{"id":13579382,"url":"https://github.com/pilotak/homeassistant-attributes","last_synced_at":"2025-04-14T14:42:42.951Z","repository":{"id":53791012,"uuid":"196057008","full_name":"pilotak/homeassistant-attributes","owner":"pilotak","description":"Breaks out specified attribute from other entities to a sensor","archived":false,"fork":false,"pushed_at":"2023-06-08T18:08:10.000Z","size":64,"stargazers_count":102,"open_issues_count":12,"forks_count":12,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-28T03:41:20.871Z","etag":null,"topics":["attributes","breakout","hacs","hass","homeassistant","sensor"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pilotak.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}},"created_at":"2019-07-09T17:51:46.000Z","updated_at":"2025-03-09T18:20:19.000Z","dependencies_parsed_at":"2024-01-16T20:29:00.136Z","dependency_job_id":"fb07751c-8a9e-4d24-a45f-1e8094d10122","html_url":"https://github.com/pilotak/homeassistant-attributes","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilotak%2Fhomeassistant-attributes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilotak%2Fhomeassistant-attributes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilotak%2Fhomeassistant-attributes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilotak%2Fhomeassistant-attributes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pilotak","download_url":"https://codeload.github.com/pilotak/homeassistant-attributes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248898631,"owners_count":21179807,"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","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":["attributes","breakout","hacs","hass","homeassistant","sensor"],"created_at":"2024-08-01T15:01:38.886Z","updated_at":"2025-04-14T14:42:42.931Z","avatar_url":"https://github.com/pilotak.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# HomeAssistant component: `attributes`\n[![Validate](https://github.com/pilotak/homeassistant-attributes/workflows/Validate/badge.svg)](https://github.com/pilotak/homeassistant-attributes/actions)\n[![hacs_badge](https://img.shields.io/badge/HACS-Default-orange.svg)](https://github.com/custom-components/hacs)\n\nThe `attributes` platform supports sensors which break out a specified `attribute` from other entities.\n\nTo enable the `attributes` sensor in your installation, add the following to your `configuration.yaml` file:\n\n```yaml\n# Example configuration.yaml entry\nsensor:  \n  - platform: attributes\n    friendly_name: \"Batteries\"\n    attribute: battery_level\n    device_class: battery\n    entities:\n      - sensor.myslipo_1_0\n      - sensor.myslipo_2_0\n      - sensor.myslipo_3_0\n      - sensor.myslipo_4_0\n      \n  - platform: attributes\n    friendly_name: \"Last changed\"\n    attribute: last_triggered\n    icon: 'mdi:clock'\n    time_format: '%e %B - %H:%M:%S'\n    entities:\n      - automation.temp_changed\n```\n\nConfiguration variables:\n\n- **entities** (*Required*): A list of entity IDs that you want to read attributes from.\n- **attribute** (*Required*): Which attribute to extract from defined entity IDs.\n- **friendly_name** (*Optional*): Name to use in the Frontend *(will be the same for all entities specified)*.\n- **icon** (*Optional*): Icon to use in the Frontend.\n- **device_class** (*Optional*): Defines the device_class, if not specified it will be the same as parent.\n- **unit_of_measurement** (*Optional*): Defines the units of measurement of the sensor, if any.\n- **round_to** (*Optional*): Round numbers to 'x' decimals, if zero it will become whole number. Skip this field if you extracting a string or you want to leave the value as it is.\n- **value_template** (*Optional*): In case you need to do a math with the value ie. offset, bit gain, etc. *(will be the same for all entities specified)*.\n- **time_format** (*Optional*): **`strftime`** type string to beautify time attribute output. Applicable only when attribute `last_changed` or `last_triggered` is selected. Cheatsheet for strftime formatting  [here](http://strftime.ninja/).\n\n## Install via [HACS](https://github.com/custom-components/hacs)\nYou can find this integration in the community store.\n\n## Install manually\nYou need to copy the `attributes` folder from this repo to the `custom_components` folder in the root of your configuration. The file tree should look like this:\n```\n└── ...\n└── configuration.yaml\n└── custom_components\n    └── attributes\n        └── __init__.py\n        └── manifest.json\n        └── sensor.py\n```\n\n\u003e__Note__: if the `custom_components` directory does not exist, you need to create it.\n\n## Examples\nThis example shows how to extract the `battery_level` attribute.\n\n```yaml\nsensor:\n  - platform: attributes\n    friendly_name: \"Batteries\"\n    attribute: battery_level\n    unit_of_measurement: \"%\"\n    entities:\n      - sensor.test1\n      - sensor.test2\n      - sensor.test3\n```\n\n\u003eIf an attribute is __`battery`__ or __`battery_level`__ and you don't specify __`icon`__ or __`device_class`__ is not `battery`, the following icon_template is applied (fullness). The result is that the battery icon becomes as full as the battery based on percentage.\n\n```yaml\n{% if batt == 'unknown' %}\n    {% if batt \u003e 95 %}\n        mdi:battery\n    {% elif batt \u003e 85 %}\n        mdi:battery-90\n    {% elif batt \u003e 75 %}\n        mdi:battery-80\n    {% elif batt \u003e 65 %}\n        mdi:battery-70\n    {% elif batt \u003e 55 %}\n        mdi:battery-60\n    {% elif batt \u003e 45 %}\n        mdi:battery-50\n    {% elif batt \u003e 35 %}\n        mdi:battery-40\n    {% elif batt \u003e 25 %}\n        mdi:battery-30\n    {% elif batt \u003e 15 %}\n        mdi:battery-20\n    {% elif batt \u003e 10 %}\n        mdi:battery-10\n    {% else %}\n        mdi:battery-outline\n    {% endif %}\n{% else %}\n    mdi:battery-unknown\n{% endif %}\n```\n\nThis example shows how to extract the `last_triggered` attribute in human-readable format.\n\n```yaml\nsensor:\n  - platform: attributes\n    friendly_name: \"Last changed\"\n    attribute: last_triggered\n    icon: 'mdi:clock'\n    time_format: '%e %B - %H:%M:%S'\n    entities:\n      - automation.dummy_changed\n```\n\u003eIf you select attribute __`last_changed`__ or __`last_triggered`__ and you specify time_format, your datetime will get translated to your local timezone and will be formatted like `strftime()` e.g., ***2017-08-08T13:14:21.651894+00:00*** gets translated into the specified strftime format with timezone applied. The result would be: ***8 August 15:14:21*** if your timezone is UTC+2\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpilotak%2Fhomeassistant-attributes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpilotak%2Fhomeassistant-attributes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpilotak%2Fhomeassistant-attributes/lists"}