Fun with custom:button-card

Hi.

This is my code for switch, but i’m not happy with it.
I would just like to read state “on/off” of the switch instead of power of the sensor. Can someone help me?

    type: custom:button-card
    entity: sensor.shellyplug_s_power
    tap_action:
      action: call-service
      service: switch.toggle
      service_data:
        entity_id: switch.shellyplug_s
    extra_styles: |
      @keyframes ball-scale {
        from {
          transform: scale(1);
          box-shadow: 0 8px 6px -6px #6C7A89;
        }
        to {
          transform: scale(1.10);
          box-shadow: 0 10px 6px -6px #6C7A89;
        }
      }
    show_name: false
    show_state: true
    state:
      - value: 2w
        operator: <
        icon: mdi:television-ambient-light
        styles:
          card:
            - background-color: transparent
            - filter: opacity(100%)
            - animation: null
          icon:
            - color: lightyellow
            - width: 80px
            - height: 80px
          state:
            - color: white
      - value: 2w
        operator: '>'
        icon: mdi:television-ambient-light
        styles:
          card:
            - background-color: lightyellow
            - filter: opacity(100%)
            - animation: ball-scale 1s ease-in-out infinite
          icon:
            - color: black
            - width: 80px
            - height: 80px
          state:
            - color: black

I created a music dashboard for my echo show and it looks awesome. The problem I’m having is when I press one of my buttons it does not highlight the choice I made, so I know what music I picked. I fixed that by adding a border to it. The new problem I’m having is I can’t get the size quite right to fit my dashboard. I have to do a whole new dashboard due to at first using the picture card, and it does not support custom button card. I want to recreate what I have already, but with a border for selection and the size I have now? Any help will be greatly appreciated. Echo Dash Picture Glance card:

Custom Button Card:
image

1 Like

Hello guys,

Here’s what I built a few years ago with custom:button-card. It takes a toll on hardware to the point I can’t use them with old devices but it works very well when fed with sufficient processing power :slight_smile:

Along the years I tried other dashboard solutions like the new UI versions from HA, also tried Mushroom, Minimalist, etc, but I always ended coming back to this.

I’ll be happy to share the yamls if someone wants them.

1 Like

Hi,
i need some help with an backgroundimage

type: custom:button-card
aspect_ratio: 1/1
color_type: icon
color: red
show_icon: false
name: none
show_name: false
style: |
  ha-card {
    background-image: url("{{ state_attr('media_player.sky_q', 'entity_picture') }}");
    background-size: cover;
  }

i want the moviecover out of my mediaplayer as background.
There is definiv a url behind

[https://de.imageservice.sky.com/pd-image/af39e0a2-be15-4cc9-8559-3f6fbb92127f/16-9/1024?territory=DE&provider=SKY&proposition=SKYQ

chat gpt could not help me, thanks in andvance for yor support.

Help with removing some white space
UPDATE - SOLVED
this was a problem w/ horizontal-stack, not button-card. this yaml fixed it

- type: custom:mod-card
        style:
          hui-horizontal-stack-card$: |
            #root { 
              justify-content: center;
              --stack-card-gap: 0;
            }
        card:
          type: horizontal-stack
          cards:

original issue
I have a card that hides itself when not needed, following yaml

state:
    - operator: "template"
      value: "[[[ return variables.optional && entity.state != variables.on_state && (isNaN(entity.state) || entity.state == 0); ]]]"
      styles:
        card:
          - display: none

This works - however there is a tiny space where the card was. All these spaces are a card that is hidden:
image

anyway to target the root hui-card instead and add the display there conditionally?

Hello all,

Currently im building my dashboard based on the ui minimalist template. I’m having trouble with the trash collection part. Can anyone help me out?

I use a template for button card called custom_card_trash.yaml with the following code. My dashboard doens’t give out an error but doens’t show anything either. Can anyone find the issue?

