Skip to content

πŸ”³ Material Button Card ​

🌟 Overview ​

The material-button-card is a super versatile card πŸƒ that can be used to display and control a variety of entities in Home Assistant. It can be configured to act as a switch πŸ’‘, a button πŸ”˜, a thermometer 🌑️, and much more.

β˜€οΈ Light Mode

Button Light
πŸŒ™ Dark Mode

Button Dark

πŸ› οΈ Configuration ​

Here are the configuration options for the material-button-card:

πŸ†“ Free Version ​

NameTypeDescriptionDefaultRequired
typestringcustom:material-button-cardβœ… Yes
control_typestringThe type of control the button will have. See Control Types for more information.genericβœ… Yes
namestringThe name to display on the card. πŸ“›βŒ No
entitystringThe entity ID to associate with the card. πŸ†”βœ… Yes (Not required for action and app_version)
use_default_iconbooleanUse the default icon based on the entity's state. πŸ–ΌοΈtrue❌ No
iconstringA custom icon to display. βœ¨βœ… Yes (Required if use_default_icon is false)
dual_iconbooleanUse two different icons for the "on" and "off" states. 🎭false❌ No
icon_onstringThe icon to display when the entity is "on". βœ…βœ… Yes (Required if dual_icon is true)
icon_offstringThe icon to display when the entity is "off". βŒβœ… Yes (Required if dual_icon is true)
use_default_textbooleanUse the default "on" and "off" text. πŸ”‘true❌ No
text_onstringCustom text to display when the entity is "on".βœ… Yes (Required if use_default_text is false)
text_offstringCustom text to display when the entity is "off".βœ… Yes (Required if use_default_text is false)
use_material_colorboolean(Only for thermometer) Use different colors based on the state. 🎨false❌ No
fix_temperaturestring(Only for thermometer) Set to true or auto to fix temperature display issues. πŸ”§false❌ No
use_default_togglebooleanEnable automatic actions based on entity state. If false, you can configure tap_action and hold_action. πŸ”„true❌ No
tap_actionobjectAction to perform on tap. See Actions for more information. πŸ‘‡βŒ No
hold_actionobjectAction to perform on hold. See Actions for more information. HOLD❌ No

✨ Pro - Ultimate Version ​

NameTypeDescriptionDefaultRequired
typestringcustom:material-button-cardβœ… Yes
control_typestringThe type of control the button will have. See Control Types for more information.genericβœ… Yes
namestringThe name to display on the card. πŸ“›βŒ No
entitystringThe entity ID to associate with the card. πŸ†”βœ… Yes (Not required for action and app_version)
use_default_iconbooleanUse the default icon based on the entity's state. πŸ–ΌοΈtrue❌ No
iconstringA custom icon to display. βœ¨βœ… Yes (Required if use_default_icon is false)
dual_iconbooleanUse two different icons for the "on" and "off" states. 🎭false❌ No
icon_onstringThe icon to display when the entity is "on". βœ…βœ… Yes (Required if dual_icon is true)
icon_offstringThe icon to display when the entity is "off". βŒβœ… Yes (Required if dual_icon is true)
use_default_textbooleanUse the default "on" and "off" text. πŸ”‘true❌ No
text_onstringCustom text to display when the entity is "on".βœ… Yes (Required if use_default_text is false)
text_offstringCustom text to display when the entity is "off".βœ… Yes (Required if use_default_text is false)
use_material_colorboolean(Only for thermometer) Use different colors based on the state. 🎨false❌ No
fix_temperaturestring(Only for thermometer) Set to true or auto to fix temperature display issues. πŸ”§false❌ No
tap_actionobjectAction to perform on tap. See Actions for more information. πŸ‘‡βŒ No
hold_actionobjectAction to perform on hold. See Actions for more information. HOLD❌ No
double_tap_actionobjectAction to perform on double tap. See Actions for more information. HOLD❌ No

πŸŽ›οΈ Control Types ​

