Skip to content

[Feature]: slider-card templates #66

@marcelvandorp

Description

@marcelvandorp

Is your feature request related to a problem?

To visually set the requested charge levels, I created 24 vertical sliders, one for each hour of the day. This means I have to repeat the most part of each slider config, which is very inconvenient. And if a setting changes, I need to change that 24 times!

Describe the solution you'd like

A solution as provided with the custom:button-card works great. I can define templates with all the common settings, and for each slider I only need to reference that template. In YAML it would look a bit like this:

At the top of the dashboard code (via 3-dot menu->raw editor):

my-slider-v2_templates:
  hour_slider:
    entity: input_number.wiwo_test_03
    allowTapping: true
    vertical: true
    showMin: false
    styles:
      card:
        - height: 150px
        - width: 15px
      track:
        - background: |
           [[[
             if (entity.state >= 0) return "orange";
             else return "blue";
           ]]]

And each slider will become (only showing 2 of the 24):

- type: custom:my-slider-v2
  entity: input_number.hour_00
  template: hour_slider
- type: custom:my-slider-v2
  entity: input_number.hour_01
  template: hour_slider

Describe alternatives you've considered

The only way to achieve my goal was to repeat each slider-config 24 times.

Additional context

This card is not meant to be useful on phones: the sliders are too narrow for that. I use this on a tablet, with a full-screen card. Above it is an apex chart with the hourly energy prices. The goal is to also add those 24 slider values to that chart (but that is not relevant to this FR)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions