Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 110298

Colours Needed in Markdown Cards (but Separators Sorted)

$
0
0

Okay, following some much needed help : -

I got into markdown and attributes - Many Thanks

I went back to my monitoring Heat On Times (HOT)
I found that the markdown could display the same information (minus the state indicative icons) as entities card but in just less than half the height
Using Attributes I could drop that by another two thirds
Inserting muliple ‘||||’ lines gives separators : -
But readabilty could be further improved by using colours


Less than half the height of entities card

      - type: markdown
        title: HOT History - Day
        content: |
          |{{'<b>Item&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'}}|{{'&nbsp;&nbsp;-&nbsp;&nbsp;'}}|{{'Value&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>'}}
          |----:|:----:|----:|
          ||||
          |{{'<b>' ~ state_attr('sensor.s_hot_heat_status', 'friendly_name') | replace('HOT ', '') ~ '</b>'}}|{{'-'}}|{{ states('sensor.hot_heat_status')}}|
          |{{'<b>Last ON / OFF</b>' }}|{{'-'}}|{{ as_timestamp(states('input_datetime.hot_last_on')) | timestamp_custom('%H:%M', false) }}{{'&nbsp; - &nbsp;'}}{{ as_timestamp(states('input_datetime.hot_last_off')) | timestamp_custom('%H:%M', false)}}|
          |{{'<b>Last ON Duration</b>' }}|{{'-'}}|{{ states('sensor.heat_last_on_duration') ~ ' h:m'}}|
          |{{'<b>So Far Today</b>' }}|{{'-'}}|{{ states('sensor.hot_day_sofar_h') ~ ' h:m'}}|
          |{{'<b>So Far Today</b>' }}|{{'-'}}|{{ states('sensor.hot_day_sofar_p') ~ ' % on'}}|
          ||||
          ||||
          {% for item in states.sensor | selectattr('object_id', 'match', 'hot_dy_tot_h') -%}
          |{{'<b>' ~ item.name | replace('HOT ', '') ~ '</b>' }}|{{'-'}}|{{item.state_with_unit}}|
          {% endfor -%}
          ||||
          ||||
          {% for item in states.sensor | selectattr('object_id', 'match', 'hot_dy_tot_p') -%}
          |{{'<b>' ~ item.name | replace('HOT ', '') ~ '</b>'}}|{{'-'}}|{{('%.2f' | format(item.state | float(0))) ~ ' % on'}}|
          {% endfor %}

Code for Above

AND -


Is about 1/6th the height and MUCH easier to compare values

      - type: markdown
        title: HOT History - Month
        content: |
          |{{'<b>Item'}}|{{'&nbsp;&nbsp;-&nbsp;'}}|{{'&nbsp;&nbsp;% Yr-0'}}|{{'&nbsp;&nbsp;% Yr-1'}}|{{'&nbsp;&nbsp;% Yr-2</b>'}}|
          |----:|:----:|----:|----:|----:|
          ||||||
          ||||||
          |{{'<b>Rng This Mnth</b>'}}|{{'-'}}|{{states('sensor.hot_mth_0_sofar')}}|||
          ||||||
          ||||||
          {% for item in states.sensor | selectattr('object_id', 'match', 'hot_mth_y0_tot_') -%}
          |{{'<b>' ~ (item.name | replace('HOT ', '') | replace(' This Year', '')) ~ '</b>'}}|{{'-'}}|{{'%.2f' | format(item.state | float(0)) }}|{{'%.2f' | format(item.attributes.yr_1 | float(0))}}|{{'%.2f' | format(item.attributes.yr_2 | float(0))}}|
          {% endfor %}

Code for Above

I’ve looked at many posts for markdown colour but none seem to work (has something changed ?)
posts checked : -

(not sure how (the one above) this would help anyway, as I’d need to apply to single cells)

Do I need to use a custom card or is a mod/development on the way ?
Cheers

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 110298

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>