You can have the buttons call the MQTT service in the on tap action and then have something listen for the correct messages. I do all my logic in node red so i have node red listen for some mqtt actions. This is how I do the dim lights button below where it sends a message to mqtt and node red listens and dims some lights and turns some off.
I would like to have a card like yours for my fan/light. Right now I have the below setup but yours is much more compact.
If you want something that works right now, pop over to the fan-control-entity-row page and setup the custom card. This card works well is the inspiration behind my attempt to recreate it using button-card.
If you’d rather work from my incomplete configuration, here it is. As of now, the fan speed, on/off button and the button coloring are either incomplete. don’t work, or both. Also, don’t forget to change my entity ids to your own.
I offer this purely as a courtesy. As I said, this only partially works in my environment. I may abandon my efforts since it appears that to do this properly, I may have to learn Jinja 2 which may be outside of my capacity to do at this point. Good luck!
I think I’m attempting to do something unorthodox. I’m trying to check for the value in speed_list, an attribute of a fan entity and then apply coloring to the appropriate Low, Medium, High button. The snippet below would appear once in each card with the value low/medium/high where appropriate.
Am I doing this right? (Syntax adopted from a previous Mariusthvdb example.)
EDIT: After reading through the States section under Templating, I suspect I should be using return state_attr instead of return state but can’t seem to get that working either.
Way out of my league here, So might misunderstand. But I’m not in YAML mode and are using the templates. Not by !including but by adding the template code using the “Raw editor”.
Right, so if that’s possible, it’s good (I never used storage mode and thought you couldn’t edit the “yaml” directly)
I’ll edit my post, thanks for pointing it out.
The results, however, are puzzling. My desired text effects are not applying. I’ve confirmed that the above statement does indeed return true when I set the fan speed to low. I suspect there is a conflict somewhere between my button template and the card but I can’t see it.
Yes of course
so for question number 1:
i want that the 3rd light have always the same size as 1 and 2
i want to reduce the image size
then i want to apply question 2 in all cards so that for example on card 2 i have:
IMAGE
STATE OF THE IMAGE “SALA DE JANTAR” WITH FULL ROW IN COLOR RELATED TO STATE
I had to change some default styles to support aspect ratio and icon auto-resizing, this might break some of your custom styles. Hopefully not too much. Feel free to request some help on the forum.
Deprecate style. Same result with:
before:
style:
- font-size: 10px
after:
styles:
card:
- font-size: 10px
NEW FEATURES
You can now merge states together by id when using templates. The states you want to merge have to have the same id. This id parameter is new and can be anything (string, number, …). States without id will still be appended. Styles embedded in a state are merged together as usual. Fixes #165
Icon will auto adapt to the height of the card and not only to it’s width. This will enable you to skip using size: xx% when you defined the width, height or aspect-ratio of a card.
You can now define an aspect ratio for your cards using aspect_ratio in the main config, and the card will adapt to all of your screen size. This will enable you to skip setting the width and the height of a card to make it square for example.
New option to ignore the light temperature (Fixes #153): color: auto-no-temperature
name_template and entity_picture_template. Also available per state (because why not). For both, the javascript code needs to return a string. Fixes #162
color: auto-no-temperature: This will have the same effect as color: auto but will ignore your light temperature.
When action: more-info, you can now define also an entity other than the one assigned to the card (Fixes #163):