timer-bar-card icon indicating copy to clipboard operation
timer-bar-card copied to clipboard

Card Templater and value template for active_state field

Open SAOPP opened this issue 5 months ago • 2 comments

Hello!

I’ll ask a question here, I haven't quite figured it out, with the help of Card Templater, will it be possible to set the current state of my binary sensor for a timer bar card?

My example is below:

          - type: custom:timer-bar-card
            entity: binary_sensor.tod
            active_state: 'off' <--- "{{ states('binary_sensor.tod') }}"
            end_time:
              attribute: after
            bar_height: 4px
            # invert: true
            text_width: 50px
            bar_direction: rtl
            bar_radius: 4px
            modifications:
            - elapsed: 0%
              bar_foreground: "#03a9f4"
            - elapsed: 50%
              bar_foreground: orange
            - elapsed: 90%
              bar_foreground: red
            mushroom:
              primary_info: none
              icon_type: none
              layout: horizontal
              color: green
            card_mod:
              style: |
                ha-card {
                  background-color: transparent !important;
                  border: none !important;
                  margin-top: -27px;
                  margin-left: 50px;
                  margin-right: 50px;
                }

I want to set on or off state of my sensor in one card, instead of adding few conditional card and time bar cards.

SAOPP avatar Mar 20 '24 17:03 SAOPP