---
custom_card_trash:
  template:
    - "icon_more_info_new"
    - "ulm_translation_engine"
  variables:
    ulm_card_generic_swap_icon: "[[[ return entity.attributes.icon ]]]"
    ulm_card_generic_swap_name: "[[[ return entity.attributes.friendly_name ]]]"
    ulm_outlet_power_enable_popup: false
  custom_fields:
    item1:
      card:
        extra_styles: |
          @-webkit-keyframes pulsate-fwd {
            0% {
              -webkit-transform: scale(1);
                      transform: scale(1);
            }
            50% {
              -webkit-transform: scale(1.1);
                      transform: scale(1.1);
            }
            100% {
              -webkit-transform: scale(1);
                      transform: scale(1);
            }
          }
          @keyframes pulsate-fwd {
            0% {
              -webkit-transform: scale(1);
                      transform: scale(1);
            }
            50% {
              -webkit-transform: scale(1.1);
                      transform: scale(1.1);
            }
            100% {
              -webkit-transform: scale(1);
                      transform: scale(1);
            }
          }
        styles:
          card:
            - animation: >
                [[[
                  if (((states[entity.entity_id].attributes.message == 'groente-, fruit- en tuinafval') || (states[entity.entity_id].attributes.message == 'plastic, metaal en drankenkartons') || (states[entity.entity_id].attributes.message == 'oud papier & karton')) || (states[entity.entity_id].attributes.message == 'grof tuinafval')) || (states[entity.entity_id].attributes.message == 'restafval')) && ((states['sensor.trash_tomorrow'].state == 'tomorrow') || (states['sensor.trash_tomorrow'].state == 'today')))
                    return 'pulsate-fwd 1s ease-in-out infinite';
                  else
                    return '';
                ]]]
        type: "custom:button-card"
        custom_fields:
          item1:
            card:
              type: "custom:button-card"
              entity: "[[[ return entity.entity_id ]]]"
              state:
                - operator: "template"
                  value: |
                    [[[ return states[entity.entity_id].attributes.message == 'groente-, fruit- en tuinafval'; ]]]
                  icon: mdi:recycle
                  styles:
                    icon:
                      - color: "rgba(186, 146, 0, 1)"
                    img_cell:
                      - background-color: "rgba(186, 146, 0, 0.2)"
                    # card:
                    #   - animation: >
                    #       [[[
                    #         if (((states[entity.entity_id].attributes.message == 'groente-, fruit- en tuinafval') || (states[entity.entity_id].attributes.message == 'plastic, metaal en drankenkartons') || (states[entity.entity_id].attributes.message == 'oud papier & karton')) || (states[entity.entity_id].attributes.message == 'grof tuinafval')) || (states[entity.entity_id].attributes.message == 'restafval')) && ((states['states['sensor.trash_tomorrow'].state == 'tomorrow') || (states['states['sensor.trash_tomorrow'].state == 'today')))
                    #           return 'blink 3s ease infinite';
                    #         else
                    #           return '';
                    #       ]]]
                - operator: "template"
                  value: |
                    [[[ return states[entity.entity_id].attributes.message == 'plastic, metaal en drankenkartons'; ]]]
                  icon: mdi:delete
                  styles:
                    # card:
                    # - animation: >
                    #     [[[
                    #       if (((states[entity.entity_id].attributes.message == 'groente-, fruit- en tuinafval') || (states[entity.entity_id].attributes.message == 'plastic, metaal en drankenkartons') || (states[entity.entity_id].attributes.message == 'oud papier & karton')) || (states[entity.entity_id].attributes.message == 'grof tuinafval')) || (states[entity.entity_id].attributes.message == 'restafval')) && ((states['states['sensor.trash_tomorrow'].state == 'tomorrow') || (states['states['sensor.trash_tomorrow'].state == 'today')))
                    #         return 'blink 3s ease infinite';
                    #       else
                    #         return '';
                    #     ]]]
                    icon:
                      - color: "rgba(160, 160, 160, 1)"
                    img_cell:
                      - background-color: "rgba(160, 160, 160, 0.2)"
                - operator: "template"
                  value: |
                    [[[ return states[entity.entity_id].attributes.message == 'oud papier & karton'; ]]]
                  icon: mdi:paper-cut-vertical
                  styles:
                    icon:
                      - color: "rgba(0, 100, 200, 1)"
                    img_cell:
                      - background-color: "rgba(0, 100, 200, 0.2)"
                    # card:
                    #   - animation: >
                    #       [[[
                    #         if (((states[entity.entity_id].attributes.message == 'groente-, fruit- en tuinafval') || (states[entity.entity_id].attributes.message == 'plastic, metaal en drankenkartons') || (states[entity.entity_id].attributes.message == 'oud papier & karton')) || (states[entity.entity_id].attributes.message == 'grof tuinafval')) || (states[entity.entity_id].attributes.message == 'restafval')) && ((states['states['sensor.trash_tomorrow'].state == 'tomorrow') || (states['states['sensor.trash_tomorrow'].state == 'today')))
                    #           return 'blink 3s ease infinite';
                    #         else
                    #           return '';
                    #       ]]]
                - operator: "template"
                  value: |
                    [[[ return states[entity.entity_id].attributes.message == 'grof tuinafval'; ]]]
                  icon: mdi:paper-cut-vertical
                  styles:
                    icon:
                      - color: "rgba(0, 100, 200, 1)"
                    img_cell:
                      - background-color: "rgba(0, 100, 200, 0.2)"
                    # card:
                    #   - animation: >
                    #       [[[
                    #         if (((states[entity.entity_id].attributes.message == 'groente-, fruit- en tuinafval') || (states[entity.entity_id].attributes.message == 'plastic, metaal en drankenkartons') || (states[entity.entity_id].attributes.message == 'oud papier & karton')) || (states[entity.entity_id].attributes.message == 'grof tuinafval')) || (states[entity.entity_id].attributes.message == 'restafval')) && ((states['states['sensor.trash_tomorrow'].state == 'tomorrow') || (states['states['sensor.trash_tomorrow'].state == 'today')))
                    #           return 'blink 3s ease infinite';
                    #         else
                    #           return '';
                    #       ]]]
                - operator: "template"
                  value: |
                    [[[ return states[entity.entity_id].attributes.message == 'restafval'; ]]]
                  icon: mdi:paper-cut-vertical
                  styles:
                    icon:
                      - color: "rgba(0, 100, 200, 1)"
                    img_cell:
                      - background-color: "rgba(0, 100, 200, 0.2)"
                    # card:
                    #   - animation: >
                    #       [[[
                    #         if (((states[entity.entity_id].attributes.message == 'groente-, fruit- en tuinafval') || (states[entity.entity_id].attributes.message == 'plastic, metaal en drankenkartons') || (states[entity.entity_id].attributes.message == 'oud papier & karton')) || (states[entity.entity_id].attributes.message == 'grof tuinafval')) || (states[entity.entity_id].attributes.message == 'restafval')) && ((states['states['sensor.trash_tomorrow'].state == 'tomorrow') || (states['states['sensor.trash_tomorrow'].state == 'today')))
                    #           return 'blink 3s ease infinite';
                    #         else
                    #           return '';
                    #       ]]]        
              styles:
                icon:
                  - color: "rgba(var(--color-theme),0.3)"
          item2:
            card:
              type: "custom:button-card"
              entity: "[[[ return entity.entity_id ]]]"
              styles:
                name:
                  - color: >
                      [[[
                        if (((states[entity.entity_id].attributes.message == 'groente-, fruit- en tuinafval') || (states[entity.entity_id].attributes.message == 'plastic, metaal en drankenkartons') || (states[entity.entity_id].attributes.message == 'oud papier & karton')) || (states[entity.entity_id].attributes.message == 'grof tuinafval')) || (states[entity.entity_id].attributes.message == 'restafval')) && ((states['sensor.trash_tomorrow'].state == 'tomorrow') || (states['sensor.trash_tomorrow'].state == 'today')))
                          return 'rgba(33, 33, 33, 1.0)';
                        else
                          return 'rgba(33, 33, 33, 0.4)';
                      ]]]
              label: >
                [[[ 
                  { return states['sensor.trash_tomorrow'].state; }
                ]]]
              name: >
                [[[
                  if (states[entity.entity_id].attributes.message === 'groente-, fruit- en tuinafval' )
                    return 'Groente-, fruit- en tuinafval';
                  if (states[entity.entity_id].attributes.message === 'plastic, metaal en drankenkartons')
                    return 'plastic, metaal en drankenkartons';
                  if (states[entity.entity_id].attributes.message === 'oud papier & karton')
                    return 'oud papier & karton';
                  if (states[entity.entity_id].attributes.message === 'grof tuinafval')
                    return 'grof tuinafval';
                  else
                    return 'restafval';
                ]]]
              state_display: >
                [[[ 
                  { return states['sensor.trash_tomorrow'].state; }
                ]]]

