Card Templater and value template for active_state field
SAOPP opened this issue · comments
Anton Stolov commented
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.
rianadon commented
Yes I think it should be possible. Does something like
type: custom:card-templater
entities:
- binary_sensor.tod
card:
type: custom:timer-bar-card
sync_issues: ignore # Because templates take time to render
entities:
- entity: binary_sensor.tod
active_state_template: {{ states('binary_sensor.tod') }}
....
not work?
Anton Stolov commented
Hello! I missed it up! I will check it, I solved it with two a few conditional cards right now...