[Bug]: Template not rendering in template card
See original GitHub issueCurrent Behavior
The template doesn’t consistently render. It usually just shows the template text itself.
Expected Behavior
The template renders to show 0 guest devices connected
, 1 guest device connected
or X guest devices connected
.
Steps To Reproduce
type: custom:mushroom-template-card
primary: guest_ssid
secondary: >-
password
{% set dev_count = states.device_tracker | selectattr('state', 'eq', 'home') |
selectattr('attributes.essid', 'eq', "guest_ssid") | list | count %}{% if
dev_count == 1 %}{{dev_count}} guest device connected{% else %}{{dev_count}}
guest devices connected{% endif %}
icon: mdi:wifi-lock
multiline_secondary: true
- Set up a template card using this YAML (YAML not necessary, just easier to share).
Environment
- OS: macOS 12.3.1
- Browser: Safari 15.4 / Home Assistant Companion App for macOS / Chrome 102.0.5005.61
- Version: v1.9.0 (HACS)
- Hassio: 2022.6.3
- Template attributes from: UniFi Network
It doesn’t really matter what I use. Not been able to find a match between when it does render and when it doesn’t though.
Anything else?
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
[Templating] Adaptive Card is not rendering, when binded ...
Platform Template engine, all platforms Is your feature request related to a problem? Please describe. If the data is not binded to ...
Read more >Solved: Adaptive card not rendering in teams
Hey folks, I have an issue where the post of an adaptive cards (approval) into Teams isn't rendering properly -- it's just posting...
Read more >Django Template not rendering - python - Stack Overflow
I am trying to load a list of objects from a MySQL database using Django templates. I can load the objects ...
Read more >LWC Not Rendering in Record Page, No Error Appears
I'm trying to build a Google Maps LWC to show the location of an Account on the Account's record page. However, the component...
Read more >LWC component not rendering - Salesforce Stack Exchange
I've confirmed the apex works by running it in the dev console. Here is the code: Apex public without sharing class postController {...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
~Just to close the loop, this is the cursed thing I’ve had to produce to make sure it works 😂~
It did not work…
Lol nor am I unfortunately. I think it’s because
device_tracker
doesn’t exclusively cover the UniFi entities so it might be something about whether it comes across a UniFi entity first or not. Will have a play!Cheers and sorry again 😊