Develop and rebuild template sensor to python_script

you mean the card_mod style doesn’t work? If not we have to find out how to get it to work (again), style the fold_entity_row header…it did before… see: How to style the fold-entity-row head? - #9 by Mariusthvdb

about the alignment: as said, in my case, all is well (aligned to the left side of the top thumbs, except for the header alignement, which is shifted too far to the right:

yours are all shifted right :wink:

btw, I’ve taken the card out of the top entities card, which allows for one less card_mod too:

type: custom:hui-element
card_type: entities
title: Unavailable Unknown None
show_header_toggle: false
style: |
  ha-card {
    box-shadow: none;
  }
  .card-header {color: var(--primary-color);font-weight: bold;}
 # .:
 # "#states > div:nth-child(n+1) > fold-entity-row":
 #   $:
 #    "#head > entity-row-maker > hui-section-row":
 #      $: |
 #        div.divider {
 #          height: 0px;
 #        }
 #        div.label {
 #          font-weight: bold;
 #        }
entities:
  - sensor.uun_ordered
  - entity: script.update_entities_uun
    secondary_info: last-triggered
    action_name: Update

alignment is solved, it was as easy as adding padding: 0 to the top fold… how I could have missed that. Had to adjust the other styles for the left side shift to -8px because of that:

  - type: custom:fold-entity-row
    head:
      type: section
      label: Details
    padding: 0
    entities:
      - type: custom:fold-entity-row
        head:
          type: section
          label: Unknown entities
        padding: 0
        entities:
          - type: custom:hui-markdown-card
            style: |
              ha-card {
                box-shadow: none;
                margin: -16px -16px -16px -8px;
              }
            content: |
              Count: {{state_attr('sensor.uun_ordered','unknown_count')}}
              {{state_attr('sensor.uun_ordered','unknown_entities')}}

for all folds. and makes it looks perfect:

only thing left is to style the fold heads, can’t stand this is so difficult to find out…

1 Like

Hi Marius,

Would you happen to have this issue as well? Each time I open a new HA instance or that I refresh, I’m getting this…

Refreshing 2-3 times, sometimes needs to clear cache (Ctrl+F5), but it eventually comes back to working good

That’s an old issue indeed. From the top of my head you can solve that using the hui-element custom card by Thomas loven and then add the markdown card in that

1 Like

Explanation:

You can also use the card-preloader to fix this.

1 Like

You were right… Here’s for posterity

Use this

- type: custom:hui-element
  card_type: markdown

Instead of:

- type: custom:hui-markdown-card

Thanks :slight_smile:

card-preloaded caused issues still, or maybe put differently, didnt solve it all.
added to that is seemed to do so in a ‘hacky’ way, and not always, seemed a bit flaky. While hue-element solved all red cards, never seen a red card since using that. And so easy.

see this post from Thomas why probably: https://github.com/home-assistant/frontend/issues/4984#issuecomment-610781709