### same_as example: inherit and override item settings Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/reuse/reuse-reference.md Use `same_as` to start another visible item from the same configuration and change only the settings that differ. The referenced item must appear earlier in the same layout section. If you omit `id`, the card uses the item's zero-based position in its section as a text ID (e.g., "0", "1"), and numbering restarts in each layout section. ```yaml layout: rectangles: - id: first # Name this item so it can be referenced later xpos: 25 # Horizontal position; 50 = center of the card ypos: 50 # Vertical position; 50 = center of the card width: 30 # Width in card coordinates height: 20 # Height in card coordinates - id: second # Name this item so it can be referenced later same_as: first # Start with the settings from first xpos: 75 # Horizontal position; 50 = center of the card ``` -------------------------------- ### perform-action with perform_action Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/interaction/actions.md Use `perform-action` with `perform_action` to call a Home Assistant service. The example turns on a light with brightness 50%. ```yaml entities: # Entities used by this example - entity: light.living_room layout: states: - entity_index: 0 xpos: 50 ypos: 50 tap_action: action: perform-action perform_action: light.turn_on target: entity_id: light.hall data: brightness_pct: 50 ``` -------------------------------- ### Slider YAML configuration example Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/tools/controls/slider-tool.md Configures a Slider control in the Flex Horseshoe Card. Binds to the first entity (input_number.temperature), positions it at the center, sets animation duration to 250 ms with ease-out easing, and customizes the linear track height to 6 and radius to 3. Use this as a starting point for a linear slider. ```yaml entities: - entity: input_number.temperature # Numeric entity changed by the Slider layout: controls: - type: slider # Create a Slider entity_index: 0 # Use the first entity configured above xpos: 50 # Horizontal center ypos: 50 # Vertical center animation: duration: 250 # Movement duration in milliseconds easing: ease-out # Movement timing curve linear: track: height: 6 # Thickness of the inactive linear track radius: 3 # Corner radius of the linear track ``` -------------------------------- ### Pass a list or configuration block Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/card-templates/template-variables.md Shows how to pass a list or map as a template variable. The example passes a list of room names. ```APIDOC ## Pass a list or configuration block ### Description Demonstrates passing a list or map as a template variable. ### Template Usage ```yaml template: name: room_overview variables: - rooms: - Living room - Bedroom - Study ``` ``` -------------------------------- ### Run several actions in order with `actions` Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/interaction/actions.md Use the `actions` property to run several actions sequentially when a gesture is triggered. In this example, tapping the state toggles the light and then navigates to the /lovelace/lights view. ```yaml entities: # Entities used by this example - entity: light.living_room layout: states: - entity_index: 0 xpos: 50 ypos: 50 tap_action: actions: - action: toggle - action: navigate navigation_path: /lovelace/lights ``` -------------------------------- ### Position an icon with xpos and ypos Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/card-basics/positioning-and-sizing.md Place an icon at a specific position on the card using xpos and ypos. The example sets xpos to 50 (horizontal center) and ypos to 25 (above vertical center). ```yaml entities: - entity: sensor.example_1 # Entity used by this example layout: icons: - entity_index: 0 # Use entity 0 from entities: (0 = first entity) xpos: 50 # Horizontal position; 50 = center of the card ypos: 25 # Vertical position; 50 = center of the card ``` -------------------------------- ### Add haptic feedback with `haptic` Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/interaction/actions.md Set `haptic` in an action to provide haptic feedback when supported by the Home Assistant Companion app. This example uses `selection` as the haptic type. ```yaml entities: # Entities used by this example - entity: light.living_room layout: states: - entity_index: 0 xpos: 50 ypos: 50 tap_action: action: toggle haptic: selection ``` -------------------------------- ### select-option with option Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/interaction/actions.md Use `select-option` to choose an option on a Select or Input select entity. The example selects the 'Eco' option. ```yaml entities: # Entities used by this example - entity: input_select.mode layout: states: - entity_index: 0 xpos: 50 ypos: 50 tap_action: action: select-option option: Eco ``` -------------------------------- ### Card 20 YAML configuration Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/examples/demo-cards/demo-card-electricity-many.md Example definition for Card 20 using the fhs_card_020_horseshoe_power template. ```yaml - type: custom:flex-horseshoe-card entities: - entity: sensor.dsmr_reading_electricity_currently_delivered decimals: 2 name: 'Total' area: ':20:' - entity: sensor.dsmr_reading_phase_currently_delivered_l1 decimals: 2 name: 'L1' - entity: sensor.dsmr_reading_phase_currently_delivered_l2 decimals: 2 name: 'L2' - entity: sensor.dsmr_reading_phase_currently_delivered_l3 decimals: 2 name: 'L3' - entity: sensor.dsmr_reading_electricity_currently_delivered decimals: 2 template: name: fhs_card_020_horseshoe_power ``` -------------------------------- ### Supply values when using the template Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/card-templates/template-variables.md Shows how to supply values for template variables when using a card template. The example provides entity and name, while the default unit remains in use. ```APIDOC ## Supply values when using the template ### Description Provides values for template variables when instantiating a card template. ### Template Usage ```yaml template: name: room_temperature variables: - entity: sensor.bedroom_temperature - name: Bedroom ``` ### Notes - The default unit remains in use because this instance does not replace it. ``` -------------------------------- ### Position and align the name with text-anchor Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/tools/entities/entity-name-tool.md Positions the name with `xpos` and `ypos` and controls horizontal alignment with `text-anchor`. `start` starts the text at `xpos`, `middle` centers it on `xpos`, and `end` ends it at `xpos`. ```yaml entities: # Entities used by this example - entity: sensor.living_room_temperature layout: names: - entity_index: 0 xpos: 20 ypos: 50 styles: text-anchor: start ``` -------------------------------- ### Add a toggle control under layout.controls Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/tools/controls/controls-overview.md Shows the basic structure for adding a control under layout.controls. The example creates a toggle control that uses the first entity configured above, positioned at the center of the card with a width of 24. ```yaml entities: - entity: light.living_room # Home Assistant entity used by this card layout: controls: - type: toggle # Create a toggle control entity_index: 0 # Use the first entity configured above xpos: 50 # Horizontal position; 50 = center of the card ypos: 50 # Vertical position; 50 = center of the card width: 24 # Width of the complete control ``` -------------------------------- ### Add background level track with equalizer.background Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/tools/sparkline/equalizer.md Configures optional background blocks for every available level using equalizer.background.show.item_style. The example uses fixed style with a custom color, and sets value_buckets to 10 vertical levels. The background color uses var(--divider-color) by default. ```yaml entities: - entity: sensor.temperature # Entity whose history is graphed layout: sparklines: - entity_index: 0 # Use the first configured entity xpos: 50 # Horizontal center of the graph ypos: 50 # Vertical center of the graph width: 80 # Graph width in card coordinates height: 35 # Graph height in card coordinates sparkline: show: chart_type: equalizer # Draw history as stacked levels equalizer: value_buckets: 10 # Number of available vertical levels background: show: item_style: fixed # Show fixed-color background level blocks color: var(--divider-color) # Background level color ``` -------------------------------- ### Card 24 YAML configuration Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/examples/demo-cards/demo-card-electricity-many.md Example definition for Card 24 using the fhs_card_023_horseshoe_power template. ```yaml - type: custom:flex-horseshoe-card entities: - entity: sensor.dsmr_reading_electricity_currently_delivered name: 'Total' area: ':24:' - entity: sensor.dsmr_reading_phase_currently_delivered_l1 name: 'L1' - entity: sensor.dsmr_reading_phase_currently_delivered_l2 name: 'L2' - entity: sensor.dsmr_reading_phase_currently_delivered_l3 name: 'L3' - entity: sensor.dsmr_reading_electricity_currently_delivered template: name: fhs_card_023_horseshoe_power ``` -------------------------------- ### YAML configuration for a Polygon with fill_mask Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/tools/shapes/polygon-tool.md Example layout configuration for a six-sided Polygon. Uses styles to set fill and stroke colors with opacity, and fill_mask: auto to prevent the fill from visually stacking underneath the border. ```yaml layout: polygons: - xpos: 50 # Horizontal position; 50 = center of the card ypos: 50 # Vertical position; 50 = center of the card sides: 6 # Draw a six-sided Polygon width: 60 # Outside width height: 52 # Outside height styles: fill: var(--primary-color) # Fill color fill-opacity: 0.25 # Make the fill partly transparent stroke: var(--primary-color) # Border color stroke-opacity: 0.5 # Make the border partly transparent stroke-width: 4 # Thick borders make overlap easier to notice fill_mask: auto # Keep the fill from visually stacking underneath the border ``` -------------------------------- ### Make the points larger or smaller Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/tools/sparkline/dots-chart.md Adjust the dot radius to control point size. The example sets radius to 0.75; smaller points leave more visual room when there are many intervals. ```yaml entities: - entity: sensor.temperature # Entity whose history is graphed layout: sparklines: - xpos: 50 # Horizontal center of the graph ypos: 50 # Vertical center of the graph width: 80 # Graph width in card coordinates height: 35 # Graph height in card coordinates entity_index: 0 # Use the first entity configured above sparkline: show: chart_type: dots dots: radius: 0.75 # Size of each point ``` -------------------------------- ### Style a state item with font and fill properties Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/appearance/styling.md Applies item-level styles to a state item. The example positions the item at the center of the card and sets text size, weight, and fill color using a theme variable. ```yaml entities: - entity: sensor.example_1 # Entity used by this example layout: states: - entity_index: 0 # Use entity 0 from entities: (0 = first entity) xpos: 50 # Horizontal position; 50 = center of the card ypos: 50 # Vertical position; 50 = center of the card styles: font-size: 2.5em # Size of the displayed text font-weight: bold # Weight of the displayed text fill: var(--primary-text-color) # Fill color of this item ``` -------------------------------- ### Add a rectangle shape under layout Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/tools/shapes/shapes-overview.md Shows the YAML structure for adding a rectangle shape under the `layout` key. Each shape has its own section under `layout:`. The example sets position, size, radius, and styles. ```yaml layout: rectangles: - xpos: 50 # Horizontal position; 50 = center of the card ypos: 50 # Vertical position; 50 = center of the card width: 60 # Width in card coordinates height: 30 # Height in card coordinates radius: 4 # Radius of this shape styles: fill: var(--card-background-color) # Fill color of this item stroke: var(--divider-color) # Border or line color ``` -------------------------------- ### Add a tool to the layout Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/tools/tools-overview.md Shows how to add tools under the layout: section. Each tool lives in its matching section (icons, states, rectangles, etc.). Positions use card coordinates where 50 is the center. The example places an icon, a state, and a rectangle. ```yaml entities: - entity: sensor.example_1 # Entity used by this example layout: icons: - entity_index: 0 # Use entity 0 from entities: (0 = first entity) xpos: 50 # Horizontal position; 50 = center of the card ypos: 30 # Vertical position; 50 = center of the card states: - entity_index: 0 # Use entity 0 from entities: (0 = first entity) xpos: 50 # Horizontal position; 50 = center of the card ypos: 50 # Vertical position; 50 = center of the card rectangles: - xpos: 50 # Horizontal position; 50 = center of the card ypos: 70 # Vertical position; 50 = center of the card width: 40 # Width in card coordinates height: 10 # Height in card coordinates ``` -------------------------------- ### Configure scale_style: colorstopsegments in YAML Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/tools/horseshoe/horseshoe-scale-and-state.md Example configuration for the `colorstopsegments` scale style, which divides the complete scale into hard color-stop sections. Uses `horseshoe_scale.min` and `max` to define the range, and `color_stops.colors` to set color values. ```yaml entities: - entity: sensor.example_1 # Entity used by this example layout: horseshoes: - entity_index: 0 horseshoe_scale: min: 0 max: 100 show: scale_style: colorstopsegments # Show hard color ranges across the complete base scale color_stops: colors: - value: 0 color: green - value: 50 color: orange - value: 100 color: red ``` -------------------------------- ### Use an entity with a circle shape Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/tools/shapes/shapes-overview.md Shows how to configure a shape to use an entity, so its color, visibility, action, or other supported settings follow that entity. The example uses `entity_index: 0` to reference the first entity configured above. ```yaml entities: - entity: sensor.cpu_usage # Home Assistant entity used by this card layout: circles: - entity_index: 0 # Use the first entity configured above xpos: 50 # Horizontal position; 50 = center of the card ypos: 50 # Vertical position; 50 = center of the card radius: 20 # Radius of the circle ``` -------------------------------- ### Apply numeric offset with same_as_dxpos and same_as_dwidth Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/reuse/reuse-reference.md Use `same_as_d` to add a numeric offset to an inherited value. The target field must already exist on the reused item and be numeric for the tool. The offset can be a number, `ref(...)`, or `calc(...)`. In this example, `same_as_dxpos: 40` adds 40 to the inherited `xpos` (30 + 40 = 70), and `same_as_dwidth: 6` adds 6 to `width` (24 + 6 = 30). ```yaml layout: rectangles: - id: panel xpos: 30 # Horizontal position of the first Rectangle ypos: 50 # Vertical position of the first Rectangle width: 24 # Width inherited by the second Rectangle height: 18 # Height inherited by the second Rectangle - same_as: panel # Start with all settings from panel same_as_dxpos: 40 # 30 + 40 = xpos 70 same_as_dwidth: 6 # 24 + 6 = width 30 ``` -------------------------------- ### Group items to move together Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/card-basics/positioning-and-sizing.md Use a group to move several items as one block. The example defines a group with id heading and positions an icon and a name inside it using the group reference. ```yaml entities: - entity: sensor.example_1 # Entity used by this example layout: groups: - id: heading # Name this item so it can be referenced later xpos: 50 # Horizontal position; 50 = center of the card ypos: 20 # Vertical position; 50 = center of the card icons: - group: heading # Position this item inside group heading entity_index: 0 # Use entity 0 from entities: (0 = first entity) xpos: 40 # Horizontal position; 50 = center of the card ypos: 50 # Vertical position; 50 = center of the card names: - group: heading # Position this item inside group heading entity_index: 0 # Use entity 0 from entities: (0 = first entity) xpos: 55 # Horizontal position; 50 = center of the card ypos: 50 # Vertical position; 50 = center of the card ``` -------------------------------- ### Configure rolling_window history period with automatic bins Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/tools/sparkline/sparkline-history-periods-and-bins.md Use a rolling window to always show the latest moving time range. The example sets a 6-hour duration and lets the card choose a readable interval automatically with a medium density. Graph width and height do not affect the history period. ```yaml entities: - entity: sensor.temperature # Entity whose history is graphed layout: sparklines: - xpos: 50 # Horizontal center of the graph ypos: 50 # Vertical center of the graph width: 80 # Graph width in card coordinates height: 35 # Graph height in card coordinates entity_index: 0 # Use the first entity configured above period: type: rolling_window # Always show the latest moving time range rolling_window: duration: hour: 6 # Show 6 hours of history bins: per_hour: auto # Let the card choose a readable time interval automatically density: medium # Choose low, medium, or high detail when intervals are automatic ``` -------------------------------- ### Button without an entity: navigate action Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/tools/controls/button-tool.md YAML configuration for a Button control that does not require an entity_index because its tap_action already contains everything needed. The example creates a button labeled 'Energy' that navigates to the /energy dashboard path when tapped. Note the comments in the YAML explain each property. ```yaml layout: controls: - id: open-energy # Name this item so it can be referenced later type: button # Create a button control xpos: 50 # Horizontal position; 50 = center of the card ypos: 80 # Vertical position; 50 = center of the card width: 42 # Width of the complete control height: 12 # Height of the complete control content: mode: content_text # Arrange the button content as text content_text: text: Energy # Text shown to the user tap_action: action: navigate # Open another dashboard path navigation_path: /energy # Dashboard path to open ``` -------------------------------- ### Add a vertical line Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/tools/shapes/line-tool.md Adds a vertical line to the card layout. Use it to separate columns or create a vertical visual guide. The example centers the line and sets its length. ```yaml layout: lines: - orientation: vertical # Arrange it from bottom to top xpos: 50 # Horizontal position; 50 = center of the card ypos: 50 # Vertical position; 50 = center of the card length: 40 # Length of the line ``` -------------------------------- ### Add a horizontal line Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/tools/shapes/line-tool.md Adds a horizontal line to the card layout. Use it to separate content, underline a value, or create a visual guide. The example centers the line and sets its length, color, and thickness. ```yaml layout: lines: - orientation: horizontal # Arrange it from left to right xpos: 50 # Horizontal position; 50 = center of the card ypos: 50 # Vertical position; 50 = center of the card length: 60 # Length of the line styles: stroke: var(--divider-color) # Border or line color stroke-width: 2 # Border or line thickness ``` -------------------------------- ### Using zpos and dzpos to layer circles and rectangles Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/card-basics/positioning-and-sizing.md Shows how to use zpos to override the default layer position of a rectangle and dzpos to offset the layer of a circle. The example places a circle with dzpos: 1 just above the normal Circle layer (default 300) and a rectangle with zpos: 350 above the normal Rectangle layer (default 200). ```yaml layout: circles: - xpos: 50 # Horizontal center ypos: 50 # Vertical center radius_percent: 30 # Circle size dzpos: 1 # Draw just above the normal Circle layer rectangles: - xpos: 50 # Horizontal center ypos: 50 # Vertical center width: 70 # Rectangle width height: 30 # Rectangle height zpos: 350 # Override the normal Rectangle layer of 200 ``` -------------------------------- ### Use the local number in a JavaScript template Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/tools/controls/fhs-input-number.md This YAML shows how to read the local number's state in a JavaScript template and convert it to a number. The example uses the value to set the rolling window duration for a sparkline, multiplying the number of days by 24 to get hours. ```yaml entities: - entity: fhs_input_number.history_days # Local number used to choose the history length initial: 1 min: 1 max: 14 - entity: sensor.temperature # Entity whose history is graphed layout: sparklines: - entity_index: 1 # Graph the temperature entity xpos: 50 ypos: 50 width: 80 height: 35 # Convert the selected number of days to hours for the Sparkline. period: rolling_window: duration: hour: | [[[ return Number(entities[0].state) * 24; ]]] ``` -------------------------------- ### Resource URL path Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/getting-started/installation.md The file becomes available in Home Assistant at this path after copying to config/www. ```text /local/flex-horseshoe-card.js ``` -------------------------------- ### Build a name from entity, device, area, floor, and text parts Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/tools/entities/entity-name-tool.md Builds a name from several parts listed under `entities[].name`. Supported types are `entity`, `device`, `area`, `floor`, and `text`; the parts are shown in the order listed. A `text` part remains exactly as configured, and Home Assistant supplies the current entity, device, area, and floor names. ```yaml entities: # Entities used by this example - entity: sensor.living_room_temperature name: - type: area - type: text text: "-" - type: entity layout: names: - entity_index: 0 xpos: 50 ypos: 50 ``` -------------------------------- ### Define and reference a constant with ref() Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/reuse/reuse-reference.md Defines a constants block with a lineStyle object and uses ref(lineStyle) in the layout to reuse the style. Constant names must start with a letter or underscore and can contain letters, numbers, and underscores; dots are not allowed. ref() can insert a single value, list, or complete configuration block, and dot notation selects nested values without array indexes. ```yaml constants: lineStyle: stroke: var(--disabled-text-color) # Border or line color stroke-width: 2 # Border or line thickness layout: lines: - orientation: horizontal # Arrange it from left to right xpos: 50 # Horizontal position; 50 = center of the card ypos: 64 # Vertical position; 50 = center of the card length: 85 # Length of the line styles: ref(lineStyle) ``` -------------------------------- ### Basic entity slot usage in Flex Horseshoe Card YAML Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/card-basics/entities.md Shows how to define named slots in the `entities:` list and reference them with `entity_index` values like `room[0]` and `outdoor[0]`. The number in brackets is the position inside that slot, starting at zero. A `slot:` starts a named group; following entities stay in that group until another `slot:` starts a new one. ```yaml entities: - entity: sensor.living_room_temperature slot: room # Start the room slot; this entity is room[0] - entity: sensor.living_room_humidity # No new slot: this entity is room[1] - entity: sensor.living_room_co2 # Still in room: this entity is room[2] - entity: sensor.outdoor_temperature slot: outdoor # Start another slot; this entity is outdoor[0] layout: states: - entity_index: room[0] # Living-room temperature xpos: 30 ypos: 50 - entity_index: room[1] # Living-room humidity xpos: 50 ypos: 50 - entity_index: outdoor[0] # Outdoor temperature xpos: 70 ypos: 50 ``` -------------------------------- ### Change size and position with icon_size Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/tools/entities/entity-icon-tool.md Adjust size and position when the icon needs to fit surrounding text, gauge, or control. `align` controls anchoring: `center` centers on the position, `start` anchors the start side, `end` anchors the end side. ```yaml entities: - entity: sensor.example_1 # Entity used by this example layout: icons: - entity_index: 0 # Use entity 0 from entities: (0 = first entity) xpos: 50 # Horizontal position; 50 = center of the card ypos: 35 # Vertical position; 50 = center of the card icon_size: 4 ``` -------------------------------- ### Change state formatting Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/card-basics/entities.md Use `format` with `raw_state_keep` and `raw_state_clean` to display the raw Home Assistant state, optionally replacing underscores with spaces. ```yaml entities: - entity: sensor.mode # Home Assistant entity used by this card format: raw_state_keep: true # Show the raw Home Assistant state raw_state_clean: true # Replace underscores in the raw state with spaces ``` -------------------------------- ### Draw a line between two points with x1/y1/x2/y2 Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/tools/shapes/line-tool.md Draws the same point-to-point line using `x1`, `y1`, `x2`, and `y2` coordinates. `x1`/`y1` define the start point and `x2`/`y2` define the end point. If `start` or `end` is also present, that mapping is used for that endpoint instead. ```yaml layout: lines: - orientation: fromto # Draw between two explicit points x1: 20 # Start x coordinate y1: 30 # Start y coordinate x2: 80 # End x coordinate y2: 70 # End y coordinate ``` -------------------------------- ### Use part of a rectangle path with start and end Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/tools/horseshoe/horseshoe-path-shapes.md Configures a Horseshoe card to use only part of a rectangle path by setting start: 0.5 and end: 3.5. Position numbering is clockwise, with 0 at top-left and 4 back at top-left; decimal values select a point along the following side. ```yaml entities: - entity: sensor.example # Entity displayed by this Horseshoe layout: horseshoes: - entity_index: 0 # Use the first entity configured above horseshoe_scale: {} # Required scale block; uses the default 0–100 linear scale xpos: 50 # Horizontal center of the Horseshoe ypos: 50 # Vertical center of the Horseshoe path: type: rectangle width: 70 # Total outside width of the rectangle path height: 50 # Total outside height of the rectangle path start: 0.5 end: 3.5 ``` -------------------------------- ### navigate with navigation_path Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/interaction/actions.md Use `navigate` with `navigation_path` to navigate to another Home Assistant view. Set `navigation_replace: true` to replace the current history entry instead of adding a new one. ```yaml entities: # Entities used by this example - entity: light.living_room layout: states: - entity_index: 0 xpos: 50 ypos: 50 tap_action: action: navigate navigation_path: /lovelace/lights ``` -------------------------------- ### Pass a list or configuration block Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/card-templates/template-variables.md Shows how a variable can contain a list or map, here a list of room names. ```yaml template: name: room_overview # Name used for this template or supplied value variables: - rooms: - Living room - Bedroom - Study ``` -------------------------------- ### Card 26 YAML configuration Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/examples/demo-cards/demo-card-electricity-many.md Example definition for Card 26 using the fhs_card_026_horseshoe_power template. ```yaml - type: custom:flex-horseshoe-card entities: - entity: sensor.dsmr_reading_electricity_currently_delivered name: 'Total' area: ':26:' - entity: sensor.dsmr_reading_phase_currently_delivered_l1 name: 'L1' - entity: sensor.dsmr_reading_phase_currently_delivered_l2 name: 'L2' - entity: sensor.dsmr_reading_phase_currently_delivered_l3 name: 'L3' - entity: sensor.dsmr_reading_electricity_currently_delivered template: name: fhs_card_026_horseshoe_power ``` -------------------------------- ### Basic card structure with entities and layout Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/card-basics/card-overview.md Shows the minimal configuration for a Flexible Horseshoe Card. It combines the 'entities' section for the Home Assistant data sources and the 'layout' section for the visible items. Use the 'entity_index' in layout items to reference which entity to use, and 'xpos'/'ypos' to position items with 50 meaning the center. ```yaml type: custom:flex-horseshoe-card entities: - entity: sensor.living_room_temperature # Home Assistant entity used by this card layout: icons: - entity_index: 0 # Use the first entity configured above xpos: 50 # Horizontal position; 50 = center of the card ypos: 35 # Vertical position; 50 = center of the card states: - entity_index: 0 # Use the first entity configured above xpos: 50 # Horizontal position; 50 = center of the card ypos: 55 # Vertical position; 50 = center of the card ``` -------------------------------- ### Card 23 YAML configuration Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/examples/demo-cards/demo-card-electricity-many.md Example definition for Card 23 using the fhs_card_023_horseshoe_power template. ```yaml - type: custom:flex-horseshoe-card entities: - entity: sensor.dsmr_reading_electricity_currently_delivered decimals: 2 name: 'Total' area: ':23:' - entity: sensor.dsmr_reading_phase_currently_delivered_l1 decimals: 2 name: 'L1' - entity: sensor.dsmr_reading_phase_currently_delivered_l2 decimals: 2 name: 'L2' - entity: sensor.dsmr_reading_phase_currently_delivered_l3 decimals: 2 name: 'L3' - entity: sensor.dsmr_reading_electricity_currently_delivered decimals: 2 template: name: fhs_card_023_horseshoe_power ``` -------------------------------- ### Card 22 YAML configuration Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/examples/demo-cards/demo-card-electricity-many.md Example definition for Card 22 using the fhs_card_022_horseshoe_power template. ```yaml - type: custom:flex-horseshoe-card entities: - entity: sensor.dsmr_reading_electricity_currently_delivered decimals: 2 name: 'Total' area: ':22:' - entity: sensor.dsmr_reading_phase_currently_delivered_l1 decimals: 2 name: 'L1' - entity: sensor.dsmr_reading_phase_currently_delivered_l2 decimals: 2 name: 'L2' - entity: sensor.dsmr_reading_phase_currently_delivered_l3 decimals: 2 name: 'L3' - entity: sensor.dsmr_reading_electricity_currently_delivered decimals: 2 template: name: fhs_card_022_horseshoe_power ``` -------------------------------- ### Reuse one layout item with same_as Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/reuse/reuse-introduction.md Use `same_as` to copy the configuration of a previously defined item (here, a rectangle with id `panel`) and then override only the properties that differ, such as `xpos`. The second rectangle keeps the first rectangle's settings and changes only its position. ```yaml layout: rectangles: - id: panel # Name this item so it can be referenced later xpos: 25 # Horizontal position; 50 = center of the card ypos: 50 # Vertical position; 50 = center of the card width: 35 # Width in card coordinates height: 30 # Height in card coordinates radius: 4 # Radius of this shape styles: fill: none # Keep the inside transparent; draw only the border stroke: var(--divider-color) # Border or line color - same_as: panel # Start with the settings from panel xpos: 75 # Horizontal position; 50 = center of the card ``` -------------------------------- ### Watch another configured entity with entity.1 Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/interaction/animations.md Configures an animation for the second entity (index 1) using the 'window-icon' animation. The state 'on' triggers a flash animation on the icon. Requires an entity definition with 'attribute' to use that attribute's value for state matching. ```yaml entities: # Entities used by this example - entity: sensor.temperature - entity: binary_sensor.window animations: entity.1: - state: "on" icons: - animation_id: window-icon styles: - animation: flash 1s ease-in-out 3 layout: icons: - animation_id: window-icon entity_index: 1 xpos: 50 ypos: 50 ``` -------------------------------- ### Size a Circle with radius_percent Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/tools/shapes/circle-tool.md Shows the preferred radius method for new configurations. radius_percent follows the normal card coordinate scale, making the size easy to relate to the rest of the layout. ```yaml layout: circles: - xpos: 50 # Horizontal position; 50 = center of the card ypos: 50 # Vertical position; 50 = center of the card radius_percent: 20 # Radius on the normal card coordinate scale ``` -------------------------------- ### Change arc_degrees to 180 Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/tools/shapes/arc-tool.md Shows how to set arc_degrees to 180 to draw half of the circle. The example uses the same position and radius as the previous arc. ```yaml layout: arcs: - xpos: 50 # Horizontal position; 50 = center of the card ypos: 50 # Vertical position; 50 = center of the card radius: 40 # Radius of the arc arc_degrees: 180 # Draw 180° of the full 360° circle ``` -------------------------------- ### Show a raw state with raw_state_keep and raw_state_clean Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/localization/overview.md Uses the format block to show the raw Home Assistant state and replace underscores with spaces. Useful when the original value is more useful than its normal formatted display. ```yaml entities: - entity: sensor.device_mode # Home Assistant entity used by this card format: raw_state_keep: true # Show the raw Home Assistant state raw_state_clean: true # Replace underscores in the raw state with spaces ``` -------------------------------- ### Rotate the icon with rotate: 90 Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/tools/entities/entity-icon-tool.md Rotate an icon when direction carries meaning, such as an arrow or orientation indicator. The example rotates the icon by 90°. ```yaml entities: - entity: sensor.example_1 # Entity used by this example layout: icons: - entity_index: 0 # Use entity 0 from entities: (0 = first entity) xpos: 50 # Horizontal position; 50 = center of the card ypos: 50 # Vertical position; 50 = center of the card rotate: 90 # Rotate the result by 90° ``` -------------------------------- ### Verify card type in YAML Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/getting-started/installation.md Use this card type in your dashboard to verify the installation. Home Assistant must recognize 'custom:flex-horseshoe-card'. ```yaml type: custom:flex-horseshoe-card # Home Assistant must recognize this custom card type ``` -------------------------------- ### Use an image or SVG with icon: url(...) Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/tools/entities/entity-icon-tool.md Set `icon` to an MDI icon name (e.g., `mdi:thermometer`) or use CSS-style `url(...)` syntax for external SVGs/images. URLs ending in `.svg` load as SVG; others show as images. Keep the source in the same Icon tool so size, position, and alignment remain together. ```yaml layout: icons: - xpos: 50 # Horizontal position; 50 = center of the card ypos: 50 # Vertical position; 50 = center of the card icon: url(/local/icons/temperature.svg) # External SVG shown by this Icon tool icon_size_percent: 18 # Geometric icon size on the card's 100-unit scale ``` -------------------------------- ### Slider set_value_action example Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/tools/controls/slider-tool.md Configures a Slider control with a set_value_action that writes the current thumb value to the entity at index 0 using the set-value action. ```yaml entities: - entity: input_number.temperature # Numeric entity changed by the Slider layout: controls: - type: slider entity_index: 0 xpos: 50 ypos: 50 set_value_action: action: set-value # Write the current thumb value to entity_index 0 ``` -------------------------------- ### Use a specific locale for an entity Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/localization/overview.md Sets the format.locale option to format values differently from the active Home Assistant locale for this card. The example uses nl-NL. ```yaml entities: - entity: sensor.energy_today # Home Assistant entity used by this card format: locale: nl-NL # Use this locale for formatting ``` -------------------------------- ### Supply values when using the template Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/card-templates/template-variables.md Shows how to supply values for template variables when using the template. The default unit remains in use because this instance does not replace it. ```yaml template: name: room_temperature # Name used for this template or supplied value variables: - entity: sensor.bedroom_temperature # Home Assistant entity used by this card - name: Bedroom # Name used for this template or supplied value ``` -------------------------------- ### Set card aspect ratio with layout.aspectratio Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/card-basics/card-overview.md Use layout.aspectratio to make the card wider or taller. The example makes the card 1.5 times wider than it is high. ```yaml layout: aspectratio: 1.5/1 # Make the card 1.5 times wider than it is high ``` -------------------------------- ### Show a state with entity_index and position Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/tools/entities/entity-state-tool.md Configures a State item using the first entity and places it at the center of the card. The unit and number formatting follow Home Assistant unless overridden on the entity. ```yaml entities: - entity: sensor.living_room_temperature # Home Assistant entity used by this card layout: states: - entity_index: 0 # Use the first entity configured above xpos: 50 # Horizontal position; 50 = center of the card ypos: 50 # Vertical position; 50 = center of the card ``` -------------------------------- ### Set value range with horseshoe_scale min/max Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/tools/horseshoe/horseshoe-scale-and-state.md Defines the minimum and maximum values for the horseshoe scale. Values at or below min start at the beginning, values at or above max reach the end. ```yaml entities: - entity: sensor.example_1 # Entity used by this example layout: horseshoes: - entity_index: 0 # Use entity 0 from entities: (0 = first entity) xpos: 50 # Horizontal position; 50 = center of the card ypos: 50 # Vertical position; 50 = center of the card radius: 42 # Distance from the center to the Horseshoe path horseshoe_scale: min: 0 # Value at the start of the scale max: 100 # Value at the end of the scale ``` -------------------------------- ### State-based animation configuration for flex-horseshoe-card Source: https://github.com/amoebelabs/flex-horseshoe-card/blob/master/docs/docs/appearance/animations.md YAML configuration for a custom flex-horseshoe-card that animates a circle and changes an icon color when a watched entity changes state. The `entity.1` entry watches the second entity, `state: 'on'` applies a fill and triggers `jello` animation, and `state: 'off'` triggers `zoomOut`. `animation_id: 10` links the animation block to the second circle and `animation_id: 0` links the icon animation to the icon layout item. ```yaml - type: 'custom:flex-horseshoe-card' entities: - entity: sensor.memory_use_percent - entity: light.1st_floor_hall_light animations: entity.1: - state: 'on' circles: - animation_id: 10 styles: - fill: var(--theme-gradient-color-08) - opacity: 0.9 - animation: jello 1s ease-in-out both - transform-origin: center icons: - animation_id: 0 styles: - fill: black; - state: 'off' circles: - animation_id: 10 reuse: true styles: - transform-origin: center - animation: zoomOut 1s ease-out both icons: - animation_id: 0 styles: - fill: var(--primary-text-color) layout: icons: - id: 0 animation_id: 0 xpos: 50 ypos: 55 entity_index: 1 icon_size: 3.5 styles: - color: white circles: - id: 0 animation_id: 0 xpos: 50 ypos: 50 radius: 35 styles: - fill: var(--primary-background-color) - id: 1 animation_id: 10 xpos: 50 ypos: 50 radius: 30 entity_index: 1 styles: - fill: var(--primary-background-color) ```