The code in the dashboard thats using the template is super simple and looks like this:

      - type: grid
        columns: 2
        square: false
        view_layout:
          grid-area: house
        cards:
          - type: 'custom:button-card'
            template: custom_card_trash
            entity: sensor.afvalwijzer_today

the two sensors that are used “sensor.trash_tomorrow” and “sensor.afvalwijzer_today” have the following state.

sensor.trash_tomorrow = tomorrow
sensor.afvalwijzer_today = groente-, fruit- en tuinafval

Does anyone have a suggestion on what I can do to test/debug or fix the code? I already tried multiple variations like this:

Change the code from:

(states[entity.entity_id].attributes.message == 'groente-, fruit- en tuinafval')

to:

(states[entity.entity_id].state == 'groente-, fruit- en tuinafval')

and also removing all different variables back to just the one above but still with no success.

I hope someone can help me out.

Kind regards,
Remco

type: custom:button-card
entity: input_boolean.auto_klima_helfer
tap_action:
  action: call-service
  service: input_boolean.auto_klima_helfer
name: Corsa
icon: mdi:car
styles:
  card:
    - background: |
        [[[
          if (entity.state == "off") return "#252a38 url(/local/Icons/strasse.png)"
          if( entity.state == "on" && (states["sensor.psa_preconditioning_status"].state == 'Enabled' ))  return "#643843 url(/local/Icons/strasse.png)"  
         ]]]     
    - background-position: right center
    - background-size: 70%
    - background-repeat: no-repeat
    - border: 0px
    - height: 100%
  icon:
    - width: 32px
    - height: 32px
    - color: var(--primary-text-color)
    - padding: 14px
    - margin-left: 16px
  name:
    - font-size: 14px
    - padding-left: 4px
    - font-weight: bold
    - justify-self: start
  custom_fields:
    label_reichweite:
      - font-size: 14px
      - padding-left: 24px
      - font-weight: bold
      - justify-self: start
      - color: var(--secondary-text-color)
      - margin-top: 24px
    reichweite:
      - font-size: 36px
      - padding-left: 24px
      - font-weight: 300
      - justify-self: start
      - color: var(--primary-text-color)
    label_batterie:
      - font-size: 14px
      - padding-left: 24px
      - font-weight: bold
      - justify-self: start
      - color: var(--secondary-text-color)
      - margin-top: 24px
    batterie:
      - font-size: 46px
      - padding-left: 24px
      - font-weight: 300
      - justify-self: start
      - color: var(--primary-text-color)
    label_wasser:
      - font-size: 14px
      - padding-left: 24px
      - font-weight: bold
      - justify-self: start
      - color: var(--secondary-text-color)
      - margin-top: 24px
    wasser:
      - font-size: 20px
      - padding-left: 24px
      - font-weight: 300
      - justify-self: start
      - color: var(--primary-text-color)
      - margin-top: 4px
    next:
      - font-size: 20px
      - padding-left: 24px
      - font-weight: 300
      - justify-self: start
      - color: var(--primary-text-color)
      - margin-top: 24px
      
  grid:
    - grid-template-areas: >-
        "i n" "label_reichweite label_reichweite" "reichweite
        reichweite""label_batterie label_batterie""batterie
        batterie""label_wasser label_wasser""wasser wasser" "next next" 
    - grid-template-columns: 64px 1fr
    - grid-template-rows: 32px 1fr
