Person Cards - Show Off Yours

You mean like this?

No problem. Here is the code.

type: custom:button-card
name: Julian
show_name: false
show_state: false
show_icon: true
show_entity_picture: true
entity: person.julian_spillner
tap_action:
  action: more-info
styles:
  card:
    - background-color: var(--contrast2)
    - padding: 10px 10px 10px 0px
  grid:
    - grid-template-areas: '"icon name btn" "icon state btn"'
    - grid-template-columns: 60px 1fr min-content
    - grid-template-rows: min-content
  img_cell:
    - justify-content: start
    - position: absolute
    - width: 40px
    - height: 40px
    - left: 0
    - bottom: 0
    - margin: 0 0 8px 10px
    - border-radius: 50%
    - border: |
        [[[
          if (entity.state == 'home') {
            return '1px solid var(--green)';
          } else {
            return 'none';
          }
        ]]]
  entity_picture:
    - justify-content: start
    - position: absolute
    - width: 40px
    - height: 40px
    - left: 0
    - bottom: 0
    - margin: 0 0 0 0
    - border-radius: 500px
  icon:
    - width: 50px
    - color: var(--contrast1)
  custom_fields:
    name:
      - align-self: start
      - justify-self: start
      - background: none
      - padding: 0
    state:
      - align-self: start
      - justify-self: start
      - background: none
      - padding: 0
      - margin-top: '-5px'
    btn:
      - align-self: end
      - justify-self: end
    icon:
      - align-self: start
      - justify-self: start
    badge:
      - position: absolute
      - left: 38px
      - top: 7px
