I have a button that when pressed, the icon has to blink until a binary sensor is “on”. when it is not pressed it has to be mdi.wifi-off. when binary sensor is on, the blinking has to stop and icon has just to be green…
How can I do this ?
@WW983 can you tell me how you built the selection-card for the rooms and how you built the “title” cards regarding the used font and colors. In general my setup is a little bit similiar but i want to improve styling and usability…
Sure. here’s the code. But look at the code from the @Mattia2399 . It’s much more professional. The code is specifically balanced for my case. If you have any questions, you can write me a message
I am trying to make an icon that shows “dancing bars” to show that there is music playing.
I found a tutorial for scripting it in CSS but I can’t figure out how to implement that to an icon in Home Assistant. Can someone help?
It may be useful for some of you - here’s my Custom Chips card for my Solar import / export
it changes icon, colour and text and value depending on values coming from my IotaWatt
two sensors used are
‘importing’ which is just measuring the current drawn from the grid
and ‘exporting’ which an integrator on the IotaWatt that pretty much just removes the negative from the number and reports as a positive Export
Here’s how it looks…
and
type: custom:mushroom-chips-card
chips:
- type: template
entity: sensor.exporting
icon: |-
{% set state=states('sensor.exporting') %}
{% if state | is_number and state | float > 0 %}
mdi:transmission-tower-export
{% elif state | is_number and state | float < 0 %}
mdi:transmission-tower-off
{% else %}
mdi:transmission-tower-import
{% endif %}
icon_color: |-
{% set state=states('sensor.exporting') %}
{% if state | is_number and state | float > 0 %}
green
{% elif state | is_number and state | float < 0 %}
blue
{% else %}
red
{% endif %}
content: >-
{% set state=states('sensor.exporting') %} {% if state | is_number and
state | float > 0 %}
Exporting {{ states('sensor.exporting') }} {{ state_attr('sensor.exporting', 'unit_of_measurement') }}
{% elif state | is_number and state | float < 0 %}
Error
{% else %}
Importing {{ states('sensor.importing') }} {{ state_attr('sensor.importing', 'unit_of_measurement') }}
{% endif %}
- type: template
entity: sensor.solar_production
icon: mdi:solar-panel
icon_color: |-
{% set state=states('sensor.solar_production') %}
{% if state | is_number and state | float > 0 %}
green
{% elif state | is_number and state | float < 0 %}
blue
{% else %}
red
{% endif %}
content: >-
{{ states('sensor.solar_production') }} {{
state_attr('sensor.solar_production', 'unit_of_measurement') }}
- type: entity
entity: sensor.total_pv_in_kw
icon: mdi:solar-power-variant-outline
name: Production