in the operator: template, you write a template to return True. In which case everything that follows will be set.
So, if you want that to be ‘Nothing’ use that in your template.
- operator: template
id: state-on #needed if you want to merge states in your template and the button config
value: >
[[[ return entity.state == 'Nothing'; ]]]
spin: true
I think I solved it:
When ‘Nothing’ is the state the operator default will use on the button.
When I change state via develop tool to other then ‘Nothing’ the styles card is showing!
I’m trying to use an SVG as entity_picture. However, unlike, e.g. custom_fields the entity picture does not accept HTML, so the following as a template doesn’t work:
Is there any way to use an SVG for entity_picture (not just loading it from the filesystem), so that I can manipulate it depending on state? Or would I have to work around this by using a custom_element?
It would be awesome to have a generic companion card to button_card that only lives on github as a template. Idea would be that it takes a button_card configuration as a blueprint-type input and then can be made available via HACS as a new card based on button_card. Essentially, it would inject a template into the lovelace yaml so that with a few lines of code you could use such a card in the frontend.
There are so many awesome card configurations here in this forum. It would be great to have an easier way to unlock these for less savvy users.
Which graph/chart do you use in the right top corner of your button card? I’d love to use that to indicate the brigthness % of my lights but I can’t find how to do this. Could you share your config?
i am looking to make a card like this for my esxi but i am not sure how to proceed , as per the sample code on github only one entity is defined but how come cpu ,ram ,storage all coming inside one card ,
i know it has something to do with template but not sure how exactly they work, even i read the docs but i didn’t understand properly .
do you think my below template format will work ? if so i can i bring all values in same card .
Please guide in right direction to create the card .
If you want the icons to change their color if a specified value is exceeded, you have to add another styling rule to each element above:
- --text-color-sensor: '[[[ if (states["sensor.raspi_cpu"].state > 80) return "red"; ]]]'
or in total (example cpu):
cpu:
- padding-bottom: 2px
- align-self: middle
- justify-self: start
- --text-color-sensor: '[[[ if (states["sensor.raspi_cpu"].state > 80) return "red"; ]]]'
### End Of Styling Section ###
Now the sensors come into play using HTML / Javascript (note backticks).
You assign them to the individual custom fields in the following ˋcustom_fields:ˋ section (note intendation).
Argh, sorry. Out of all things, I didn’t pay attention to the sensor format. I’m using the code above in my phone card. Please compare or post your own.
I’ve been breaking my head now for a while without success, and so I reach out. I don’t have power information for all ACs. In the case I leave it blanc, the card doesn’t show which obviously not the desired effect.
If some code can be improved, please don’t hesitate.