if the matching fails, it can be 2 things:
either you have a syntax error, or the state simply isn’t correct, or existing.
below the modes bit, you can see the card working correctly and also the markdown code to be alright.
you’d have to try for each of the evaluated entities what is wrong.
take [[ sensor.hubs_badge.attributes.desc ]], and try it in the dev-state {{states.sensor.hubs_badge.attributes.desc }} and see what gives. etc for all the other failing items.
btw, I now see I copied 1 line of apple_badge extra, take that out, Ive edited my post above accordingly.
secondly, the google-yellow turns out brown in my card, as it does in yours I see now, so we need to change that again.
I made the attributes.love to be used for this card, so you don’t have these yet, but here you go:
small edits in the lovelace card (color yellow and dashes before the entities) Color google-yellow shows brown…? the rbb values I tried either showed blue or green, so I takeout rgb isn’t supported, but the hex notation works out as the original
- type: custom:useful-markdown-card
content: >
[[ sensor.summary.attributes.text ]]
- type: custom:useful-markdown-card
content: >
# <font color= grey>Home Summary</font>
___
**Status**
<font color= green> - [[ sensor.home_badge.attributes.desc ]] </font>
<font color= green> - [[ sensor.hubs_badge.attributes.desc ]] </font>
<font color= grey> - [[ sensor.play_badge.attributes.desc ]] </font>
<font color= blue> - [[ sensor.track_badge.attributes.desc ]] </font>
<font color= #fbb911 > - [[ sensor.lamps_badge.attributes.desc ]] </font>
<font color= blue> - [[ sensor.switch_badge.attributes.desc ]] </font>
<font color= blue> - [[ sensor.appli_badge.attributes.desc ]] </font>
<font color= green> - [[ sensor.active_badge.attributes.desc ]] </font>
<font color= green> - [[ sensor.appli_badge.attributes.desc ]] </font>
___
**Settings**
<font color= green> - [[ sensor.alarms_badge.attributes.love ]] </font>
___
**Modes**
<font color= brown> - [[ sensor.activity_badge.attributes.love ]] </font>
**<font color= black> - [[ sensor.mode_badge.attributes.love ]] </font>**
the relevant section in the python_script.summary
##########################################################################################
# Alarm clock
# /config/packages/package_alarmclock.yaml
##########################################################################################
alarms_prefix = ['alarmclock_wd', 'alarmclock_we']
alarms_wfilter = [range(1,6), range(6,8)]
alarms_desc = ''
mydict = {'hidden':hidden}
for entity_id, filter in zip(alarms_prefix, alarms_wfilter):
state = hass.states.get('input_boolean.{}_enabled'.format(entity_id))
if state:
if state.state is 'on' and datetime.datetime.now().isoweekday() in filter:
state = hass.states.get('sensor.{}_time_template'.format(entity_id))
alarms_desc = '{}{}, '.format(alarms_desc, state.state)
if (alarms_desc == ''):
mydict['entity_picture'] = '/local/badges/alarm_off.png'
mydict['friendly_name'] = 'Relax'
mydict['unit_of_measurement'] = 'Off'
mydict['theme'] = 'grey_badge'
mydict['love'] = 'Alarm clock is not set, relax'
alarms_desc = '%- Alarm clock is not set, relax'
else:
mydict['entity_picture'] = '/local/badges/alarm.png'
mydict['friendly_name'] = alarms_desc[:-2]
mydict['unit_of_measurement'] = 'On'
mydict['theme'] = 'orange_badge'
mydict['love'] = 'Alarm clock set at ' + alarms_desc[:-2]
alarms_desc = '/- Alarm clock set at ' + alarms_desc[:-2]
hass.states.set('sensor.alarms_badge', '', mydict)
##########################################################################################
# Mode:
# /config/packages/package_mode_selection
# Badges images: /config/www/modes
##########################################################################################
mode_desc = ''
## Get Mode description
state = hass.states.get('input_select.mode')
if state:
dt = state.last_changed + datetime.timedelta(hours= timeDifference)
time = '%02d:%02d' % (dt.hour, dt.minute)
mode_desc = '{}*- {} mode selected at: {}\n'.format(summary, state.state, time)
mode_desc_love = '{} {} mode selected at: {}\n'.format(summary, state.state, time)
hass.states.set('sensor.mode_badge',state.state, {
'entity_picture': '/local/modes/{''}.png'.format(state.state.replace(' ','').lower()),
'friendly_name': time,
'unit_of_measurement': 'Mode',
'love': mode_desc_love
})
##########################################################################################
# Activity:
# /config/packages/package_activity_selection
# Badges images: /config/www/activities
##########################################################################################
activity_desc = ''
## Get Activity description
state = hass.states.get('input_select.activity')
if state:
dt = state.last_changed + datetime.timedelta(hours= timeDifference)
time = '%02d:%02d' % (dt.hour, dt.minute)
activity_desc = '{}$- {} activity selected at: {}\n'.format(summary, state.state, time)
activity_desc_love = '{} {} activity selected at: {}\n'.format(summary, state.state, time)
ext = 'gif' if state.state in ['Gaming','Naar bed'] else 'png'
hass.states.set('sensor.activity_badge', state.state, {
'friendly_name': time,
'entity_picture': '/local/activities/{' '}.{}'.format(state.state.replace(' ','').lower(),ext),
'unit_of_measurement': 'Act',
'love': activity_desc_love
})