if the issue would lie with displaying a timer (sorry I dont have one to test, but will do so later on), you could maybe go around that more easily (than modding all sorts of unnecessary stuff) by creating a template sensor on the attribute of the timer and add it to the button like I just did here
edit
confessing I cant make it happen either using my proposed techniques, sorry bout that. As it stands the attributes isnt even updated in the state machine and a regular jinja template cant make that happen either.
its probably in internal timer and I do have a script somewhere using that, but have to find that…
btw start reading here Display remaining seconds of timer in frontend - #46 by 123 where all of this has been discussed, sorry I hadnt looked that up earlier
to give you an idea to work with, showing the time left in seconds, so you would only need to format that to your liking (and make it use the timer setting, instead of my hard coded way now)
I have the entity on living area lights so I use the popup for hold_action to manage hue lights. But with the tap I am toggling the office light via KNX.
The problem is that I would like to display the state of the office_light and also change the background on the card. With my code the background is always #f0c209, no matter if office_light is on or off.
This is a Jinja template and can not be used in the button card …
You should really read up on the difference.
It could be a template sensor though.
However, as I have displayed the last button, you should really do that. The master (Romrider) suggest that as way to go for templates, easy as can be.
If must you can embed it in another card and position it to the spot you want
Yeah, I’ve created a template named sensor.sensore_timer_scaldabagno (it work)
If I put it on my button_card code the custom_field become [object] as you can see below:
from now, if you change code, please only post the changed code ? unless you got a complete new config ofc… btw, your error here is you’re missing the .state in the template.
Anyways, as I posted above, you should embed the button-card with entity timer in your other button-card. Dixit button-card Author/Magician
this is a bit more fledged out, with adequate services:
suffices for that. But, above was asked to have that show in a notification field. At first I hadnt realized timer entity uses the internal clocking and can not be shown by its attribute.
Embedding a button-card makes it all happen, no secondary helpers needed.
Sorry but that must be a config mistake. The button card embed is using its own entity, so you can use any thing on the main button. Or nothing for that matter
been meaning to ask for sometime but forgot:
Chrome seems to behave differently from Safari in many ways, and this is a bad one…
using a (decluttering) card config like:
- type: custom:button-card
confirmation:
text: >
Open cover at 'My' position?
entity: '[[command]]_my'
Is there anything we can do as user to hide that/make it show like Safari? If not would this warrant an issue in the repo…?So you can fix it resource side?
Anyone know if its even possible to use strptime inside this button. As soon as I add that, the whole button disappears, so I’m assuming it isn’t.
edit: I managed to resolve this by creating a template sensor, and then referencing that inside the button. Is there a way to do whole thing inside the button?
The button-card uses javascript, not jinja2 (strptime is a jinja2/python function). So you’ll have to write javascript to make it work directly in the button-card.
While I’m here, I have a problem that I don’t think is related specifically to this comp, but figured I’d ask you guys anyway…
I cast a Lovelace view loaded with these custom buttons to a Google Hub. Since sometime last month, that has errored out with the following message:
‘custom element doesn’t exist: button-card’
This Lovelace view works fine on desktop/mobile, but fails on the Google Hub. One fix that worked up until last month was to delete the HACS entry in Resources and replace it with a direct link to ‘/local/community/button-card/button-card.js’. But that doesn’t work anymore.
I opened an issue on Github for the Cast integration, but it got moved to core, where I’m assuming it will die. Do you guys have any ideas?
edit: This is resolved. Turns out that I had forgotten that I was also using card-mod, which needed to be pointed at /local/. Do any of you have a better grasp on this stuff and can maybe suggest who would fix this? Apologies for being offtopic…
Has something changed with transition effect? Since a few updates ago (I think 2021.12) this doesn’t work anymore. I haven’t changed anything in my code or setup but the transition suddenly is gone. I used this: transition: all 0.5s ease when a entity changed between states, which applied filter: grayscale(100%) blur(17px) in a transition.
and most other fields I tested.
Is there a reason I can not set it on border-color? Ofc I tried a fixed color in the button-card template, to see if it is placed correctly, and that too works just as expected.
there’s no conflict in the other templates.
please help me out? thanks
update
fix it. turns out if one doesnt add border-style nothing shows… and as I replaced shorthand border: 2px solid red to use the template, and thus individual keys for the border properties, I had lost that…