custom_fields:
  label_reichweite: |
    [[[ return "Reichweite"]]]
  reichweite: |
    [[[
        return   + (states["sensor.psa_range"].state ) + " km"
    ]]]
  label_batterie: |
    [[[ return "Batterie "]]]
  batterie: |
    [[[  
        return  + (states["sensor.psa_battery_level"].state ) + " %"   
    ]]]
  label_wasser: |
    [[[ return "Klima " ]]]  
  wasser: |
    [[[
      if (entity.state == "off") return 'Aus'
      if ( entity.state == "on" && (states["sensor.psa_preconditioning_status"].state == 'Disabled' )) return 'Wartet'
      if ( entity.state == "on" && (states["sensor.psa_preconditioning_status"].state == 'Enabled' ))  return  states["sensor.dauer_klima"].state + ' Minuten';
        return "Aus"
     ]]]  
  next: |
    [[[
      return `<ha-icon
        icon="mdi:fan"
        style="width: 24px; height: 24px; color:var(--primary-text-color); background: rgba(189,189,189,0.2); padding: 4px 16px 8px; border-radius: 8px;">
        </ha-icon>`               
    ]]] 

Hey guys how can i animate the fan icon in a custom field
with this [[[ if (states["sensor.psa_preconditioning_status"].state == 'Enabled' ) return 'rotating 1s infinite linear' ]]]

Hi, I have a problem with extra_styles:

If my entity gives me a name-name value, the style is applied. However, if the value is name+name, or name_name, the style is not applied.

This works:

extra_styles: |

    --Organico-Vetro: hue-rotate(100deg) brightness(0.7); /* dark green */


This doesn’t work:

extra_styles: |

    --Organico+Vetro: hue-rotate(100deg) brightness(0.7); /* dark green */

extra_styles: |

    --Organico_Vetro: hue-rotate(100deg) brightness(0.7); /* dark green */


The extra_styles only accepts the - symbol?
Thanks

I am struggling with some code for my dashboard. I am trying to create a template for an embedded card within a custom button card. I have a template mostly worked out and determined how to get the entity from a new variable.

timer:
  variables:
    timer_on: >
      [[[ return states[variables.timer_entity].state == 'active' ]]]
  styles:
    custom_fields:
      timer:
        - display: block
        - position: absolute
        - top: >
            [[[
              return window.matchMedia('(max-width: 1200px)').matches
                  ? '82%'
                  : '92%';
            ]]]
        - left: -13%
        - width: 125%
  custom_fields:
    timer:
      card:
        type: custom:timer-bar-card
        entity: '[[[ return variables.timer_entity; ]]]'
        layout: full_row
        text_width: 0px
        invert: true
        bar_foreground: >
          [[[
            return variables.timer_on
                ? '#3182b7'
                : 'none';
          ]]]
        bar_background: none
        modifications:
          - elapsed: 90%
            bar_foreground: 'rgb(255,0,0)'

As you can see I am also trying to create a variable that looks at the variable timer_entity and whether it is active to make changes to the car color. I can’t get it to work. If I change my timer_on variable to look at the state of a specific timer entity it works, but I am trying to minimize the amount of redundant code. Can anyone help me to figure out what I am doing wrong? Thanks in advance.