The control_type option determines the behavior and appearance of the card. Here are the possible values:

  • generic: For generic entities like switches, lights, and input booleans. ΰ¦Έΰ§ΰ¦‡ΰ¦š
  • thermometer: For climate entities. It will display the temperature and allow you to control the HVAC. 🌑️
  • automation: For automation entities. It will show the automation's state and allow you to trigger it. πŸ€–
  • scene: For scene entities. Tapping the card will activate the scene. 🎬
  • media_player: For media player entities. It will show the media player's state and provide playback controls. ⏯️
  • state: Displays the state of an entity without any action. ℹ️
  • action: Performs a specific action when tapped. ⚑
  • app_version: Displays the version of the Material Components. πŸ“±

πŸš€ Actions ​

πŸ†“ Free Version ​

You can configure custom actions for tap_action and hold_action.

The action object can have the following properties:

  • action: The action to perform. Possible values are:
    • toggle: Toggles the entity's state. πŸ”„
    • more-info: Shows the entity's more-info dialog. ℹ️
    • navigate: Navigates to a specific path. πŸ—ΊοΈ
    • url: Opens a URL. 🌐
    • none: No action. 🚫
  • navigation_path: The path to navigate to when action is navigate.
  • url_path: The URL to open when action is url.

✨ Paid Version ​

You can configure custom actions for tap_action, hold_action, and double_tap_action. If you do not specify an action, the system will use the default custom dialogs based on the component type.

Action Object Properties ​

PropertyTypeDescription
actionstringRequired. The type of action to perform (see list below).
navigation_pathstringInternal path (e.g., /lovelace/lights) required if the action is Maps.
url_pathstringExternal URL (e.g., https://google.com) required if the action is url.
servicestringThe service to call (e.g., light.turn_on) if the action is call-service.
service_dataobjectAdditional parameters for the service.

Possible Values for action

  • more-info (Default): Opens the entity's details window. When configured, it opens the specific custom dialog for the component. ℹ️
  • toggle: Toggles the entity state (on/off). πŸ”„
  • call-service: Executes a specific Home Assistant service. πŸ› οΈ
  • navigate: Navigates to a specific path within the interface. πŸ—ΊοΈ
  • url: Opens an external hyperlink in a new tab. 🌐
  • assist: Opens the Assist interface (voice/text command). πŸŽ™οΈ
  • none: Disables any interaction. 🚫

TIP

Note on Custom Dialogs: If you leave the action as default, the system will automatically trigger the custom dialogs optimized for each category (e.g., the sensor dialog for binary sensors and sensors or the alarm dialog for alarm_control_panel), and more...

πŸ“œ Examples ​

πŸ’‘ Simple Switch ​

yaml
type: custom:material-button-card
control_type: generic
entity: switch.living_room_light
name: Living Room Light

🌑️ Thermometer with Custom Icons ​

yaml
type: custom:material-button-card
control_type: thermometer
entity: climate.living_room
name: Living Room
use_default_icon: false
dual_icon: true
icon_on: mdi:hvac
icon_off: mdi:hvac-off

πŸ€– Automation Trigger ​

yaml
type: custom:material-button-card
control_type: automation
entity: automation.turn_on_lights_at_sunset
name: Sunset Lights

🎬 Scene Activation ​

yaml
type: custom:material-button-card
control_type: scene
entity: scene.movie_time
name: Movie Time
icon: mdi:movie

⏯️ Media Player Controls ​

yaml
type: custom:material-button-card
control_type: media_player
entity: media_player.living_room_tv
name: Living Room TV

πŸ—ΊοΈ Navigation Button ​

yaml
type: custom:material-button-card
control_type: action
name: Go to Lights
icon: mdi:lightbulb
use_default_toggle: false
tap_action:
  action: navigate
  navigation_path: /lovelace/lights

🎨 Extended Customization ​

⚠️ LICENSE

Only for PRO and ULTIMATE users, get your licence now πŸš€.

This card have a own version of Card-Mod. You can inject custom CSS to override any style or create unique animations.

πŸ’‘ ADVANCED STYLING

πŸ‘‰ Check out the Styling Guide.