{"id":21364902,"url":"https://github.com/custom-cards/button-entity-row","last_synced_at":"2025-07-13T04:31:23.149Z","repository":{"id":50033251,"uuid":"151319612","full_name":"custom-cards/button-entity-row","owner":"custom-cards","description":"Adds buttons to call services to entity cards","archived":false,"fork":false,"pushed_at":"2021-06-05T21:11:43.000Z","size":1823,"stargazers_count":88,"open_issues_count":10,"forks_count":20,"subscribers_count":5,"default_branch":"master","last_synced_at":"2023-08-16T07:20:45.718Z","etag":null,"topics":["buttons","entity-row","home-assistant","lovelace-ui"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/custom-cards.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}},"created_at":"2018-10-02T20:34:04.000Z","updated_at":"2023-06-12T01:02:48.000Z","dependencies_parsed_at":"2022-08-31T06:51:38.996Z","dependency_job_id":null,"html_url":"https://github.com/custom-cards/button-entity-row","commit_stats":null,"previous_names":[],"tags_count":13,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/custom-cards%2Fbutton-entity-row","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/custom-cards%2Fbutton-entity-row/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/custom-cards%2Fbutton-entity-row/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/custom-cards%2Fbutton-entity-row/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/custom-cards","download_url":"https://codeload.github.com/custom-cards/button-entity-row/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225855966,"owners_count":17534967,"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":["buttons","entity-row","home-assistant","lovelace-ui"],"created_at":"2024-11-22T07:08:10.204Z","updated_at":"2024-11-22T07:08:10.831Z","avatar_url":"https://github.com/custom-cards.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Button Entity Row\n\n[![hacs_badge](https://img.shields.io/badge/HACS-Default-orange.svg?style=for-the-badge)](https://github.com/custom-components/hacs)\n\nCreates a row of buttons to be placed in an `entities` card.\n\n![example-gif](examples/example-gif.gif)\n\n## Options\n\n| Name    | Type                                   | Requirement  | Description                 |\n| ------- | -------------------------------------- | ------------ | --------------------------- |\n| type    | `string`                               | **Required** | `custom:button-entity-row`  |\n| buttons | `string` or [`Button`](#button-object) | **Required** | List of buttons to display. |\n\n## `Button` Object\n\n| Name               | Type                        | Requirement  | Description                                                    |\n| -----------------  | --------------------------- | ------------ | -------------------------------------------------------------- |\n| entity             | `string`                    | **Optional** | The entity_id of the entity you want to show.                  |\n| name               | `string`                    | **Optional** | Name to use for entity.                                        |\n| icon               | `string`                    | **Optional** | Material design icon to display.                               |\n| state_icons        | `{[state: string]: string}` | **Optional** | Material icon for each specific state of the entity.           |\n| state_styles       | `{[state: string]: string}` | **Optional** | CSS styles to apply to the button for a specific state.        |\n| state\\_icon_styles | `{[state: string]: string}` | **Optional** | CSS styles to apply to the icon for a specific state.          |\n| style              | `object`                    | **Optional** | CSS styles to apply to the button.                             |\n| icon_style         | `object`                    | **Optional** | CSS styles to apply to the icon.                               |\n| service            | `string`                    | **Optional** | The Home Assistant service to call when the button is clicked. |\n| service_data       | `object`                    | **Optional** | Service data to be sent with the service call.                 |\n\n## Usage\n\nYou can specify directly an entity name or use the [`Button`](#button-object) object.\n\n```yaml\nresources:\n  - url: /community_plugin/button-entity-row/button-entity-row.js\n    type: module\n```\n\n### Basic setup.\n\n![example1](examples/example-1.png)\n\n```yaml\ntype: entities\nentities:\n  - entity: light.bedroom_light\n\n  - type: \"custom:button-entity-row\"\n    buttons:\n      - scene.daylight\n      - entity: script.light_colour_flow\n        name: Flow\n      - scene.evening\n      - scene.rave\n```\n\n---\n\n### Using state icons.\n\n![example1](examples/example-4.gif)\n\n```yaml\ntype: entities\nentities:\n  - entity: light.dining_room\n\n  - type: \"custom:button-entity-row\"\n    buttons:\n      - entity: script.pause_kitchen_motion\n        icon: \"mdi:pause\"\n        name: 1 hour\n        style:\n          - color: var(--primary-color)\n      - entity: input_boolean.kitchen_motion_sensor\n        name: Detect motion\n        state_icons:\n          \"off\": \"mdi:eye-off\"\n          \"on\": \"mdi:motion-sensor\"\n```\n\n---\n\n### Some css styling, icons and icon-name buttons.\n\n![example2](examples/example-2.png)\n\n```yaml\ntype: entities\nentities:\n  - entity: light.bedroom_light\n\n  - type: \"custom:button-entity-row\"\n    buttons:\n      - entity: scene.daylight\n        icon: \"mdi:brightness-5\"\n        style:\n          - color: white\n      - entity: script.light_colour_flow\n        icon: \"mdi:all-inclusive\"\n        style:\n          - color: white\n      - entity: scene.evening\n        icon: \"mdi:brightness-3\"\n        style:\n          - color: white\n      - entity: scene.rave\n        icon: \"mdi:track-light\"\n        name: Rave\n        style:\n          - color: white\n```\n\n---\n\n### Multiple rows of buttons.\n\n![example3](examples/example-3.png)\n\n```yaml\ntype: entities\nentities:\n  - entity: light.monitor_leds\n\n  - type: \"custom:button-entity-row\"\n    buttons:\n      - entity: scene.office_standard\n        icon: \"mdi:lightbulb-on\"\n        style:\n          - color: var(--primary-color)\n      - entity: scene.office_orange\n        icon: \"mdi:lightbulb-on\"\n        style:\n          - color: \"rgb(255,126,0)\"\n\n  - type: \"custom:button-entity-row\"\n    buttons:\n      - icon: \"mdi:lightbulb-off-outline\"\n        service: homeassistant.turn_off\n        service_data:\n          entity_id: group.office_lights\n        style:\n          - color: white\n```\n\n---\n\n#### Using custom styles/icons, specific to the state:\n\n![example3](examples/example-5.gif)\n\n```yaml\ntype: entities\nentities:\n  - entity: switch.entrance\n\n  - type: \"custom:button-entity-row\"\n    buttons:\n      - entity: input_boolean.alarm\n        name: Alarm System\n        style:\n          background: lightgray\n          border-radius: 9999px\n        state_icons:\n          \"off\": \"mdi:shield-home\"\n          \"on\": \"mdi:lock-open\"\n        state_styles:\n          \"off\":\n            color: red\n            font-weight: bold\n          \"on\":\n            color: green\n```\n\n## Default Entities Map to Services\n\n| Domain        | Service                       |\n| ------------- | ----------------------------- |\n| automation    | automation.toggle             |\n| cover         | cover.toggle                  |\n| fan           | fan.toggle                    |\n| input_boolean | input_boolean.toggle          |\n| light         | light.toggle                  |\n| script        | script.toggle                 |\n| switch        | switch.toggle                 |\n| vacuum        | vacuum.toggle                 |\n| media_player  | media_player.media_play_pause |\n| scene         | scene.turn_on                 |\n\nIf no `service` is specified for a given button,\nand there is no default value corresponding to its specific domain (eg.: `binary_sensor`),\nthe \"more-info\" modal of the entity will be shown instead (if any).\n\n## Full Configuration Examples\n\n```yaml\nresources:\n  - url: /community_plugin/button-entity-row/button-entity-row.js\n    type: module\n\nviews:\n  - title: Home\n    id: home\n    cards:\n      - type: entities\n        title: Living Room Lights\n        show_header_toggle: false\n        entities:\n          - type: \"custom:button-entity-row\"\n            buttons:\n              # full configuration example\n              - icon: mdi:lightbulb-on\n                style:\n                  color: yellow\n                name: \"On\"\n                service: scene.turn_on\n                service_data:\n                  entity_id: scene.lights_up\n\n              # basic entity, uses hass configured icon to display\n              - scene.lights_out\n\n              # entity with some overrides\n              - icon: mdi:movie\n                name: Movie\n                entity: scene.movie_lights\n```\n\nYou can also specify multiple rows of buttons\n\n```yaml\nresources:\n  - url: /community_plugin/button-entity-row/button-entity-row.js\n    type: module\n\nviews:\n  - title: Home\n    id: home\n    cards:\n      - type: entities\n        title: Living Room Lights\n        show_header_toggle: false\n        entities:\n          - type: \"custom:button-entity-row\"\n            buttons:\n              - - switch.light_1\n                - switch.light_2\n              - - media_player.roku\n                - light.lamp\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcustom-cards%2Fbutton-entity-row","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcustom-cards%2Fbutton-entity-row","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcustom-cards%2Fbutton-entity-row/lists"}