Still, youâre missing the operator. Youâre not testing the state of your binary sensor against anything. If you look at Mariusâ example, heâs got != âhome_summaryâ in his code. The first statement before the question mark should return a value of true or false, yours returns the state of your binary sensor.
@CDRX2 I do appreciate your responses. Maybe I am bringing too much past coding into play, but doesnât the binary_sensor state itself evaluate to true or false. The code works if I negate the test, and put ! in front of my object. I am just wondering if manually setting the state in dev tools flows through to the app?
I did try â= trueâ and still got the same behavior.
No worries. A binary_sensor in HA is always âonâ or âoffâ, so you wonât get true or false that way. Whether setting the state manually through dev tools flows through the app, Iâm not sure. In my experience, once a state is set manually, it doesnât stay on that manual input very long (about 10 seconds or so)âŚ
Thanks. Iâll put the test back in. The active weather alert in our area ends at 8pm local tonight, so I will see if the tap_action goes to ânoneâ after that. If not, well then I will punt.
yields what state you want to use to fire the DOM event?
My binary_sensor
s normally show âonâ or âoffâ. Maybe test for that explicitely?
[And yes, sheâs a very cute and cuddly Border Collie mix. But she gives off fluff around the year⌠]
tap_action:
action: >
[[[ return (states['binary_sensor.template_rndrck_alrt'].state == 'on')
? 'fire-dom-event' : 'none'; ]]]
would do it
Can you have the JS-Button-Card-discussion in another topic, as they are completely not related to card-mod? Neither JS, nor button card.
That worked!
Yes, sorry to co-op the thread
Is there a fix for this ?
I gave you a link to the issue on Github. You may contribute your observations for other cards in this issue.
Hello. Iâm looking for help.
Iâm trying to change the text color in the state badge according with the sensor state but canât find the solution.
Can anyone help me?
Thatâs my configuration, and I want when the window is open(aberta) the color of the letters change to green.
Thanks!
Hello,
Iâm a complete novice so please excuse the potentially stupid question:
What Iâm trying to do: I want to use an input_text to transfer the state (content) of that Helper via a script and MQTT into our Database (not supported by HA so we use MQTT).
So in a View I added an Entities-Card with this helper, now the text field for this is very small and here is where I was wondering if itâs possible to manipulate the size of the text field via card-mod? Any experience with that or thoughts on how it could be possibly done - or not done.
1st post â link at the bottom â post for input_text
Lifesaver! Thank you so much!
Hi all,
I want to animate (blink) the entitiy icon within an entity card. With card-mod I was able to change the color of the font and the icon according to the entity status, but I am struggeling to figure out how I can add the blinking animation to the icon when the entity status is âONâ. I am not that good in CSS and therefore thankful for any hint.
Below my code:
type: entities
entities:
- entity: input_boolean.ferien
card_mod:
style: |
:host {
color:
{% if is_state('input_boolean.ferien', 'on') %}
lightgreen
{% elif is_state('input_boolean.ferien', 'off') %}
white
{% endif %};
--paper-item-icon-color:
{% if is_state('input_boolean.ferien', 'on') %}
lightgreen
{% elif is_state('input_boolean.ferien', 'off') %}
white
{% endif %}
}
Thanks for the feedback,
Aleardo
-
Animation:
see the post above yours - may be it will give some thoughts. -
âif ⌠elif ⌠endifâ - safer to use âif ⌠else ⌠endifâ or âif ⌠elif ⌠else ⌠endifâ.
sorry have not seen that one. Brilliant work from your side. Thanks IIdar!!
Will give it a tryâŚ
Following removal of some paper items in the frontend , specifically input_select, Iâve got an issue with some dropdowns that I canât work out.
I have 2 entities cards on 1 row to set my alarm clock time, hours and minutes, prior to the change they looked like this;
Since updating to the current 2022.3.0b0 release and after some assistance from @Mariusthvdb on Discord, Iâve got the colors and fonts working as before but the input_selects no longer fits into the entities cards and look like this;
This is the yaml
title: Alarm Clock
path: brad-alarm-clock
icon: custom:alarm-clock
cards:
- type: vertical-stack
cards:
- type: custom:decluttering-card
template: back-header-button
variables:
- path: brad-bedroom
- type: custom:decluttering-card
template: title-2
variables:
- title: Alarm Clock
- type: horizontal-stack
cards:
- !include ../../includes/h-space-10.yaml
- type: entities
style: |
ha-card {
background: var(--button-background-color);
border-radius: var(--border-radius);
box-shadow: var(--box-shadow-static);
font-family: var(--font-family);
font-size: var(--font-size);
}
entities:
- entity: sensor.time
name: Current Time
icon: custom:clock
- entity: sensor.alarm_clock_time
name: Alarm Time
icon: custom:alarm-clock
- !include ../../includes/h-space-15.yaml
- !include ../../includes/v-space-10.yaml
- type: horizontal-stack
cards:
- !include ../../includes/h-space-10.yaml
- type: entities
style: |
ha-card {
background: var(--button-background-color);
border-radius: var(--border-radius);
box-shadow: var(--box-shadow-static);
}
entities:
- entity: input_select.alarm_clock_hour
name: Hour
- !include ../../includes/h-space-10.yaml
- type: entities
style: |
ha-card {
background: var(--button-background-color);
border-radius: var(--border-radius);
box-shadow: var(--box-shadow-static);
}
entities:
- entity: input_select.alarm_clock_minute
name: Minute
- !include ../../includes/h-space-15.yaml
Is it now necessary to manually set a size for the input_select? If so, can someone please point me in the right direction?
Thanks
UPDATE:
Iâve added padding-right: 35px to each entity which has corrected the misalignment but would still be keen to know what is different with the new mdc-select element and the potential effects as more and more paper items are replaced.