First of all it seems that my ChromeCast when playing looks like it is off? Since the state isn’t “ON”, but instead PLAYING it might appear as “OFF”? Just a guess.
I probably need to add support for custom states eventually. For now you’re correct, it’s based on on and off
Also my amplifier looks correct when OFF, but when ON the icon disappears? I double-checked the state and it is ON. The amplifier is supposed to appear in the top right square.
You set the color to white => color: rgb(255, 255, 255)
So when the entity is on, the color of the icon becomes white, and since your background is also white, you can’t see it. But I would bet it’s there.
You set the color to white => color: rgb(255, 255, 255)
So when the entity is on, the color of the icon becomes white, and since your background is also white, you can’t see it. But I would bet it’s there.
Sorry to bug you again @kuuji . Any thoughs on the above? It would really help with some advanced automating and allow for some pretty cool stuff. It’s basically the only thing stopping me from moving over from the old Custom UI Cards.
Great work Kuuji,
I implemented your ideal in my living room automations but i have problem viewing it from my cellphone app.
the icons doesn’t have enough space to show up so they get cut:
@kuuji works correctly on chrome. Both Fully Kiosk and Wallpanel don’t seem to render the card correctly. Do you or anyone else know how to possibly fix this issue? I tried installing android web view from the google play store but it doesn’t appear to do anything.
There is one other thing I can’t get to work, and that was done with style_template in Custom UI. I can make it change button style based on the state of the entity it is related to, but I can’t find a way to specify some other unrelated entity.
This is an example from Custom UI and how it worked there:
Is it possible to use a attribute as an entity? My ecobee will show as auto all the time whether its on or off but the operation attr will show idle,cool or heat.
Thanks for all the hard work, this is working well for quickly building remotes for my home theater system. I have 2 suggestions that would make this perfect. I’m not sure of the limitations of the platform, so it’s possible that these are not possible, but it’s worth a shot.
Allow the event to be fired on a mouse or finger down event instead of a click. I think this would make navigating menus feel a lot more responsive.
Allow the service to be repeated after a short delay while held down in the same way holding a key on a remote would (For volume control, menu control, etc)
After reading through all the documentation again I figured out where the error is:
Where the tutorial in the beginning of this thread indicates “Include the card code in your `ui-lovelace-card.yaml” it actually should write “Include the card code in your ui-lovelace.yaml”
A small and subtle difference, but by including the code in ui-lovelace.yaml I managed to get it to work
I’ve got the same error as Torbenan, with same config…
I have this error in the log: 2018-09-17 20:16:31 ERROR (MainThread) [frontend.js.latest.201809030] https://home.merklen.fr/local/custom_ui/button-card.js:1:8 Uncaught SyntaxError: Unexpected token {
Thanks a million for this, it’s my main light switch board now
One question I have: how do I get it working when my internet is down? There was a storm here today, and my internet was out for the morning and the button-cards were the red blocks instead.
I guess it’s from the import:
import {
LitElement, html,
} from 'https://unpkg.com/@polymer/lit-element@^0.5.2/lit-element.js?module';
What workaround could I use for this?
Many thanks again! I wouldn’t have my HA set-up without it
Thanks for sharing this @kuuji Happened to me as well, couldn’t get it to work, any solution to it ?
I’ve placed the custom card in its correct place and I’ve been using other lovelace custom cards with success
I also wanted this so I just added ${state.attributes.unit_of_measurement} in the <div> after ${state.state}. Would be nice to have it as a config value in the main card.