Hi guys,any ideea how to remove the space from this ?


tried different themes,custom theme but nothing. the normal thermostat is working but custom button is not. :frowning:

This is the guys Gumroad page. Will cost you only 2 dollars to get the code. He’s got great content, so just pay up!

This is so cool !!!
Thanks for sharing !!!

Thats a sad evolution…

You don’t have to buy it.

if you want a scrolling text, just search the community for it. there are examples of button-card using the actual scroll html feature. but since that is supposed to be outdated, you can also find examples of the new way of doing it, with Css translateX()

I m sure because I posted about both :wink:

Sep-20-2024 11-57-17

(nevermind the hiccups here, which is caused by the screen vid resolution, it’s buttery smooth on the desktop, even with the custom ticker tape font )

btw the ask of dos1973 seems another, those are not scrolling cards with text? seem more of a bar card tbh. many example in the comm. too.

no one is going to make the card for you probably, so give it some effort and bring back the results here so we can check them and help

Could anyone help me?

hi there, just a question cause I am dealing to understand this card a bit deeper, whats the n and i stand for in the grid-template-area property?

I cant understand it, its clear for me when you point to a temp, btn or whatever, since you declare it later on in the custom_fields field, but this two and others I see often in other examples i cant see whatś its meaning.

Hi, have you seen this: GitHub - custom-cards/button-card: ❇️ Lovelace button-card for home assistantADVANCED styling options

1 Like

nice, that worked! I have taken a look before, but didn´t see it in there, now with a deeper dive I just found it. thankl you

1 Like

Here’s my news-ticker…

Config:

  - platform: feedparser
    name: CTV News
    date_format: "%a, %d %b %Y %H:%M:%S %Z"
    feed_url: "https://www.ctvnews.ca/rss/ctvnews-ca-top-stories-public-rss-1.822009"
    inclusions: title
    exclusions: []
    scan_interval:
      minutes: 15
    show_topn: 20

  - platform: feedparser
    name: Google News
    date_format: "%a, %d %b %Y %H:%M:%S %Z"
    feed_url: "https://www.google.ca/alerts/feeds/00028625660956993271/15040452229692133315"
    inclusions: title
    exclusions: []
    scan_interval:
      minutes: 15
    show_topn: 20

  ## CTV NEWS

  - platform: template
    sensors:
      ctv_news_attributes_0:
        friendly_name: "CTV News Content 0"
        value_template: >
          {{ states.sensor.ctv_news.attributes.entries[0].title }}

  - platform: template
    sensors:
      ctv_news_attributes_1:
        friendly_name: "CTV News Content 1"
        value_template: >
          {{ states.sensor.ctv_news.attributes.entries[1].title }}

  - platform: template
    sensors:
      ctv_news_attributes_2:
        friendly_name: "CTV News Content 2"
        value_template: >
          {{ states.sensor.ctv_news.attributes.entries[2].title }}

  - platform: template
    sensors:
      ctv_news_attributes_3:
        friendly_name: "CTV News Content 3"
        value_template: >
          {{ states.sensor.ctv_news.attributes.entries[3].title }}

  - platform: template
    sensors:
      ctv_news_attributes_4:
        friendly_name: "CTV News Content 4"
        value_template: >
          {{ states.sensor.ctv_news.attributes.entries[4].title }}

  - platform: template
    sensors:
      ctv_news_attributes_5:
        friendly_name: "CTV News Content 5"
        value_template: >
          {{ states.sensor.ctv_news.attributes.entries[5].title }}

  - platform: template
    sensors:
      ctv_news_attributes_6:
        friendly_name: "CTV News Content 6"
        value_template: >
          {{ states.sensor.ctv_news.attributes.entries[6].title }}

  - platform: template
    sensors:
      ctv_news_attributes_7:
        friendly_name: "CTV News Content 7"
        value_template: >
          {{ states.sensor.ctv_news.attributes.entries[7].title }}

  - platform: template
    sensors:
      ctv_news_attributes_8:
        friendly_name: "CTV News Content 8"
        value_template: >
          {{ states.sensor.ctv_news.attributes.entries[8].title }}

  - platform: template
    sensors:
      ctv_news_attributes_9:
        friendly_name: "CTV News Content 9"
        value_template: >
          {{ states.sensor.ctv_news.attributes.entries[9].title }}

  ## GOOGLE NEWS

  - platform: template
    sensors:
      google_news_attributes_0:
        friendly_name: "Google News Content 0"
        value_template: >
          {{ states.sensor.google_news.attributes.entries[0].title }}

  - platform: template
    sensors:
      google_news_attributes_1:
        friendly_name: "Google News Content 1"
        value_template: >
          {{ states.sensor.google_news.attributes.entries[1].title }}

  - platform: template
    sensors:
      google_news_attributes_2:
        friendly_name: "Google News Content 2"
        value_template: >
          {{ states.sensor.google_news.attributes.entries[2].title }}

  - platform: template
    sensors:
      google_news_attributes_3:
        friendly_name: "Google News Content 3"
        value_template: >
          {{ states.sensor.google_news.attributes.entries[3].title }}

  - platform: template
    sensors:
      google_news_attributes_4:
        friendly_name: "Google News Content 4"
        value_template: >
          {{ states.sensor.google_news.attributes.entries[4].title }}

  - platform: template
    sensors:
      google_news_attributes_5:
        friendly_name: "Google News Content 5"
        value_template: >
          {{ states.sensor.google_news.attributes.entries[5].title }}

  - platform: template
    sensors:
      google_news_attributes_6:
        friendly_name: "Google News Content 6"
        value_template: >
          {{ states.sensor.google_news.attributes.entries[6].title }}

  - platform: template
    sensors:
      google_news_attributes_7:
        friendly_name: "Google News Content 7"
        value_template: >
          {{ states.sensor.google_news.attributes.entries[7].title }}

  - platform: template
    sensors:
      google_news_attributes_8:
        friendly_name: "Google News Content 8"
        value_template: >
          {{ states.sensor.google_news.attributes.entries[8].title }}

  - platform: template
    sensors:
      google_news_attributes_9:
        friendly_name: "Google News Content 9"
        value_template: >
          {{ states.sensor.google_news.attributes.entries[9].title }}

  - platform: template
    sensors:
      google_news_attributes_10:
        friendly_name: "Google News Content 10"
        value_template: >
          {{ states.sensor.google_news.attributes.entries[10].title }}

  - platform: template
    sensors:
      google_news_attributes_11:
        friendly_name: "Google News Content 11"
        value_template: >
          {{ states.sensor.google_news.attributes.entries[11].title }}

  - platform: template
    sensors:
      google_news_attributes_12:
        friendly_name: "Google News Content 12"
        value_template: >
          {{ states.sensor.google_news.attributes.entries[12].title }}

  - platform: template
    sensors:
      google_news_attributes_13:
        friendly_name: "Google News Content 13"
        value_template: >
          {{ states.sensor.google_news.attributes.entries[13].title }}

  - platform: template
    sensors:
      google_news_attributes_14:
        friendly_name: "Google News Content 14"
        value_template: >
          {{ states.sensor.google_news.attributes.entries[14].title }}

  - platform: template
    sensors:
      google_news_attributes_15:
        friendly_name: "Google News Content 15"
        value_template: >
          {{ states.sensor.google_news.attributes.entries[15].title }}

  - platform: template
    sensors:
      google_news_attributes_16:
        friendly_name: "Google News Content 16"
        value_template: >
          {{ states.sensor.google_news.attributes.entries[16].title }}

  - platform: template
    sensors:
      google_news_attributes_17:
        friendly_name: "Google News Content 17"
        value_template: >
          {{ states.sensor.google_news.attributes.entries[17].title }}

  - platform: template
    sensors:
      google_news_attributes_18:
        friendly_name: "Google News Content 18"
        value_template: >
          {{ states.sensor.google_news.attributes.entries[18].title }}

  - platform: template
    sensors:
      google_news_attributes_19:
        friendly_name: "Google News Content 19"
        value_template: >
          {{ states.sensor.google_news.attributes.entries[19].title }}

