your hold_action criteria was not indented enough. your service_data for tap and hold was not indented enough and your type was indented too much and under the tap_action's options
This templateable card is better at changing elements of a card. Not making the whole thing disappear (not saying it canāt be done, Iām just not sure how).
What you could do is create a template binary sensor that is on if sensor.wheretraina is either of the states you posted. Then use that binary sensor in your conditional card.
Is there any way to get the last updated time of a sensor into this card?
Well, yes, I know you can but I want it in local time not UTC.
Is that possible?
Currently my best effort is:
card:
type: custom:hui-entities-card
title: "${'-- Trains from My Station (at ' + (states['sensor.next_train_to_stn'].last_updated).substr(11, 5) + ') --'}"
building on Auto-entities: template lightning strikes of last hour? where I try to have the wwlln sourced lighting strikes in a card, I (think I have to) turn to the templater card to even have a chance of getting where I wantā¦
Id love to have a Map, showing the strikes of the last hour, and since that seems not to be possible yet, (need a nifty template for that I havent yet been able to construct), I want to show the strikes within a radius of 50 km. Which is easier, because the state.state of the strikes is their distance in km.
so, Id hope the templater card do do something like
Your card creates a lot of ārender_templateā and event websocket API requests, and by a lot I mean up to 4000 times in just a few seconds. This results in HA slowing down and/or crashing the UI due to exceeding the max number of pending http messages.
So if anyone sees something along the lines of
ā[homeassistant.components.websocket_api.http.connection] Client exceeded max pending messages [2]: 512ā, this card may be the cause of it. However, this isnāt the only one that could cause this. Anything that creates to many http requests could.
Canāt really say where exactly the problem lies, but I can confirm that those http requests are being made from your card. Removing it, removes those requests.
I activated the websocket debug logs, which confirmed those requests were coming from your card as well.
logger:
default: info
logs:
homeassistant.components.websocket_api: debug
Saying you removed my card doesnāt really mean it was my card. There are cards defined within. Off the top of my head for things I know that use the backend render are card-mod and the markdown card
Removing it may not necessarily mean itās your card, yea, but along with all the other pointers thereās almost no other possibility. Yes, card-mod and markdown card both do that, and both will cause the exact same problem if they create too many requests which can happen if you use the āstyleā option from card-mod on too many cards. Unfortunately, I no longer have the configuration I was using while this was occurring as I was forced to remove it. Itās possible that it was conflicting with card-mod which resulted in this happening.
I hope this didnt feel too personal. I just thought it was important to report this as there are a lot of integrations/plugins that unintentionally contribute to this problem without knowing. The result is a very slow running HA.
My guess would be that you didnāt restrict the config-template-card entities, which means it updates on every event and as you had it coupled with card-mod it was evaluating a lot of templates on the backend. The entities option should almost always be set, I really canāt think of a good reason that you wouldnāt and maybe it should just be required