custom_fields:
  name:
    card:
      type: custom:button-card
      name: Julian
      styles:
        card:
          - color: var(--contrast20)
          - font-size: 14px
          - font-weight: 600
          - background: none
  state:
    card:
      type: custom:button-card
      entity: '[[[ return entity.entity_id ]]]'
      show_icon: false
      name: |
        [[[ 
          return states['person.julian_spillner'].state;
        ]]]
      state:
        - value: home
          name: Home
        - value: not_home
          name: Away
      styles:
        card:
          - color: var(--contrast20)
          - font-size: 12px
          - background: none
          - opacity: '0.7'
  badge:
    card:
      type: custom:button-card
      entity: '[[[ return entity.entity_id ]]]'
      show_icon: true
      show_name: false
      icon: mdi:home
      state:
        - value: home
          icon: mdi:home
          styles:
            card:
              - background: var(--green)
        - value: not_home
          icon: mdi:home-export-outline
          styles:
            card:
              - background: var(--red)
      styles:
        card:
          - border-radius: 50%
          - width: 16px
          - height: 16px
          - background: none
        icon:
          - color: black
          - width: 12px
  btn:
    card:
      type: custom:mushroom-chips-card
      chips:
        - type: entity
          tap_action:
            action: more-info
          entity: sensor.julians_iphone_12_battery_level
          content_info: none
          card_mod:
            style: |
              ha-card {
                --chip-background: {{ 'var(--contrast4)' if states('sensor.julians_iphone_12_battery_level') | float > 10  else 'var(--red)' }};
                --color: {{ 'var(--contrast20)' if states('sensor.julians_iphone_12_battery_level') | float > 10  else 'var(--black)' }};
                padding: 0px!important;
                border-radius: 100px!impportant;
                --primary-text-color: var(--contrast20);

3 Likes

Hi,
I’ve this code, and I wish change color of battery icon and text with percent.

type: vertical-stack
cards:
  - show_current: true
    show_forecast: true
    type: weather-forecast
    entity: weather.albert
    forecast_type: daily
  - type: horizontal-stack
    cards:
      - type: horizontal-stack
        cards:
          - type: custom:button-card
            entity: person.lilphoenix
            aspect_ratio: 1/1
            name: Person
            show_entity_picture: true
            show_name: false
            hold_action:
              action: none
            state:
              - value: home
                styles:
                  custom_fields:
                    icon:
                      - border-color: '#77c66e'
              - value: not_home
                styles:
                  card: null
                  custom_fields:
                    icon:
                      - border-color: '#EF4F1A'
              - value: Work
                styles:
                  custom_fields:
                    icon:
                      - border-color: orange
              - value: Lamures
                styles:
                  custom_fields:
                    icon:
                      - border-color: lightblue
              - value: Lyon
                styles:
                  custom_fields:
                    icon:
                      - border-color: lightblue
            styles:
              card:
                - border-radius: 5%
                - padding: 5%
                - color: gray
                - font-size: 10px
                - text-shadow: 0px 0px 0px black
                - text-transform: capitalize
                - justify-self: end
                - align-self: middle
              grid:
                - grid-template-areas: '"icon status" "n n" "battery proximity" "wifi ss" "sd sd"'
                - grid-template-columns: 2fr 1fr
                - grid-template-rows: 1fr min-content min-content min-content min-content
              name:
                - font-size: 15px
                - align-self: middle
                - justify-self: start
                - padding-bottom: 10px
              custom_fields:
                icon:
                  - clip-path: circle()
                  - width: 80%
                  - pointer-events: none
                  - display: grid
                  - border: 5px solid
                  - border-color: gray
                  - border-radius: 500px
                  - margin: 0 +10% 0 0
                  - justify-self: end
                  - opacity: 1
                status:
                  - align-self: start
                  - justify-self: end
                  - color: gray
                proximity:
                  - padding: 0.5em 0px
                  - align-self: middle
                  - justify-self: start
                  - color: gray
                wifi:
                  - padding: 0.5em 0px
                  - align-self: middle
                  - justify-self: start
                  - color: gray
                  - '--text-wifi-color-sensor': >-
                      [[[ if (states["sensor.oneplus_wifi_connection"].state ==
                      '<not connected>') return "#aaaaaa"; ]]]
                battery:
                  - padding: 0.5em 0px
                  - align-self: middle
                  - justify-self: start
                  - color: gray
                  - '--text-color-sensor': >-
                      [[[ if (states["sensor.oneplus_battery_level"].state < 50)
                      return "#EF4F1A"; ]]]
                alarm:
                  - padding: 0.5em 0px
                  - align-self: middle
                  - justify-self: start
                  - color: gray
            custom_fields:
              icon: >
                [[[ return entity === undefined ? null : `<img
                src="${states[entity.entity_id].attributes.entity_picture}"
                width="100%">`; ]]]
              status: |
                [[[
                  if (states['person.lilphoenix'].state =='not_home') { 
                  return `<ha-icon icon="mdi:home-export-outline"
                    style="width: 20px; height: 20px; color: red;">
                    </ha-icon><span style="color: red;"> Away</span>`;
                  } 
                  if (states['person.lilphoenix'].state =='home') { 
                  return `<ha-icon 
                    icon="mdi:home"
                    style="width: 20px; height: 20px; color: green;">
                    </ha-icon><span style="color: green;"> ${entity.state}</span>`;
                  } 
                  if (states['person.lilphoenix'].state =='Work') { 
                  return `<ha-icon 
                    icon="mdi:briefcase"
                    style="width: 20px; height: 20px; color: orange;">
                    </ha-icon><span style="color: orange;"> ${entity.state}</span>`;
                  }
                  if (states['person.lilphoenix'].state =='Lyon') { 
                  return `<ha-icon 
                    icon="mdi:home-city"
                    style="width: 20px; height: 20px; color: lightblue;">
                    </ha-icon><span style="color: lightblue;"> ${entity.state}</span>`;
                  }
                  if (states['person.lilphoenix'].state =='Lamures') { 
                  return `<ha-icon 
                    icon="mdi:barn"
                    style="width: 20px; height: 20px; color: lightblue;">
                    </ha-icon><span style="color: lightblue;"> ${entity.state}</span>`;
                  } 
                ]]]
              proximity: |
                [[[
                  return `<ha-icon
                    icon="mdi:map-marker-distance"
                    style="width: 20px; height: 20px; color: #888888;">
                    </ha-icon>  <span>\<span style="color: var(--text-color-sensor);">${states['sensor.home_lilphoenix_distance'].state} Kms</span></span>`
                ]]]
              battery: |
                [[[
                  if (states['sensor.oneplus_battery_state'].state =='charging') { 
                    return `<ha-icon
                    icon="mdi:battery-charging"
                    style="width: 20px; height: 20px; color: green;">
                    </ha-icon> <span><span style="color: green;">${states['sensor.oneplus_battery_level'].state}% battery</span></span>`;
                  } else {
                    return `<ha-icon
                    icon="mdi:battery"
                    style="width: 20px; height: 20px; color: #888888;">
                    </ha-icon> <span><span style="color: var(--text-color-sensor);">${states['sensor.oneplus_battery_level'].state}% battery</span></span>`;
                  }
                ]]]
              wifi: |
                [[[
                  if (states['sensor.oneplus_wifi_connection'].state =='<not connected>') { 
                    return `<ha-icon
                    icon="mdi:wifi"
                    style="width: 20px; height: 20px; color: var(--text-wifi-color-sensor);">
                    </ha-icon> <span><span style="color: var(--text-wifi-color-sensor);">Disconnected</span></span>`; 
                  } else {
                    return `<ha-icon
                    icon="mdi:wifi"
                    style="width: 20px; height: 20px; color: #888888;">
                    </ha-icon> <span><span style="color: var(--text-color-sensor);">${states['sensor.oneplus_wifi_connection'].state}</span></span>`;
                  }
                ]]]
          - type: custom:button-card
            entity: person.flo
            aspect_ratio: 1/1
            name: Person
            show_entity_picture: true
            show_name: false
            hold_action:
              action: none
            state:
              - value: home
                styles:
                  custom_fields:
                    icon:
                      - border-color: '#77c66e'
              - value: not_home
                styles:
                  card:
                    - background-color: '#dedede'
                  custom_fields:
                    icon:
                      - border-color: '#EF4F1A'
              - value: Work
                styles:
                  custom_fields:
                    icon:
                      - border-color: deepskyblue
            styles:
              card:
                - border-radius: 5%
                - padding: 5%
                - color: gray
                - font-size: 10px
                - text-shadow: 0px 0px 0px black
                - text-transform: capitalize
                - justify-self: end
                - align-self: middle
              grid:
                - grid-template-areas: '"icon status" "n n" "battery proximity" "wifi ss" "sd sd"'
                - grid-template-columns: 2fr 1fr
                - grid-template-rows: 1fr min-content min-content min-content min-content
              name:
                - font-size: 15px
                - align-self: middle
                - justify-self: start
                - padding-bottom: 10px
              custom_fields:
                icon:
                  - clip-path: circle()
                  - width: 80%
                  - pointer-events: none
                  - display: grid
                  - border: 5px solid
                  - border-color: gray
                  - border-radius: 500px
                  - margin: 0 +10% 0 0
                  - justify-self: end
                  - opacity: 1
                status:
                  - align-self: start
                  - justify-self: end
                  - color: gray
                proximity:
                  - padding: 0.5em 0px
                  - align-self: middle
                  - justify-self: start
                  - color: gray
                wifi:
                  - padding: 0.5em 0px
                  - align-self: middle
                  - justify-self: start
                  - color: gray
                  - '--text-wifi-color-sensor': >-
                      [[[ if
                      (states["sensor.iphone_de_flo_connection_type"].state ==
                      '<not connected>') return "#aaaaaa"; ]]]
                battery:
                  - padding: 0.5em 0px
                  - align-self: middle
                  - justify-self: start
                  - color: gray
                  - '--text-color-sensor': >-
                      [[[ if (states["sensor.iphone_de_flo_battery_level"].state
                      < 50) return "#EF4F1A"; ]]]
            custom_fields:
              icon: >
                [[[ return entity === undefined ? null : `<img
                src="${states[entity.entity_id].attributes.entity_picture}"
                width="100%">`; ]]]
              status: |
                [[[
                  if (states['person.flo'].state =='not_home') { 
                  return `<ha-icon icon="mdi:home-export-outline"
                    style="width: 20px; height: 20px; color: '#888888';">
                    </ha-icon><span> Away</span>`;
                  } 
                  if (states['person.flo'].state =='home') { 
                  return `<ha-icon 
                    icon="mdi:home"
                    style="width: 20px; height: 20px; color: 888888;">
                    </ha-icon><span> ${entity.state}</span>`;
                  } else {
                  return `<ha-icon 
                    icon="mdi:map-marker-radius"
                    style="width: 20px; height: 20px; color: 888888;">
                    </ha-icon><span> ${entity.state}</span>`;
                  }
                ]]]
              proximity: |
                [[[
                  return `<ha-icon
                    icon="mdi:map-marker-distance"
                    style="width: 20px; height: 20px; color: #888888;">
                    </ha-icon>  <span>\<span style="color: var(--text-color-sensor);">${states['proximity.flo'].state} Kms</span></span>`
                ]]]
              battery: |
                [[[
                  if (states['sensor.iphone_de_flo_battery_state'].state =='charging') { 
                    return `<ha-icon
                    icon="mdi:battery-charging"
                    style="width: 20px; height: 20px; color: #888888;">
                    </ha-icon> <span><span style="color: var(--text-color-sensor);">${states['sensor.iphone_de_flo_battery_level'].state}% battery</span></span>`;
                  } else {
                    return `<ha-icon
                    icon="mdi:battery"
                    style="width: 20px; height: 20px; color: #888888;">
                    </ha-icon> <span><span style="color: var(--text-color-sensor);">${states['sensor.iphone_de_flo_battery_level'].state}% battery</span></span>`;
                  }
                ]]]
              wifi: |
                [[[
                  if (states['sensor.iphone_de_flo_ssid'].state =='<not connected>') { 
                    return `<ha-icon
                    icon="mdi:wifi"
                    style="width: 20px; height: 20px; color: var(--text-wifi-color-sensor);">
                    </ha-icon> <span><span style="color: var(--text-wifi-color-sensor);">Disconnected</span></span>`; 
                  } else {
                    return `<ha-icon
                    icon="mdi:wifi"
                    style="width: 20px; height: 20px; color: #888888;">
                    </ha-icon> <span><span style="color: var(--text-color-sensor);">${states['sensor.iphone_de_flo_ssid'].state}</span></span>`;
                  }
                ]]]
  - type: horizontal-stack
    cards: []
  - type: custom:mini-graph-card
    name: Température
    entities:
      - entity: sensor.temperature_salon_temperature
        name: Salon
        color: green
        tap_action:
          double_tap_action: sensor.temperature_salon_humidity
          action: more-info
        action: more-info
      - entity: sensor.ble_temperature_temperature_masterbedroom
        name: Master bedroom
        color: lightblue
      - entity: sensor.ble_temperature_temperature_salle_de_bain
        name: Salle de bain
        color: yellow
      - entity: sensor.temperature_158d0001c2a1bb
        name: Bedroom
    show:
      labels: true
  - type: vertical-stack
    cards:
      - type: custom:bubble-card
        card_type: separator
        name: Lumières master bedroom
        icon: mdi:bed-king-outline
      - square: false
        type: grid
        columns: 3
        lines: 2
        cards:
          - type: custom:bubble-card
            card_type: button
            button_type: slider
            entity: light.ampoule_chambre_tbo
            name: Tibo
            icon: mdi:lightbulb
            tap_action:
              action: toggle
            double_tap_action:
              action: more-info
          - type: custom:bubble-card
            card_type: button
            button_type: slider
            entity: light.ampoule_chambre_flo
            name: Flo
            icon: mdi:lightbulb
            tap_action:
              action: toggle
            double_tap_action:
              action: more-info
          - type: custom:bubble-card
            card_type: button
            button_type: slider
            entity: light.nous_p3_light_chambre
            name: Chambre
            icon: mdi:lightbulb
            tap_action:
              action: toggle
            double_tap_action:
              action: more-info
      - type: custom:bubble-card
        card_type: separator
        name: Lumières salon
        icon: mdi:sofa-outline
      - square: false
        type: grid
        columns: 2
        lines: 2
        cards:
          - type: custom:bubble-card
            card_type: button
            button_type: slider
            entity: light.nous_p2_light_salon_1
            name: Salon 1
            icon: mdi:lightbulb
            tap_action:
              action: toggle
            double_tap_action:
              action: more-info
          - type: custom:bubble-card
            card_type: button
            button_type: slider
            entity: light.nous_p3_light_salon_2
            name: Salon 2
            icon: mdi:lightbulb
            tap_action:
              action: toggle
            double_tap_action:
              action: more-info
      - type: custom:bubble-card
        card_type: separator
        name: Entrée
        icon: mdi:door
      - square: false
        type: grid
        columns: 1
        lines: 2
        cards:
          - type: custom:bubble-card
            card_type: button
            button_type: slider
            entity: light.ampoule_entree
            name: Entrée
            icon: mdi:lightbulb
            tap_action:
              action: toggle
            double_tap_action:
              action: more-info

But don’t know how.

Thanks.

Hi Osher,

i had the same problem as you. You need to extract the states values first to variables as they are not available in the scripts afterwards. Thats why i used variables in my version.

Greets
01

Hello Dave

Can you tell me in your code, where do you get the binary sensor ‘binary_sensor.daves_phone_wifi_state’ ? because I don’t have such a sensor.

Thanks

S.

Have you guys seen this card? I think this looks so good!

7 Likes

I really is a nice dashboard. he has a github.com page here

3 Likes

This is a great card, but i don’t understand the background piece … I am not able to get a background to display… I changed the person name to my own and matched the local/images/ path to my own, but I am still not able to get it to work…?

|
        [[[
          if (states['person.me'].state == 'home' )
            return '#191f2b';
          return 'url(/local/agata/' + states['person.me'].state +
        '.png';
        ]]]

Show me your code

Sure, bare in mind that some of these sensors were guesses …

Also, what is the 3rd and 4th icon you have in your card? What are the sensor names? (english)

This is the best i was able to get the card…The distance bar I’m not sure about…I have a travel integration set up through waze to track my proximity from home… it reports an odd value, so I’m not sure if that’s correct… also the icon on the lower left I also have a proximity sensor to do essentially the same thing… I’ve only ever seen it show 0 MI at this time; which i presume to be correct because I’m at home. I have also not been able to get the separator bar to appear between the distance and the buttons. Again, these sensors have all been best guesses up to this point.

2024-04-19 21_11_23-Andrew Overview Dashboard – Home Assistant - Vivaldi

type: custom:vertical-stack-in-card
style: |
  ha-card{
   box-shadow: none;

  }
cards:
  - variables:
      person: person.andrew_sutcliffe
      bg: |
        [[[
          if (states['person.andrew_sutcliffe'].state == 'home' )
            return '#191f2b';
          return 'url(/local/images/' + states['person.andrew_sutcliffe'].state +
        '.jpg';
        ]]]
    type: custom:button-card
    triggers_update: all
    show_name: false
    show_icon: false
    show_state: false
    show_label: false
    styles:
      card:
        - box-shadow: none
        - border-radius: 15px 15px 0 0 var(--primary-background-color)
        - padding: 0
        - height: 140px
        - background: var(--primary-background-color)
      grid:
        - grid-template-areas: '"item1" "item2"'
        - grid-template-columns: 1fr
        - grid-template-rows: min-content  min-content
        - row-gap: 0px
    custom_fields:
      item1:
        card:
          type: custom:button-card
          styles:
            card:
              - height: 20px
              - border-radius: 0
              - border: 0px solid var(--primary-background-color)
              - box-shadow: 1px black
              - padding: 0
              - background: var(--primary-background-color)
      item2:
        card:
          type: custom:button-card
          entity: '[[[ return variables.person ]]]'
          show_entity_picture: true
          show_name: false
          show_icon: false
          styles:
            card:
              - padding: 0
              - height: 120px
              - box-shadow: none
              - border-radius: 3px 3px 0 0
              - background: null
              - background-image: '[[[ return variables.bg  ]]] '
              - background-size: cover
              - background-position: center
              - overflow: visible
            img_cell:
              - width: 80px
              - height: 80px
              - border-radius: 509%
              - border: 4px solid
              - border-color: |

                  [[[
                    if (states['binary_sensor.withings_in_bed'].state == 'Clear' )
                      return "var(--state-icon-active-color)";
                    return "var(--state-icon-color)";
                  ]]]
              - place-self: center
              - position: relative
              - top: '-29%'
            grid:
              - grid-template-areas: '"i"'
            entity_picture:
              - width: 85px
              - filter: |
                  [[[
                    if (states['person.andrew_sutcliffe'].state != 'home' )
                      return 'grayscale(100%)';
                    return 'null';
                  ]]]
  - type: custom:bar-card
    max: 500
    height: 12
    style: |
      bar-card-value {
       margin: auto;
       margin-top: -4px;
         
       text-shadow: 0px 2px #000000;
      color: gray;
      } 
      ha-card{
       background: rgba(0, 0, 0, 0.0);
       margin-top: -45px;
      }
    entities:
      - entity: sensor.andrew_tracker
    positions:
      icon: 'off'
      indicator: 'on'
      minmax: 'off'
      value: inside
    name: ' '
  - type: horizontal-stack
    cards:
      - entity: sensor.home_andrew_samsung_phone_distance
        show_entity_picture: true
        show_name: false
        font-size: 11px
        show_state: true
        icon: mdi:map-marker-distance
        styles:
          card:
            - height: 55px
            - border-top: 1px solid var(--state-icon-color)
            - background: none
            - padding-top: 9px
            - margin-bottom: 2px
            - font-size: 11px
        state:
          - operator: '=='
            value: 0
            color: var(--state-icon-color)
          - operator: '!='
            value: 0
            color: var(--state-icon-active-color)
        type: custom:button-card
      - entity: sensor.andrew_samsung_phone_battery_level
        show_entity_picture: true
        show_name: false
        show_state: true
        show_label: true
        font-size: 11px
        styles:
          card:
            - height: 55px
            - border-top: 1px solid var(--state-icon-color)
            - background: none
            - padding-top: 9px
            - margin-bottom: 2px
            - font-size: 11px
          icon:
            - color: |
                [[[
                  if (states['sensor.andrew_samsung_phone_battery_level'].state == 'on' )
                    return "var(--state-icon-active-color)";
                  return "var(--state-icon-color)";
                ]]]
        state:
          - operator: '>'
            value: 90
            icon: |
              [[[
                if (states['sensor.andrew_samsung_phone_battery_level'].state == 'on')
                  return 'mdi:battery-charging-100';
                  return 'mdi:battery';
              ]]]
          - operator: <
            value: 89
            icon: |
              [[[
                if (states['sensor.andrew_samsung_phone_battery_level'].state == 'on')
                  return 'mdi:battery-charging-' + Math.ceil(entity.state / 10) * 10;
                 return 'mdi:battery-' + Math.ceil(entity.state / 10) * 10;
              ]]]
        type: custom:button-card
      - entity: sensor.andrew_samsung_phone_detected_activity
        show_entity_picture: false
        show_name: false
        show_last_changed: true
        show_state: false
        show_label: true
        styles:
          card:
            - height: 55px
            - border-top: 1px solid var(--state-icon-color)
            - background: none
            - padding-top: 9px
            - margin-bottom: 2px
            - font-size: 11px
        state:
          - value: still
            icon: mdi:human-male
            label: null
            color: var(--state-icon-color)
            font-size: 11px
          - value: in_vehicle
            icon: mdi:car-back
            label: null
            color: var(--state-icon-active-color)
            font-size: 11px
        type: custom:button-card
      - entity: sensor.andrew_samsung_phone_phone_state
        show_entity_picture: true
        show_name: false
        font-size: 11px
        show_state: false
        show_last_changed: true
        styles:
          card:
            - height: 55px
            - border-top: 1px solid var(--state-icon-color)
            - background: none
            - padding-top: 9px
            - margin-bottom: 2px
            - font-size: 11px
        state:
          - value: ringing
            icon: mdi:phone-ring
            color: var(--state-icon-active-color)
          - value: idle
            icon: mdi:phone-hangup
            color: var(--state-icon-color)
          - value: offhook
            icon: mdi:phone-in-talk
            color: var(--state-icon-active-color)
        type: custom:button-card
      - entity: sensor.andrew_samsung_phone_wifi_ip_address
        show_entity_picture: true
        show_name: false
        show_state: true
        icon: mdi:wifi
        state:
          - value: 192.168.1.149
            color: var(--state-icon-color)
          - operator: '!='
            value: <not connected>
            color: var(--state-icon-active-color)
        styles:
          card:
            - height: 55px
            - border-top: 1px solid var(--state-icon-color)
            - background: none
            - padding-top: 9px
            - margin-bottom: 2px
            - font-size: 11px
        type: custom:button-card

So first off, thank you.
Next, my issue :smiley:

type: custom:button-card
entity: person.kristof
variables:
  phone_battery_level_sensor: '[[[ return states["sensor.in2023_battery_level"].state]]]'
  phone_battery_state_sensor: '[[[ return states["sensor.in2023_battery_state"].state]]]'
  phone_wifi_sensor: '[[[ return states["sensor.in2023_wifi_connection"].state]]]'
aspect_ratio: 4/1
name: Person
show_entity_picture: true
show_name: false
hold_action:
  action: none
state:
  - value: home
    styles:
      card:
        - background-color: '#202124'
      custom_fields:
        icon:
          - border-color: '#77c66e'
  - value: not_home
    styles:
      card:
        - background-color: '#202124'
      custom_fields:
        icon:
          - border-color: deepskyblue
styles:
  card:
    - background-color: '#202124'
    - border-radius: 5%
    - padding: 1% 1% 1% 1%
    - color: gray
    - font-size: 10px
    - text-shadow: 0px 0px 0px black
    - text-transform: capitalize
    - justify-self: center
    - align-content: center
    - width: 300px
    - height: 150px
  grid:
    - grid-template-areas: '"icon status" "icon battery" "icon wifi" "icon proximity"'
    - grid-template-columns: 1.5fr 1fr
    - grid-template-rows: 0.2fr 0.2fr 0.2fr 0.2fr
    - align-content: center
  name:
    - font-size: 15px
    - align-self: middle
    - justify-self: start
  custom_fields:
    icon:
      - clip-path: circle()
      - width: 60%
      - pointer-events: none
      - display: grid
      - border: 5px solid
      - border-color: '#808080'
      - border-radius: 500px
      - margin: 0 0 0 0
      - opacity: 1
      - align-self: center
      - justify-self: center
    status:
      - justify-self: start
      - color: gray
    proximity:
      - align-self: middle
      - justify-self: start
      - color: gray
    wifi:
      - justify-self: start
      - color: gray
      - '--text-wifi-color-sensor': >-
          [[[ if (variables.phone_wifi_sensor == '<not connected>') return
          "#aaaaaa"; ]]]
    battery:
      - align-self: middle
      - justify-self: start
      - color: gray
      - '--text-color-sensor': >-
          [[[ if (variables.phone_battery_level_sensor < 35) return "#EF4F1A";
          ]]]
custom_fields:
  icon: >
    [[[ return entity === undefined ? null : `<img
    src="${states[entity.entity_id].attributes.entity_picture}" width="100%">`;
    ]]]
  status: |
    [[[
      if (entity.state =='not_home') { 
      return `<ha-icon icon="mdi:home-export-outline"
        style="width: 20px; height: 20px; color: '#888888';">
        </ha-icon><span> On the way</span>`;
      } 
      if (entity.state =='home') { 
      return `<ha-icon 
        icon="mdi:home"
        style="width: 20px; height: 20px; color: 888888;">
        </ha-icon><span> ${entity.state}</span>`;
      } else { 
        if (entity.state =='[YOUR OTHER LOCATION]') { 
        return `<ha-icon icon="mdi:pizza"
          style="width: 20px; height: 20px; color: '#888888';">
          </ha-icon><span> ${entity.state}</span>`;
        }
        else{
        return `<ha-icon 
          icon="mdi:map-marker-radius"
          style="width: 20px; height: 20px; color: 888888;">
          </ha-icon><span> ${entity.state}</span>`;
        }
      }
    ]]]
  battery: |
    [[[
      if (variables.phone_battery_state_sensor =='charging') { 
        return `<ha-icon
        icon="mdi:battery-charging-medium"
        style="width: 20px; height: 20px; color: #888888;">
        </ha-icon> <span><span style="color: var(--text-color-sensor);">${variables.phone_battery_level_sensor}% Battery</span></span>`;
      } else {
        return `<ha-icon
        icon="mdi:battery-medium"
        style="width: 20px; height: 20px; color: #888888;">
        </ha-icon> <span><span style="color: var(--text-color-sensor);">${variables.phone_battery_level_sensor}% Battery</span></span>`;
      }
    ]]]
  proximity: |
    [[[
      return `<ha-icon
        icon="mdi:map-marker-distance"
        style="width: 20px; height: 20px; color: #888888;">
        </ha-icon>  <span>\<span style="color: var(--text-color-sensor);">${variables.proximity_sensor} Km</span></span>`
    ]]]
  wifi: |
    [[[
      if (variables.phone_wifi_sensor.state =='<not connected>') { 
        return `<ha-icon
        icon="mdi:wifi"
        style="width: 20px; height: 20px; color: var(--text-wifi-color-sensor);">
        </ha-icon> <span><span style="color: var(--text-wifi-color-sensor);">Disconnected</span></span>`; 
      } else {
        return `<ha-icon
        icon="mdi:wifi"
        style="width: 20px; height: 20px; color: #888888;">
        </ha-icon> <span><span style="color: var(--text-color-sensor);">${variables.phone_wifi_sensor}</span></span>`;
      }
    ]]]

In the example it displays perfectly, but when i push on ‘done’ after editing my dashboard, it is stuck behind another card.

  • I disabled the proximity because i don’t seem to have that sensor.
  • i added height and with because it was way too big, don’t know if this is the correct way

Detected activity (bike, walk, still, driving etc its a sensor from app,(
Phone state - outgoing call etc
Proximity shows distance in straight line. I dont know why waze shows it wrong, since i posted this card some changes in multiple cards appears so i have to adjust them again but im lack of time (and will to be honest)
About background, images names have to be named exact way like your zones name so the first letter have to be capital if zone is named so
image

Thanks for clarifying some of these things. Seems there is a known issue with waze and device tracker’s right now

I tried a few things to get the background images to work, still no luck with that. For my understanding as an example…

  [[[
          if (states['person.andrew_sutcliffe'].state == 'home' )
            return '#191f2b';
          return 'url(/local/images/' + states['person.andrew_sutcliffe'].state +
        '.jpg';
        ]]]

since "state == ‘home’ " is lower case…AND the state of person.andrew_sutcliffe is “home” , then the picture located in “/local/images” would need to be named “home.jpg”, correct?
Apologies if this is overly thorogh, but the above is what i tried and i still can’t seem to get an image to show up…

Thanks again for responding and your help so far… I COMPLETELY understand not having the time and will to deal any more. Trying to get this to work, myself, so i can walk away.

I am not sure on the syntax but there’s an ( before url but no closing ) is that right?

Ok, I did some digging and rearranged some things and here is where i landed… The card will now show a background, I ended up figuring out that it likes the state name, not the zone name and also the picture has to be named as the state name.
Zone name = Home
State name = home
Picture name = home.jpg
Furthermore, I added another couple lines to account for different zones…so If i’m at a local hardware store, the background will update for that…the if statement can be repeated for whatever use case of zone.

This is a powerful ass card dude, nice job!

I hope the waze integration gets fixed soon !

Home

2024-04-21 12_04_58-Hilary Mobile – Home Assistant - Vivaldi

Zone specific
2024-04-21 12_05_59-Hilary Mobile – Home Assistant - Vivaldi

type: custom:vertical-stack-in-card
style: |
  ha-card{
   box-shadow: none;

  }
cards:
  - variables:
      person: person.andrew_sutcliffe
      bg: |
        [[[
          if (states['person.andrew_sutcliffe'].state == 'home' )
            return "url('/local/images/" + states['person.andrew_sutcliffe'].state + ".jpg')";
          if (states['person.andrew_sutcliffe'].state == 'Menards 2800 Wiley Blvd SW, Cedar Rapids, IA 52404' )
            return "url('/local/images/" + states['person.andrew_sutcliffe'].state + ".png')";
          return '#191f2b';
        ]]]
    type: custom:button-card
    triggers_update: all
    show_name: false
    show_icon: false
    show_state: false
    show_label: false
    styles:
      card:
        - box-shadow: none
        - border-radius: 15px 15px 0 0 var(--primary-background-color)
        - padding: 0
        - height: 140px
        - background: var(--primary-background-color)
      grid:
        - grid-template-areas: '"item1" "item2"'
        - grid-template-columns: 1fr
        - grid-template-rows: min-content  min-content
        - row-gap: 0px
    custom_fields:
      item1:
        card:
          type: custom:button-card
          styles:
            card:
              - height: 20px
              - border-radius: 0
              - border: 0px solid var(--primary-background-color)
              - box-shadow: 1px black
              - padding: 0
              - background: var(--primary-background-color)
      item2:
        card:
          type: custom:button-card
          entity: '[[[ return variables.person ]]]'
          show_entity_picture: true
          show_name: false
          show_icon: false
          styles:
            card:
              - padding: 0
              - height: 120px
              - box-shadow: none
              - border-radius: 3px 3px 0 0
              - background: null
              - background-image: '[[[ return variables.bg  ]]]'
              - background-size: cover
              - background-position: center
              - overflow: visible
            img_cell:
              - width: 80px
              - height: 80px
              - border-radius: 509%
              - border: 4px solid
              - border-color: |

                  [[[
                    if (states['binary_sensor.withings_in_bed'].state == 'Clear' )
                      return "var(--state-icon-active-color)";
                    return "var(--state-icon-color)";
                  ]]]
              - place-self: center
              - position: relative
              - top: '-29%'
            grid:
              - grid-template-areas: '"i"'
            entity_picture:
              - width: 85px
              - filter: |
                  [[[
                    if (states['person.andrew_sutcliffe'].state != 'home' )
                      return 'grayscale(100%)';
                    return 'null';
                  ]]]
  - type: custom:bar-card
    max: 500
    height: 12
    style: |
      bar-card-value {
       margin: auto;
       margin-top: -4px;
         
       text-shadow: 0px 2px #000000;
      color: gray;
      } 
      ha-card{
       background: rgba(0, 0, 0, 0.0);
       margin-top: -45px;
      }
    entities:
      - entity: sensor.menards_travel_distance
    positions:
      icon: 'off'
      indicator: 'on'
      minmax: 'off'
      value: inside
    name: ' '
  - type: horizontal-stack
    cards:
      - entity: sensor.home_andrew_samsung_phone_distance
        show_entity_picture: true
        show_name: false
        font-size: 11px
        show_state: true
        icon: mdi:map-marker-distance
        styles:
          card:
            - height: 55px
            - border-top: 1px solid var(--state-icon-color)
            - background: none
            - padding-top: 9px
            - margin-bottom: 2px
            - font-size: 11px
        state:
          - operator: '=='
            value: 0
            color: var(--state-icon-color)
          - operator: '!='
            value: 0
            color: var(--state-icon-active-color)
        type: custom:button-card
      - entity: sensor.andrew_samsung_phone_battery_level
        show_entity_picture: true
        show_name: false
        show_state: true
        show_label: true
        font-size: 11px
        styles:
          card:
            - height: 55px
            - border-top: 1px solid var(--state-icon-color)
            - background: none
            - padding-top: 9px
            - margin-bottom: 2px
            - font-size: 11px
          icon:
            - color: |
                [[[
                  if (states['sensor.andrew_samsung_phone_battery_level'].state == 'on' )
                    return "var(--state-icon-active-color)";
                  return "var(--state-icon-color)";
                ]]]
        state:
          - operator: '>'
            value: 90
            icon: |
              [[[
                if (states['sensor.andrew_samsung_phone_battery_level'].state == 'on')
                  return 'mdi:battery-charging-100';
                  return 'mdi:battery';
              ]]]
          - operator: <
            value: 89
            icon: |
              [[[
                if (states['sensor.andrew_samsung_phone_battery_level'].state == 'on')
                  return 'mdi:battery-charging-' + Math.ceil(entity.state / 10) * 10;
                 return 'mdi:battery-' + Math.ceil(entity.state / 10) * 10;
              ]]]
        type: custom:button-card
      - entity: sensor.andrew_samsung_phone_detected_activity
        show_entity_picture: false
        show_name: false
        show_last_changed: true
        show_state: false
        show_label: true
        styles:
          card:
            - height: 55px
            - border-top: 1px solid var(--state-icon-color)
            - background: none
            - padding-top: 9px
            - margin-bottom: 2px
            - font-size: 11px
        state:
          - value: still
            icon: mdi:human-male
            label: null
            color: var(--state-icon-color)
            font-size: 11px
          - value: in_vehicle
            icon: mdi:car-back
            label: null
            color: var(--state-icon-active-color)
            font-size: 11px
          - value: unknown
            icon: mdi:head-question
            label: null
            color: var(--state-icon-active-color)
            font-size: 11px
        type: custom:button-card
      - entity: sensor.andrew_samsung_phone_phone_state
        show_entity_picture: true
        show_name: false
        font-size: 11px
        show_state: false
        show_last_changed: true
        styles:
          card:
            - height: 55px
            - border-top: 1px solid var(--state-icon-color)
            - background: none
            - padding-top: 9px
            - margin-bottom: 2px
            - font-size: 11px
        state:
          - value: ringing
            icon: mdi:phone-ring
            color: var(--state-icon-active-color)
          - value: idle
            icon: mdi:phone-hangup
            color: var(--state-icon-color)
          - value: offhook
            icon: mdi:phone-in-talk
            color: var(--state-icon-active-color)
        type: custom:button-card
      - entity: sensor.andrew_samsung_phone_wifi_connection
        show_entity_picture: true
        show_name: false
        show_state: true
        icon: mdi:wifi
        state:
          - value: Home_router
            color: var(--state-icon-color)
          - operator: '!='
            value: <not connected>
            color: var(--state-icon-active-color)
        styles:
          card:
            - height: 55px
            - border-top: 1px solid var(--state-icon-color)
            - background: none
            - padding-top: 9px
            - margin-bottom: 2px
            - font-size: 11px
        type: custom:button-card

4 Likes

Thanks for sharing, any ideas why variables var(--) are not working for me? It works fine without it strangely.

Also, how would I add a border for 'not_home' state value? thanks

Edit: Not sure if it’s ideal way of going about it, but for not_home, I coded this:

        [[[
          if (entity.state == 'home') {
            return '1px solid green';
          } else {
            return '1px solid red';
         }
        ]]]

The variables need to be defined in your theme.

1 Like

Hi,
I’ve solved my issue with this code :

type: vertical-stack
cards:
  - type: horizontal-stack
    cards:
      - type: horizontal-stack
        cards:
          - type: custom:button-card
            entity: person.lilphoenix
            aspect_ratio: 1/1
            name: Person
            show_entity_picture: true
            show_name: false
            hold_action:
              action: none
            state:
              - value: Home
                styles:
                  custom_fields:
                    icon:
                      - border-color: '#77c66e'
              - value: not_home
                styles:
                  card:
                    - background-color: '#dedede'
                  custom_fields:
                    icon:
                      - border-color: '#EF4F1A'
              - value: Work
                styles:
                  custom_fields:
                    icon:
                      - border-color: deepskyblue
            styles:
              card:
                - border-radius: 5%
                - padding: 5%
                - color: >-
                    [[[ if (states['person.lilphoenix'].state =='Work') return
                    "deepskyblue"; if (states['person.lilphoenix'].state
                    =='not_home') return "#dedede"; if
                    (states['person.lilphoenix'].state =='Home') return
                    "#77c66e"]]]
                - font-size: 10px
                - text-shadow: 0px 0px 0px black
                - text-transform: capitalize
                - justify-self: end
                - align-self: middle
              grid:
                - grid-template-areas: '"icon status" "n n" "battery proximity" "wifi alarm" "sd sd"'
                - grid-template-columns: 2fr 1fr
                - grid-template-rows: 1fr min-content min-content min-content min-content
              name:
                - font-size: 15px
                - align-self: middle
                - justify-self: start
                - padding-bottom: 10px
              custom_fields:
                icon:
                  - clip-path: circle()
                  - width: 80%
                  - pointer-events: none
                  - display: grid
                  - border: 5px solid
                  - border-color: gray
                  - border-radius: 500px
                  - margin: 0 +10% 0 0
                  - justify-self: end
                  - opacity: 1
                status:
                  - align-self: start
                  - justify-self: end
                  - color: >-
                      [[[ if (states['person.lilphoenix'].state =='Work') return
                      "deepskyblue"; if (states['person.lilphoenix'].state
                      =='not_home') return "#dedede"; if
                      (states['person.lilphoenix'].state =='Home') return
                      "#77c66e"]]]
                proximity:
                  - padding: 0.5em 0px
                  - align-self: middle
                  - justify-self: start
                alarm:
                  - padding: 0.5em 0px
                  - align-self: middle
                  - justify-self: start
                wifi:
                  - padding: 0.5em 0px
                  - align-self: middle
                  - justify-self: start
                  - '--text-wifi-color-sensor': >-
                      [[[ if (states["binary_sensor.oneplus_wifi_state"].state
                      == '<not connected>') return "#aaaaaa"; ]]]
                battery:
                  - padding: 0.5em 0px
                  - align-self: middle
                  - justify-self: start
                  - '--text-color-sensor': >-
                      [[[ if (states["sensor.oneplus_battery_level"].state < 50)
                      return "#EF4F1A"; ]]]
            custom_fields:
              icon: >
                [[[ return entity === undefined ? null : `<img
                src="${states[entity.entity_id].attributes.entity_picture}"
                width="100%">`; ]]]
              status: |
                [[[
                  if (states['person.lilphoenix'].state =='not_home') { 
                  return `<ha-icon icon="mdi:home-export-outline"
                    style="width: 20px; height: 20px; color: '#888888';">
                    </ha-icon><span> Away</span>`;
                  } 
                  if (states['person.lilphoenix'].state =='home') { 
                  return `<ha-icon 
                    icon="mdi:home"
                    style="width: 20px; height: 20px; color: '#888888';">
                    </ha-icon><span> ${entity.state}</span>`;
                  } else {
                  return `<ha-icon 
                    icon="mdi:map-marker-radius"
                    style="width: 20px; height: 20px; color: '#888888';">
                    </ha-icon><span> ${entity.state}</span>`;
                  }
                ]]]
              proximity: |
                [[[
                  return `<ha-icon
                    icon="mdi:map-marker-distance"
                    style="width: 20px; height: 20px; color: >-
                      [[[ if (states['person.lilphoenix'].state =='Work') return
                      "deepskyblue"; if (states['person.lilphoenix'].state
                      =='not_home') return "#dedede"; if
                      (states['person.lilphoenix'].state =='Home') return
                      "#77c66e"]]];">
                    </ha-icon>  <span>\<span style="color: var(--text-color-sensor);">${states['sensor.home_oneplus_distance'].state} Kms</span></span>`
                ]]]
              battery: |
                [[[
                  if (states['sensor.oneplus_battery_state'].state =='charging') { 
                    return `<ha-icon
                    icon="mdi:battery-charging"
                    style="width: 20px; height: 20px; color: >-
                    [[[ if (states['person.lilphoenix'].state =='Work') return
                    "deepskyblue"; if (states['person.lilphoenix'].state
                    =='not_home') return "#dedede"; if
                    (states['person.lilphoenix'].state =='Home') return
                    "#77c66e"]]]">
                    </ha-icon> <span><span style="color: var(--text-color-sensor);">${states['sensor.oneplus_battery_level'].state}% battery</span></span>`;
                  } else {
                    return `<ha-icon
                    icon="mdi:battery"
                    style="width: 20px; height: 20px; color: >-
                    [[[ if (states['person.lilphoenix'].state =='Work') return
                    "deepskyblue"; if (states['person.lilphoenix'].state
                    =='not_home') return "#dedede"; if
                    (states['person.lilphoenix'].state =='Home') return
                    "#77c66e"]]]">
                    </ha-icon> <span><span style="color: var(--text-color-sensor);">${states['sensor.oneplus_battery_level'].state}% battery</span></span>`;
                  }
                ]]]
              wifi: |
                [[[
                  if (states['sensor.oneplus_wifi_connection'].state =='<not connected>') { 
                    return `<ha-icon
                    icon="mdi:wifi"
                    style="width: 20px; height: 20px; color: var(--text-wifi-color-sensor);">
                    </ha-icon> <span><span style="color: var(--text-wifi-color-sensor);">Disconnected</span></span>`; 
                  } else {
                    return `<ha-icon
                    icon="mdi:wifi"
                    style="width: 20px; height: 20px; color: #888888;">
                    </ha-icon> <span><span style="color: var(--text-color-sensor);">${states['sensor.oneplus_wifi_connection'].state}</span></span>`;
                  }
                ]]]
              alarm: |
                [[[
                  return `<ha-icon
                    icon="mdi:alarm"
                    style="width: 20px; height: 20px; color: >-
                    [[[ if (states['person.lilphoenix'].state =='Work') return
                    "deepskyblue"; if (states['person.lilphoenix'].state
                    =='not_home') return "#dedede"; if
                    (states['person.lilphoenix'].state =='Home') return
                    "#77c66e"]]]">
                    </ha-icon>  <span>\<span style="color: var(--text-color-sensor);">${states['sensor.oneplus_next_alarm'].state}</span></span>`
                ]]]
      - type: horizontal-stack
        cards:
          - type: horizontal-stack
            cards:
              - type: custom:button-card
                entity: person.flo
                aspect_ratio: 1/1
                name: Person
                show_entity_picture: true
                show_name: false
                hold_action:
                  action: none
                state:
                  - value: home
                    styles:
                      custom_fields:
                        icon:
                          - border-color: '#77c66e'
                  - value: not_home
                    styles:
                      card:
                        - background-color: '#dedede'
                      custom_fields:
                        icon:
                          - border-color: '#EF4F1A'
                  - value: Work
                    styles:
                      custom_fields:
                        icon:
                          - border-color: deepskyblue
                styles:
                  card:
                    - border-radius: 5%
                    - padding: 5%
                    - color: >-
                        [[[ if (states['person.flo'].state =='Work') return
                        "deepskyblue"; if (states['person.flo'].state
                        =='not_home') return "#dedede"; if
                        (states['person.flo'].state =='home') return
                        "#77c66e"]]]
                    - font-size: 10px
                    - text-shadow: 0px 0px 0px black
                    - text-transform: capitalize
                    - justify-self: end
                    - align-self: middle
                  grid:
                    - grid-template-areas: >-
                        "icon status" "n n" "battery proximity" "wifi alarm" "sd
                        sd"
                    - grid-template-columns: 2fr 1fr
                    - grid-template-rows: 1fr min-content min-content min-content min-content
                  name:
                    - font-size: 15px
                    - align-self: middle
                    - justify-self: start
                    - padding-bottom: 10px
                  custom_fields:
                    icon:
                      - clip-path: circle()
                      - width: 80%
                      - pointer-events: none
                      - display: grid
                      - border: 5px solid
                      - border-color: gray
                      - border-radius: 500px
                      - margin: 0 +10% 0 0
                      - justify-self: end
                      - opacity: 1
                    status:
                      - align-self: start
                      - justify-self: end
                      - color: >-
                          [[[ if (states['person.flo'].state =='Work') return
                          "deepskyblue"; if (states['person.flo'].state
                          =='not_home') return "#dedede"; if
                          (states['person.flo'].state =='Home') return
                          "#77c66e"]]]
                    proximity:
                      - padding: 0.5em 0px
                      - align-self: middle
                      - justify-self: start
                    alarm:
                      - padding: 0.5em 0px
                      - align-self: middle
                      - justify-self: start
                    wifi:
                      - padding: 0.5em 0px
                      - align-self: middle
                      - justify-self: start
                      - '--text-wifi-color-sensor': >-
                          [[[ if (states["sensor.iphone_de_flo_ssid"].state ==
                          '<Not Connected>') return "#aaaaaa"; ]]]
                    battery:
                      - padding: 0.5em 0px
                      - align-self: middle
                      - justify-self: start
                      - '--text-color-sensor': >-
                          [[[ if
                          (states["sensor.iphone_de_flo_battery_level"].state <
                          50) return "#EF4F1A"; ]]]
                custom_fields:
                  icon: >
                    [[[ return entity === undefined ? null : `<img
                    src="${states[entity.entity_id].attributes.entity_picture}"
                    width="100%">`; ]]]
                  status: |
                    [[[
                      if (states['person.flo'].state =='not_home') { 
                      return `<ha-icon icon="mdi:home-export-outline"
                        style="width: 20px; height: 20px; color: '#888888';">
                        </ha-icon><span> Away</span>`;
                      } 
                      if (states['person.flo'].state =='home') { 
                      return `<ha-icon 
                        icon="mdi:home"
                        style="width: 20px; height: 20px; color: '#888888';">
                        </ha-icon><span> ${entity.state}</span>`;
                      } else {
                      return `<ha-icon 
                        icon="mdi:map-marker-radius"
                        style="width: 20px; height: 20px; color: '#888888';">
                        </ha-icon><span> ${entity.state}</span>`;
                      }
                    ]]]
                  proximity: |
                    [[[
                      return `<ha-icon
                        icon="mdi:map-marker-distance"
                        style="width: 20px; height: 20px; color: >-
                          [[[ if (states['person.flo'].state =='Work') return
                          "deepskyblue"; if (states['person.flo'].state
                          =='not_home') return "#dedede"; if
                          (states['person.flo'].state =='home') return
                          "#77c66e"]]];">
                        </ha-icon>  <span>\<span style="color: var(--text-color-sensor);">${states['proximity.flo'].state} Kms</span></span>`
                    ]]]
                  battery: |
                    [[[
                      if (states['sensor.iphone_de_flo_battery_state'].state =='charging') { 
                        return `<ha-icon
                        icon="mdi:battery-charging"
                        style="width: 20px; height: 20px; color: >-
                        [[[ if (states['person.flo'].state =='Work') return
                        "deepskyblue"; if (states['person.flo'].state
                        =='not_home') return "#dedede"; if
                        (states['person.flo'].state =='home') return
                        "#77c66e"]]]">
                        </ha-icon> <span><span style="color: var(--text-color-sensor);">${states['sensor.iphone_de_flo_battery_level'].state}% battery</span></span>`;
                      } else {
                        return `<ha-icon
                        icon="mdi:battery"
                        style="width: 20px; height: 20px; color: >-
                        [[[ if (states['person.flo'].state =='Work') return
                        "deepskyblue"; if (states['person.flo'].state
                        =='not_home') return "#dedede"; if
                        (states['person.flo'].state =='Home') return
                        "#77c66e"]]]">
                        </ha-icon> <span><span style="color: var(--text-color-sensor);">${states['sensor.iphone_de_flo_battery_level'].state}% battery</span></span>`;
                      }
                    ]]]
                  wifi: |
                    [[[
                      if (states['sensor.iphone_de_flo_ssid'].state =='<Not Connected>') { 
                        return `<ha-icon
                        icon="mdi:wifi"
                        style="width: 20px; height: 20px; color: var(--text-wifi-color-sensor);">
                        </ha-icon> <span><span style="color: var(--text-wifi-color-sensor);">Disconnected</span></span>`; 
                      } else {
                        return `<ha-icon
                        icon="mdi:wifi"
                        style="width: 20px; height: 20px;">
                        </ha-icon> <span><span style="color: var(--text-color-sensor);">${states['sensor.iphone_de_flo_ssid'].state}</span></span>`;
                      }
                    ]]]
                  alarm: |
                    [[[
                      return `<ha-icon
                        icon="mdi:alarm"
                        style="width: 20px; height: 20px; color: >-
                        [[[ if (states['person.lilphoenix'].state =='Work') return
                        "deepskyblue"; if (states['person.lilphoenix'].state
                        =='not_home') return "#dedede"; if
                        (states['person.lilphoenix'].state =='Home') return
                        "#77c66e"]]]">
                        </ha-icon>  <span>\<span style="color: var(--text-color-sensor);">${states['sensor.oneplus_next_alarm'].state}</span></span>`
                    ]]]

Now, I wish next alarm indicator display like : Friday 24/04/26 6h15.

Also the second person card isn’t update to geolocated.

How do you remove the borders in the stack-in-card cards?
I tried with

keep:
  border: false

and with card_mod, but unsuccesfully…
Any help?

Could you share the variables you had used please? thanks.

Oh thanks.
But how so I use variables and what exactly do I need to extract to variables?