YAML:

type: custom:html-card
view_layout:
  position: main
content: |
  <div class="ticker-wrap">
    <div class="ticker">
      <img src="/local/images/the-weather-network-6.png" alt="logo" style="height: 20px; vertical-align: middle;"> </span>
      <span class="ticker__item" style="color: #FFFFFF; font-weight: bold; animation: flashBlue 1s infinite;">WEATHER OUTLOOK </span>
      <style>
      @keyframes flashBlue {
        0% { color: #0984ff; font-weight: bold; }
        50% { color: #000000; font-weight: bold; }
        100% { color: #0984ff; font-weight: bold; }
      }
      </style>
      <span class="ticker__item"  color: #FFFFFF; font-weight: bold;">Current Temperature: [[ sensor.seaton_st_realfeel_temperature ]]°C </span>
      <span class="ticker__item"  color: #FFFFFF; font-weight: bold;">Today's High: [[ sensor.seaton_st_realfeel_temperature_max_day_0 ]]°C </span>
      <span class="ticker__item"  color: #FFFFFF; font-weight: bold;">Current Conditions: [[ sensor.toronto_summary ]] [[ sensor.seaton_st_condition_day_0 ]]. </span>
      <span class="ticker__item"  color: #FFFFFF; font-weight: bold;">Tonight: [[ sensor.seaton_st_condition_night_0 ]]. </span>
      <span class="ticker__item"  color: #FFFFFF; font-weight: bold;">Total Hours of Sun Today: [[ sensor.seaton_st_hours_of_sun_day_0 ]]. </span>
      <span class="ticker__item"  color: #FFFFFF; font-weight: bold;">Air Quality Today: [[ sensor.seaton_st_air_quality_day_0 ]]. <img src="/local/images/the-weather-network-6.png" alt="logo" style="height: 20px; vertical-align: middle;"> </span></span>
      <span class="ticker__item" style="color: #39FF14;">Ragweed Pollen Index:</span><span style="color: white; font-weight: bold;"> [[ sensor.seaton_st_ragweed_pollen_day_0 ]]</span>
      <span class="ticker__item" style="color: #39FF14;">Grass Pollen Index:</span><span style="color: white; font-weight: bold;">  [[ sensor.seaton_st_grass_pollen_day_0 ]]</span>
      <span class="ticker__item" style="color: #39FF14;">Tree Pollen:</span><span style="color: white; font-weight: bold;">  [[ sensor.seaton_st_tree_pollen_day_0 ]]</span>
      <span class="ticker__item" style="color: #FFFFFF; animation: flashRed 1s infinite;">NEWS HEADLINES FOR TODAY <span style="color: green; font-weight: bold;"></span> </span>
      <style>
      @keyframes flashRed {
        0% { color: red; font-weight: bold; }
        50% { color: #000000; font-weight: bold; }
        100% { color: red; font-weight: bold; }
      }
      </style>
      <span class="ticker__item"  color: #FFFFFF;">[[ sensor.ctv_news_attributes_0 ]]  |  <img src="/local/images/ctv-news.png" alt="logo" style="height: 20px; vertical-align: middle;"> </span> </span>
      <span class="ticker__item"  color: #FFFFFF;">[[ sensor.ctv_news_attributes_1 ]]  |  <img src="/local/images/ctv-news.png" alt="logo" style="height: 20px; vertical-align: middle;"> </span> </span>
      <span class="ticker__item"  color: #FFFFFF;">[[ sensor.ctv_news_attributes_2 ]]  |  <img src="/local/images/ctv-news.png" alt="logo" style="height: 20px; vertical-align: middle;"> </span> </span>
      <span class="ticker__item"  color: #FFFFFF;">[[ sensor.ctv_news_attributes_3 ]]  |  <img src="/local/images/ctv-news.png" alt="logo" style="height: 20px; vertical-align: middle;"> </span> </span>
      <span class="ticker__item"  color: #FFFFFF;">[[ sensor.ctv_news_attributes_4 ]]  |  <img src="/local/images/ctv-news.png" alt="logo" style="height: 20px; vertical-align: middle;"> </span> </span>
      <span class="ticker__item"  color: #FFFFFF;">[[ sensor.ctv_news_attributes_5 ]]  |  <img src="/local/images/ctv-news.png" alt="logo" style="height: 20px; vertical-align: middle;"> </span> </span>
      <span class="ticker__item"  color: #FFFFFF;">[[ sensor.ctv_news_attributes_6 ]]  |  <img src="/local/images/ctv-news.png" alt="logo" style="height: 20px; vertical-align: middle;"> </span> </span>
      <span class="ticker__item"  color: #FFFFFF;">[[ sensor.ctv_news_attributes_7 ]]  |  <img src="/local/images/ctv-news.png" alt="logo" style="height: 20px; vertical-align: middle;"> </span> </span>
      <span class="ticker__item"  color: #FFFFFF;">[[ sensor.ctv_news_attributes_8 ]]  |  <img src="/local/images/ctv-news.png" alt="logo" style="height: 20px; vertical-align: middle;"> </span> </span>
      <span class="ticker__item"  color: #FFFFFF;">[[ sensor.ctv_news_attributes_9 ]]  |  <img src="/local/images/ctv-news.png" alt="logo" style="height: 20px; vertical-align: middle;"> </span> </span>
      <span class="ticker__item"  color: #FFFFFF;">[[ sensor.google_news_attributes_0 ]]  |  <img src="/local/images/google-news-4.png" alt="logo" style="height: 20px; vertical-align: middle;"> </span> </span>
      <span class="ticker__item"  color: #FFFFFF;">[[ sensor.google_news_attributes_1 ]]  |  <img src="/local/images/google-news-4.png" alt="logo" style="height: 20px; vertical-align: middle;"> </span> </span>
      <span class="ticker__item"  color: #FFFFFF;">[[ sensor.google_news_attributes_2 ]]  |  <img src="/local/images/google-news-4.png" alt="logo" style="height: 20px; vertical-align: middle;"> </span> </span>
      <span class="ticker__item"  color: #FFFFFF;">[[ sensor.google_news_attributes_3 ]]  |  <img src="/local/images/google-news-4.png" alt="logo" style="height: 20px; vertical-align: middle;"> </span> </span>
      <span class="ticker__item"  color: #FFFFFF;">[[ sensor.google_news_attributes_4 ]]  |  <img src="/local/images/google-news-4.png" alt="logo" style="height: 20px; vertical-align: middle;"> </span> </span>
      <span class="ticker__item"  color: #FFFFFF;">[[ sensor.google_news_attributes_5 ]]  |  <img src="/local/images/google-news-4.png" alt="logo" style="height: 20px; vertical-align: middle;"> </span> </span>
      <span class="ticker__item"  color: #FFFFFF;">[[ sensor.google_news_attributes_6 ]]  |  <img src="/local/images/google-news-4.png" alt="logo" style="height: 20px; vertical-align: middle;"> </span> </span>
      <span class="ticker__item"  color: #FFFFFF;">[[ sensor.google_news_attributes_7 ]]  |  <img src="/local/images/google-news-4.png" alt="logo" style="height: 20px; vertical-align: middle;"> </span> </span>
      <span class="ticker__item"  color: #FFFFFF;">[[ sensor.google_news_attributes_8 ]]  |  <img src="/local/images/google-news-4.png" alt="logo" style="height: 20px; vertical-align: middle;"></span> </span>
      <span class="ticker__item"  color: #FFFFFF;">[[ sensor.google_news_attributes_9 ]]  |  <img src="/local/images/google-news-4.png" alt="logo" style="height: 20px; vertical-align: middle;"></span> </span>
      <span class="ticker__item"  color: #FFFFFF;">[[ sensor.google_news_attributes_10 ]]  |  <img src="/local/images/google-news-4.png" alt="logo" style="height: 20px; vertical-align: middle;"></span> </span>
      <span class="ticker__item"  color: #FFFFFF;">[[ sensor.google_news_attributes_11 ]]  |  <img src="/local/images/google-news-4.png" alt="logo" style="height: 20px; vertical-align: middle;"></span> </span>
      <span class="ticker__item"  color: #FFFFFF;">[[ sensor.google_news_attributes_12 ]]  |  <img src="/local/images/google-news-4.png" alt="logo" style="height: 20px; vertical-align: middle;"></span> </span>
      <span class="ticker__item"  color: #FFFFFF;">[[ sensor.google_news_attributes_13 ]]  |  <img src="/local/images/google-news-4.png" alt="logo" style="height: 20px; vertical-align: middle;"></span> </span>
      <span class="ticker__item"  color: #FFFFFF;">[[ sensor.google_news_attributes_14 ]]  |  <img src="/local/images/google-news-4.png" alt="logo" style="height: 20px; vertical-align: middle;"></span> </span>
      <span class="ticker__item"  color: #FFFFFF;">[[ sensor.google_news_attributes_15 ]]  |  <img src="/local/images/google-news-4.png" alt="logo" style="height: 20px; vertical-align: middle;"></span> </span>
      <span class="ticker__item"  color: #FFFFFF;">[[ sensor.google_news_attributes_16 ]]  |  <img src="/local/images/google-news-4.png" alt="logo" style="height: 20px; vertical-align: middle;"></span> </span>
      <span class="ticker__item"  color: #FFFFFF;">[[ sensor.google_news_attributes_17 ]]  |  <img src="/local/images/google-news-4.png" alt="logo" style="height: 20px; vertical-align: middle;"></span> </span>
      <span class="ticker__item"  color: #FFFFFF;">[[ sensor.google_news_attributes_18 ]]  |  <img src="/local/images/google-news-4.png" alt="logo" style="height: 20px; vertical-align: middle;"></span> </span>
      <span class="ticker__item"  color: #FFFFFF;">[[ sensor.google_news_attributes_19 ]]  |  <img src="/local/images/google-news-4.png" alt="logo" style="height: 20px; vertical-align: middle;"></span> </span>
    </div>
  <style>
    ha-card {
      height: 0px;
      visibility: hidden;
      z-index: 99;
    }    
    
    @keyframes ticker {
      0% {
        transform: translate3d(0, 0, 0);
        visibility: visible;
      }
      100% {
        transform: translate3d(-100%, 0, 0);
        }
      }  
      .ticker-wrap {
        font-family: tahoma;
        font-size: 1.3rem;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        overflow: hidden;
        height: 2.5rem;
        background-color: black;
        visibility: visible;
        padding-left: 100%;
        box-sizing: content-box;
      }
      .ticker {
        display: inline-block;
        height: 2.5rem;
        font-size: 1.3rem;
        line-height: 2.5rem;  
        white-space: nowrap;
        padding-right: 100%;
        box-sizing: content-box;
        animation-iteration-count: infinite;
        animation-timing-function: linear;
        animation-name: ticker;
        animation-duration: 240s;
        &__item {
          display: inline-block;
          color: white;
          font-weight: bold;
        }
      }
      .ticker__item:before {
        content: "  »»";
        color: #ffff00;
        font-size: 1.5rem;
        font-weight: bold;
        margin-right: 10px;
        }
      .ticker__item:after {
      } 
  </style>
1 Like