Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Secondary information not rendered in Template Card #1410

Open
3 tasks done
lavinir opened this issue Apr 18, 2024 · 1 comment
Open
3 tasks done

[Bug]: Secondary information not rendered in Template Card #1410

lavinir opened this issue Apr 18, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@lavinir
Copy link

lavinir commented Apr 18, 2024

Requirements

  • I checked the troubleshooting section in the README to verify that I have the latest Mushroom version.
  • I did a search to see if there is a similar issue or if a pull request is open.
  • I have read the state of card mod support (in pin issues) and understand card mod support is not provided in this repository.

Current Behavior

I'm trying to get the template card to show a list of the open windows. I wrote a template and tested it in the Dev Tools which is showing the proper output. However when inserting the template into the card I get empty output and nothing is rendered.

Expected Behavior

The template output should be rendered in the card

Steps To Reproduce

  1. Create template card
  2. Paste in YAML in the context below (assumes you have at least one binary sensor of class 'window' which is open

Context

type: conditional
conditions:
  - condition: state
    entity: binary_sensor.all_windows
    state: 'on'
card:
  type: custom:mushroom-template-card
  primary: There are open windows
  secondary: >-
    {% for state in states.binary_sensor if state.attributes.device_class ==
    'window' and state.state == 'on' %} {{ state.name }} {% endfor %}
  icon: mdi:window-open
  icon_color: '#FF9900'
  multiline_secondary: true


### Environment

```markdown
- Browser: Brave
- HA Version: 2024.4.3
- Mushroom:3.5.4

Anything else?

No response

@lavinir lavinir added the bug Something isn't working label Apr 18, 2024
@hunterdrayman
Copy link

I am getting this also. I know that the state is 'None' and I see that the icon colour is set as expected but the Secondary info is blank. Also, Putting the state in the Primary info works fine.

type: custom:mushroom-template-card
primary: |-
  {% if states(entity) == 'None' %}
    No radiators need heat at the moment
  {% else %}
    Radiators needing heat
  {% endif %}
secondary: '{{ states(entity) }}'
icon: mdi:radiator
entity: input_text.radiators_needing_heat
fill_container: false
multiline_secondary: true
tap_action:
  action: none
hold_action:
  action: none
double_tap_action:
  action: none
layout: horizontal
icon_color: |-
  {% if states(entity) == 'None' %}
    black
  {% else %}
    red
  {% endif %}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants