I am having a slight syntax issue. For the online status integration of Discord if someone is playing a game it shows the title of the game. If not it displays “null”. In that case I do not want to show the subtitle. Any idea of how the correct syntax might be?
- entity: sensor.extrem_****
name: Extrem
type: custom:multiple-entity-row
secondary_info:
attribute: game
well, i’ve never used that custom card. I assumed you knew how to use it. But according to the docs, that card doesn’t support templates. So your only option is:
- entity: sensor.extrem_****
name: Extrem
type: custom:multiple-entity-row
secondary_info:
attribute: game
I am looking at this picture:
and I wonder why to use multiple-entity-row since you are showing ONE state.
Use secondaryinfo-entity-row or template-entity-row instead, both of them support templates for secondary_info.
Also, if using multiple-entity-row is critical for you then use this method for secondary_info (works with stock entity rows as well).
- entity: sensor.extrem_****
name: extrem
type: custom:secondaryinfo-entity-row
secondary_info: >
{% set game = state_attr('sensor.extrem_****', 'game') %}
{{ game if game is not none else ' ' }}
Had to install “secondaryinfo-entity-row” and “card-tools” via HACS.
Is there a way in the language to reference to the initial entity? So I do not have to copy paste every time. Something like this:
- entity: sensor.extrem_****
name: extrem
type: custom:secondaryinfo-entity-row
secondary_info: >
{% set game = state_attr('sensor.self', 'game') %}
{{ game if game is not none else ' ' }}