#Custom Button Card custom_fields

1 messages · Page 1 of 1 (latest)

mint lance
#

You just create a custom_field with whichever card you want to add 🙂

floral axle
#

ok, so the first one is "main", then next one is costom field. notet 🙂

mint lance
#
custom_fields:
  graph:
    card:
      type: custom:mini-graph-card
      entities:
        - entity: sensor.aqara_weather_ute_temperatur
          name: Temperature
          color: '#ff8c00'
        - entity: sensor.aqara_weather_ute_luftfuktighet
          name: Humidity
          color: '#3399ff'
          y_axis: secondary
      height: 50
      hours_to_show: 24
      line_width: 3
      font_size: 50
      animate: true
      show:
        name: false
        icon: false
        state: false
        legend: false
        fill: fade
#

then you can style this in the button card, instead of using card_mod.

styles:
  custom_fields:
    graph:
      - your styles
floral axle
#

now i get it inside the same card 🙂 looks like crap atm, but i will try to style 🙂

#

type: custom:button-card name: > [[[ return states['sensor.dag1'].state + ", " + states['sensor.dato2'].state]]] label: > [[[ return new Date().toLocaleTimeString('en-US', { hour12: false, hour: '2-digit', minute: '2-digit' }) ]]] show_label: true styles: card: name: - justify-self: start - font-size: 14px label: - justify-self: start - font-size: 35px - font-weight: 500 graph: - position: absolute - bottom: 0px - width: 100% - margin: 0 - opacity: 1 - overflow: hidden - z-index: 1 custom_fields: graph: card: type: custom:mini-graph-card entities: - entity: sensor.aqara_weather_ute_temperatur name: Temperature color: '#ff8c00' - entity: sensor.aqara_weather_ute_luftfuktighet name: Humidity color: '#3399ff' y_axis: secondary height: 50 hours_to_show: 24 line_width: 3 font_size: 50 animate: true show: name: false icon: false state: false legend: false fill: fade

#

lol i failed on the `` part 😛

#

I honnastly belive my brain is stuck in the old way. i will have to research a bit more 🙂 thanks buddy! i be back and try agian a bit later

mint lance
#

yuo forgot custom_fields in your styles, insert that above chart and you should see some improvements 🙂

#
type: custom:button-card
name: Name
label: Label
show_label: true
styles:
  grid:
    - grid-temaplate-areas: '"n" "l"'
    - row-gap: 8px
  card:
  name:
    - justify-self: start
    - font-size: 14px
    - padding-left: 1rem
    - z-index: 2
  label:
    - justify-self: start
    - font-size: 35px
    - font-weight: 500
    - padding-left: 1rem
    - z-index: 2
  custom_fields:
    graph: 
      - position: absolute
      - bottom: 0px
      - width: 100%
      - margin: 0
      - opacity: 1
      - overflow: hidden
      - z-index: 1
custom_fields:
  graph:
    card:
      type: custom:mini-graph-card
      entities:
        - entity: sensor.aqara_weather_ute_temperatur
          name: Temperature
          color: '#ff8c00'
        - entity: sensor.aqara_weather_ute_luftfuktighet
          name: Humidity
          color: '#3399ff'
          y_axis: secondary
      height: 50
      hours_to_show: 24
      line_width: 3
      font_size: 50
      animate: true
      show:
        name: false
        icon: false
        state: false
        legend: false
        fill: fade
```
floral axle
#

oh you are right!

#

can i now make a custom_field2: style for the right entities?
Weather info and such?

mint lance
#

yes, if you need to add more things to your card that won't fit in name, label, state or icon, you create another custom field

#

is the weather info one card or how does it work?

#

I would include those in the grid, and not as absolutes

floral axle
#

yes its a own button card

mint lance
#

ah okey. I think you could usr have them all as fields instead. But choose whicehver gives you the least amount of code 😉

floral axle
#

ok, i can try. always fun to try new things

mint lance
#
styles:
  grid:
    - grid-template-areas: '"n weather temp_in" "l weather temp_out"
    - grid-template-columns: min-content 1fr min-content
floral axle
#

thak you

#

are you scandinavien by any chance? 😛

mint lance
#

50% Norwegian, 50% Swede😅

floral axle
#

nice! im 100% Norwegian 🙂

#

Got all the info in, now i just need to style it and sutch hehe

mint lance
#

nice 🙂

floral axle
#

what i dont understand, is why the other infomration is pushed under the time and date.. should i maby put date and time as well in a custom field?

mint lance
#

hm good question.... trying to find what makes wverything stack up in a pile too

floral axle
#

graph is making it stack i tink

#

think*

mint lance
#

try changing your grid styles to this, just temporarily and see what happens:

  • grid-template-columns: 1fr 1fr 1fr
  • grid-template-rows: 1fr 1fr
floral axle
#

no changes

#

but i belive its the entity name and label doing it

mint lance
#

ah yes you are right, we forgot about the graph

floral axle
#

or maby not

mint lance
#

you want to graph to be behind the other stuff right?

#

and not just under

floral axle
#

yes

#

i actually want a gradiant on it, so it fades out

#

thats why i used:
card_mod:
style: |
ha-card {
position: absolute !important;
height: 100%;
width: 100%;
top: 0px;
--ha-card-border-width: 0;
}
ha-card:after {
content: "";
position: absolute;
width: 100%;
height: 100%;
background: linear-gradient(to right, var(--card-background-color) 20%, transparent);
}

  • type: custom:button-card
mint lance
#

you had misspelled grid-template-areas

#

🙂

floral axle
#

lol

mint lance
#

also, remove the ; after font size

floral axle
#

oh no.. you did not se that

#

it works 🙂

#

but can i now add a card mod for the gradiant background inside the graph?

background: linear-gradient(to right, var(--card-background-color) 20%, transparent);

mint lance
#

I have never done that, but it you normally can, then yes

#

in the graph card itseld, not in the custom_field styles

floral axle
#

ok will try

#

hmm wierd, didnt work 😛 but i will google a bit.

#

well.. wherever i put it, its not working as expected

obtuse owl
#

I just wanted to throw this into y'alls conversation. For a simple (but a bit less customizable) option, there's the stack-in-card. It does need a little bit of "assistance" with card_mod to handle the background and borders of cards but it can almost make multiple cards look seamless. ```yaml
type: custom:stack-in-card
mode: vertical
card_mod:
style: |
ha-card {
--ha-card-background: none;
}
cards:

  • type: horizontal-stack
    cards:
    • show_name: true
      show_icon: true
      type: button
      tap_action:
      action: none
      entity: null
      icon: mdi:dice-1
      name: Card 1
      card_mod:
      style: |
      ha-card {
      border: none;
      }
      [... more card yaml here but shortened for message ...]```
floral axle
#

Interesting!

#

@mint lance with your help, everything aligned perfectly:

obtuse owl
#

Another example. (The background of the weather card is transparent and I have animated backgrounds applied to this dashboard.) Tapping the weather brings up the weather more-info; tapping the animated radar brings up a browser_mod pop that shows three different radar types.

floral axle
#

i will look into that @obtuse owl thank you

mint lance
floral axle
#

yean thanks 🙂 i will try it out. just need to figure out the gradiant background firt hehe

#

first*

floral axle
#

@obtuse owl for the live background, do you use a camera?

#

sorry i miss read, you used animated.

obtuse owl
#

Correct. For the animated background, I use lovelace-animated-background. I have a collection of MP4 videos downloaded from https://mixkit.co/. I'm (slowly) working on being able to have the backgrounds change depending on holidays that I have defined. Right now, most of my videos are smoke-related and the integration will change between them automatically.

#

For live camera video I use frigate-hass-card but that is displayed as a card and not as the background mentioned above.

floral axle
#

ok. maby this iwll work with the same code as the weather icon.. if the weather is "clear" then play clear.mp4? hmm i

obtuse owl
#

Yeah. In fact, some of the default code, allows you to do just that.

#

It can use the state of the weather entity.

floral axle
#

i do wonder what camera pepole are using for the screenshot of weater though. wold be perfect for a "live" view outside of my house hehe

#

thank you buddy, now i have some work to do 🙂

obtuse owl
#

Do you have an example to show/link to?

floral axle
#

here you have an example, kind of smooth. with a live camera of weather.

#

and it worked with my camera, just tested with my garage one. but not sure what camrea that is fit for that hehe.

obtuse owl
#

Looking at the screenshot in the first post and looking over the description, the author is using the same card that I am.
Mentioned in the 49th, Cloos (he's the Dev of the Bubble Cards) mentions using the Generic Camera integration is a bit easier.

#

As long as you can get an RTSP feed out of the camera, integration should be relatively easy.

floral axle
#

ok interesting 🙂

floral axle
#

I got it all working 🙂 thanks guys

mint lance
#

share the results 🙂

floral axle
#

looks like this 🙂
But i started on a new one, to get a live camera background 🙂 but i think we can close this thread thingy

floral axle
#

Ended up with this

floral axle
#

Hi again 🙂
I now am tryint to create a vehicle card, based on the code above.
But how can i create a "battery" card, that goes under all of the things above?

I made a vertical stack just to make an example:

mint lance
#

use custom_fields and add the battery card 🙂

floral axle
#

closing in...this is good practize but.. a pain in the butt 😛

mint lance
#

no it's easy once you get the hang of it 🙂

floral axle
#

well frick

#

I got the top ok. but i cant get that custom bar alligned

#

i did not put it in the grid template, because i wanted t under the other grids... i might be wrong now

mint lance
#

why would you not want it "in the grid"? THe whole button card is made up of a grid, so why not use it:)

floral axle
#

Mainly becuase i cant figure out why its not working to be honest.
but will sleep on it 🙂

#

but i found out that picture elements actually might be better for this

mint lance
#

hmm maybe..... I could definitely achieve that exact same result with the button card though hehe

floral axle
#

i got it all wiht grid, but my patians ran out 😛 will check again tomorrow, as i cant get what i want with the picture thing 🙂 but i got closer though!

floral axle
#

OK.
I started from scratch today, and managed to allign itt all, but have some issues i would probably need some help with

#

the card is going over the with of the card.
The icon shold be inside

mint lance
#

what happens if you change to - overflow: hidden?

#

hmm it happens to me too. Does not seem to be suited for nesting

floral axle
#

it hides, but it does not "crop" into the size i want

#

Maby thats why they use picture elemets for this instead hehe

#

i could to padding maby

mint lance
#

but the picture elements card you linked above does not have a bar card in it from what I saw, so you can't campare 😛

floral axle
#

hehe true

#

when i do padding-right, the bar gets smaller

mint lance
#

I took their card setting and copied right off. That solved it. So must be something in the styling. Maybe you can find it?

floral axle
#

we did the same thing hehe

#

i pasted inn some styling, and worked!

#

or almost

#

i got it all right, except for the target value

#

thats the only thing messing it up now 🙂

mint lance
#

ok 🙂

floral axle
#

removing te target:

mint lance
#

what car is it?

floral axle
#

MG5

#

I want to get the target % out of the API connection, so it states if target charging is 80% or 100% 🙂

#

thats why i added thet arget thingy

mint lance
#

this would be a coolar image for the card 😉

floral axle
#

hehe nice 🙂 where did you find that picture?

#

padding-right: 100% worked btw

floral axle
#

might work with a align-start something, but could not remember the code hehe

mint lance
#

align in css is usually for vertical placement, justify for horizontal

floral axle
#

ah ok thanks

#

Woooops. that did not work 😛

#

i will stick with padding-left hehe

mint lance
#

where are you placing the padding?

floral axle
#

bar-card-background {
height: 35px !important;
padding-right: 100%

#

Do you know if i can set a icon in the upper right corner, and use a "refresh" button that calls a spesific API?

tap_action:
action: call-service
service: homeassistant.update_entity
data: {}
target:
entity_id:
- sensor.mg5_bmsestdelecrng

#

Not sure if i can use the "icon" or if i should create a new custom field

mint lance
#

no idea, sorry

floral axle
#

ok 🙂

#

thanks for the help! 🙂

mint lance
#

it seems to be this part that makes sure it is placed correct

      style: |-
        bar-card-currentbar {
          border-radius: 6px !important;
          right: 0;
        }
#

these two together, I mean

      style: |-
        bar-card-currentbar {
          border-radius: 6px !important;
          right: 0;
        }
        bar-card-backgroundbar {
          border-radius: 0px !important;
          right: 0;
        }
floral axle
#

Yepp

#

My plan is to make something like this:

mint lance
#

very nice

floral axle
#

That is the current app for the car, just working on reading the sensors right 🤣

mint lance
#

I would probalby dedivde that into three cards

#

unless you want the background.....then one card

floral axle
#

I will probably do a bubble pop-up

#

I accidentally upgraded my car range 🤣

mint lance
#

could be done like this for example

floral axle
#

How you make that so fast ?

mint lance
#

Boss level

#

No but I'm a graphic designer, I have the programs open allready 😛

floral axle
#

Ah ok 🤣

floral axle
#

type: custom:button-card name: name label: label icon: url(/local/images/arctic-white3.png) show_name: true show_label: true show_icon: true styles: grid: card: name: #miles label: Battery Range icon: custom_fields: c1: #custon:bar (battery state) placed below the vehicle image c2: c3: c4: c5: custom_fields: c1: c2: c3: c4:

#

am i on the right track?

I changed some of it but

floral axle
#

not sure how to splitt the objects yet but progress

obtuse owl
#

Jumping in y'all's conversation again. Was noticing the battery percentage bar that you guys are working on. I use a timer bar card to act as a countdown timer. While not necessarily relevant to battery percentage, it is based on a bar card which can show numbers or percentages. What I wanted to show off is how it is positioned at the bottom of the card and takes very little space. (Don't mind the weird layout on the screenshot; that card is for tablet but grabbed from my phone.)

floral axle
#

That's a nice card! 🙂 I might use that for time remaining while charging

#

I'm going to try to use picture entity, and make one picture for not charging, and make a GIF for the charging / animated

mint lance
#

sorry, could not resist to make it ^^

#

Allready had this from before so was quick to rearange

floral axle
#

Nice

#

Could you share the style of the entity picture ?

#

I'm not sure where to start hehe

floral axle
#

My picture to small 🤣

mint lance
#

I actualy went for a picture card this time. But a picture_entity should work as well

floral axle
#

Ok I will check thanks ! Don't look at my icons 🤣 no styling yet

mint lance
#

also, just replace Name with State in my code. I just used name for the ease of it since I dont have the right entity

floral axle
#

Dude.. css has changed so much sins I used it last 🤣 like 15 years ago 🤣

#

The picture cardz can that be animated / changed based on entity state ? My idea is to Photoshop a green circle / blue circle pulsing when the charger is connected or charging

mint lance
#

you can add a another custom_field and just place it on top of the picture?
Just use postion: absolute and place where you want it

#

At least yuo have some CSS experience 🙂 I did not when I started with HA just over a year ago

floral axle
#

That I could do

mint lance
#

and I would supose you can set the image url based on states using standard HA templating

floral axle
#

yeha, but i want a circle pulsing, so i eighter need to trigger a picture animation, whitch switches between to images, or i need to create a GIF with a pulsing circle.

Or... i do belive its possible to create a pulsing circle with css.. buuut thats next level 😛

#

There are som keyframe css thingy i could try

mint lance
#

you can 100% for sure make it using only CSS

#

there might be even easier ways, but I would make a new custom_field with a custom:button-card in it. Set the width and height of the card, border width and color and a radius. So you end up with a circle. THen just animate that

#

transform scale to make it grow/shrink and opacity for a pulsating effect

#

actually I allready have the css for that I think, let me check

#
animation: shake .2s ease-in-out infinite
  extra_styles: |
    @keyframes scale {
      0% {transform: scale(1); opacity: 1}
      25% {transform: scale(1.1);}
      50% {transform: scale(.9); opacity: 0}
      75% {transform: scale(1.1);}
      100% {scale: rotate(1); opacity: 1}
    }
floral axle
#

Oj

#

Nice

#

tested your code inside a bubble card 🙂 woked quite nice

mint lance
#

ah great 🙂

floral axle
#

just need to find the right colors hehe !

mint lance
#

and icons 🙂

floral axle
#

Yeah, the icon I will set by state I think

floral axle
#

do you have a ite, where i can copy in a picture like that, and get some nice color pallets back? 😛 trying to figure out what button background i want

mint lance
floral axle
#

ty

#

starting to take form. ugly font though hehe

mint lance
#

getting there (y)

floral axle
#

yeah. im doing two things at once.. trying to connect everything with the MQTT connection to the car hehe

#

I believe I need to fix the picture, and make it a bit bigger, and get the battery one higher up

#

Te button on top is only to trigget he popup card hehe

#

The*

mint lance
#

looks good 🙂

floral axle
#

Do you know how I can get the bar a bit closer to the picture without damaging the with/height of the picture above?

mint lance
#

I would start with making sure the original picture has no space around the car. Better to add spacing with CSS

#

after than, you just use row-gap in the grid to set the space

floral axle
#

ok

mint lance
#

haha

zinc bronze
#

Someone can explain me what should i edit in order to fix these position please?

#

That’s a screenshot from iPhone

floral axle
floral axle
#

This with gif 🙂

#

it is really starting to take form, even though i would love to have that circle under the car in css 😛 but if im going to do all the small details now, i will never finish the card hehe

mint lance
#

yeah thats really cool 🙂 Did you try and make the circle as I said?

#

instead of the gif

floral axle
#

i could not figure out where to put the css, and i felt bad for asking so many questions.. hehe so no

floral axle
#

@mint lance would you have time to check something for me?

I have started wit adding the pulse thingy, without a anmation, just the circle to se if i got the grid right.. but i cant figure out how ot make it visible.
Did you do anything on the first "customs_fields" or left that blank and just did the code in the secound one?

#

` styles:
grid:
- grid-template-areas: |
"s s s s"
"l l l l"
"img img img img"
"pulse pulse pulse pulse"
"c1 c1 c1 c1"
"item1 item2 item3 item4"
- grid-template-rows: 2fr 1fr 1fr 4fr 1fr
- grid-template-columns: 1fr 1fr 1fr 1fr
- column-gap: 8px
- row-gap: 8px

`

#

wait dont answer! im stoopid

#

i forgot to spell check.. ignore my questions

#

i figured it out 😛 dang it.. always right after i ask a question hehe

#

i though have one question... and thats how to get the bordr visible?

I tried the way i did before, border: 10px solid, but nothing shows up

mint lance
#

border of the circle? Check my code from yesterday, it has the border in it

#

but this should work

  • border: 6px solid green
floral axle
#

my aploegiez, im blind

#

for some reason, the border is not visible. only the background color

mint lance
#

hmm I don't know. must be a typo somewhere

floral axle
#

the pulsing is working though! and its real sooth 🙂

#

smooth*

mint lance
#

did you add either color to the border like I did, or write - border-color: green? Cause now you have color: green and I don't think that works

floral axle
#

I removed the color: green

#

But no changes

floral axle
#

it will not show me the border at all, i lied about finding it hehe

#
  • border: solid
  • border-width: 10px
  • border-color: green
  • position: abosolute

This shoud be correct, i dont understand how you get it to work with the same code and not me hehe

#

WAIT!!!!

#

might it be the theme ? i removed borders from the theme itself

#

frick.. its the theme screwing with me.. changed theme and i got the border back hehe frick

mint lance
#

strange, I thought what you put in the card would override the theme. I'm pretty sure I don't have borders in the theme either

floral axle
#

I changed theme, and everything worked hehe

#

i might as well install your theme 😛 then i know its all perfect! hehe

floral axle
#

Lokks like there is a code or something in the theme i was using, i swapped to yours and it worked fine

floral axle
#

Hehe now I see the borders correctly

floral axle
#

starting to look like something, but there is a big difference between my cellphone and computer hehe

floral axle
mint lance
#

You could also add animation to the border-width for an aven cooler effect

floral axle
#

oh really?

#

i need to figure out what i did to your theme, because i have the wrong background color hehe

floral axle
#

@mint lance i might have f.. up a bit when adding your theme.. now all my custom cards are gone :/ all my custom cards are gone hehe

#

I reverted back to the old one.
I guess i have to start from scratch with dashboard if im going to use yours 🙂

mint lance
#

yeah the theme comes with no guarantees of functionality with other stuff than my own. Yuo would have to adapt it:)

floral axle
#

i will try to do that during xmas, just a day when the wife is note home.. hehe

#

added a secound pulse, to make a cooler effect 🙂 just not done yet!

mint lance
#

google animation delay also perhaps

floral axle
#

yeah i did, but not sure how to apply it to this card.. i manage to get it to work in html..

#

There is an animation-delay: .5s; but need to wrap my brain around the difference between div in html/css and these cards in ha.

#

I will get there 🤣

floral axle
floral axle
#

i managed to fix it with learning the basics of z-index 🙂

floral axle
floral axle
#

@mint lance you need to get a "buy me a coffe" thing on your github page... or a buy me a beer... i owe you a few 🙂

mint lance
#

haha maybe I should 😮 No that just fields wierd:p
But very nice card, glad you got this far!

floral axle
#

my only question for you now.. is how to place the pulse thingy? 😛

floral axle
floral axle
#

could i ask you about that delay thing you talked about? 👼

mint lance
#

It seems I had tried it too without sucess when working on this snowing effect. So cannot help :/

floral axle
#

its fine 🙂 thank you for checking!

#

I found a way... but then i have to add a "clone" of the pulse.. and add following:

  - animation-delay: 3s
mint lance
#

hmm not does not work for me. Does it for you?

#

with that indentation

floral axle
#

I managed to get two above echoter yesterday.... but now im not hehe

mint lance
#

I got the delay working, just had to split all the animation properties to their each line 🙂

- animation-name: snowflakes3
- animation-duration: 3s
- animation-timing-function: linear
- animation-delay: 1s
- animation-iteration-count: infinite
```
floral axle
#

i also got it to work, but i pasted the whole keyframe on top of a new card

#

you did it the lean way then hehe

#

my code real messy 😛

mint lance
#

what will you use the delay for? a second "pulse"?

floral axle
#

i was thinking of making a delay to the shadow, and make the shadow look like the border kind of

#

i explaind that in e really bad way

#

Oh you changed color on your name! Well done

mint lance
#

the shadow of what? not following here haha

floral axle
#

im not following myself.. to be honast 😛

#

im not sure yet how im going to use it.. right now i added a seound pulse with a delay.. making a nice effect.. but that is not ideal, as the height of a cellphone and a computer or tablet, will not be the same.. so the circles will not be aligned

mint lance
#

a good image speaks more than a thousand words. You don't have any reference images? inspo?

floral axle
#

i will try to find something. hold on

#

but doing it that way, will result in a other problem.. and thats aliging the together perfectly, whitch can be a pain when using phone with different size of height/width

floral axle
#

fixed the car a bit, made some better shadows .. helped allot 🙂
Now i need to add the bar-card again, i accedently deleted it hehe

floral axle
#

Is there any way to add this card as a custom:card that I can re-use or share with others ? It is your code as well, so I won't just share stuff out of the blue.

mint lance
#

Do you mean in HACS? That I don't know. And also don't recommend. Cards from HACS get so limited. Better to publish on say Github or make a forum post on the community page 🙂

floral axle
#

Ok but for my own sake, if I install the UI Lovelace, can I save this as a custom card on the custom folder ?

#

I will download your stuff, and se if I can find a path 🤣

mint lance
#

yes yes ofc 🙂 two options:
Either you create a template. the template can contain as much or as little as you want from the "original" card. You could for example only keep the following in the dashboard, and put all the rest in the template:

- type: "custom:button-card"
  template: car-overview

Another option, which I use when I want to re-use something, that does not need to be adapted with variables, is the just move the whole thing into a separate yaml, and use !include to bring it back in. I use this for my footer menu for example. This is just an easy way to move all those long lines of code out of the way

#

oh btw, I'm talking from a yaml dashboard perspective. If you are using the GUI, you place the template in the "raw config editor". At the bottom for example. All is described in the button card documentation.

floral axle
#

I had yaml dashboard before, and have now started creating one:) thats why i am interested in how to clean it up.

#

i crated this one out of custom:button-card, and some css:
and want to make a "header card" so i can re-use if i make more pages

obtuse owl
#

You could always put your example on to Github. Wouldn't necessarily be something to download from HACS, but at least your example would be out there for the world to see.
I recently started putting some of the examples that I frequently share onto GH: https://github.com/dsellers1/home-assistant

mint lance
floral axle
obtuse owl
#

I went with the drop down code to make the whole page shorter and faster to scroll through. Also, if you're not interested in a certain piece of code, there's no sense in making you scroll through it.
That's honestly one of the reasons why I started putting that up. I started collecting too many examples and started having difficulty finding them. Now, the bad thing is, I have a bunch more to put up but getting them posted is just time consuming.

tame spoke
mint lance
floral axle
#

Starting to take form 🙂🙂 will add the pulse thing to the charger instead, so I have garage, vehicle and charger seperated

mint lance
#

perhaps just a green half-pulsating glow the the now grey circle on the charger? 🙂

floral axle
#

Yes indeed

#

When that is done.. I want to transfer over to clean yaml. But not sure how good the pop-up card is to use there

floral axle
#

I think this looks good, just something missing.. can't put a finger on it

#

Apologies for the sound 🤣

floral axle
#

Tried with a bar again, but does not fit in

mint lance
#

perhaps crop and resize the image? Also the text could be bigger to fit the screen perhaps

#

just a quick idea at least ^^

floral axle
#

Yeah trying to find out why there is a big gap between the text and the image, the image is cropped to the limit, and making it bigger.. maby.... I want to add buttons under for the power usage and sutch.

#

You might be right 👍

#

When I put one custom field over the other, should I use 1fr in grid or am I doing it wrong

mint lance
#

you can combine different units. If you don't need an area in the grid to be any bigger than the content within it, you can use min-content. Here are two examples

floral axle
#

ohh thanks!

mint lance
#

this is great when you might want to push content in some directon for example, many use cases

floral axle
#

is it possible to create something like the attached image? thats a Apexchart, but i want it to be a icon with percentage circle around the icon.
I could maby make something out a custom:button-card with the stroke?

found one in UI Minimalist, but thats a custom card im not sure how to use

mint lance
#

Let me know when uo find it 😉
I think the guy behind "A different take on lovelace" had some cirgular graphs in his card. Check his github

floral axle
#

I found it in his button card templates, but it looks to complicated hehe

floral axle
#

Frickedi duck.. i accedently crashed my HA, now all my custom cards are gone and i have to re-make these charging cards... a good thing this thread is not removed yet!

mint lance
#

Hope you had a backup?

floral axle
#

Nope. The backup was interrupted so it failed to load 🤣

obtuse owl
floral axle
mint lance
floral axle
#

Do you know how I can make the icon go to right ?

#

i used

icon:
                  - justify-self: end
                  - align-self: end
                  - aligh-content: end
                  - color: "var(--color-white)"
                  - overflow: hidden

grid settings:

                 - grid-template-areas: |
                          "n n"
                          "s i" 
                  - grid-template-rows: 1fr 1fr 
                  - grid-template-columns: 1fr 1fr
#

Never mind I will find it myself, need to learn hehe

floral axle
#

There we go! Now I just need to figure out what's missing 🤣

floral axle
#

so... i tried making a huge custon-card, but i cant get the last "grid" to be correctly placed.
https://dpaste.org/XpOHv

The 3 lock icons should be higher up, but what ever i do to the grid-template-rows: just makes a bigger gap between the "battery" card and the "controls" card

I might have put to many into one card, but i wanted to try to se if it was possible to make a really easy card for others to use

floral axle
#

Cleaned up the icon a bit, but stuck with the wired gap between the two last rows

mint lance
#

I'm not if you should use 1fr for ALL your rows in the main grid. I often use min-content for the most part (but you need at least one 1fr to fil out the remaining space.

floral axle
#

Ok! I will try a bit more

floral axle
#

I tried this now, but did not change anything.. allot claner though

        - grid-template-areas: |
                "range"
                "l"
                "img"
                "engine"
                "battery"
                "controls"
        - grid-template-columns: 1fr
        - grid-template-rows: 1fr repeat(5, min-content)
floral axle
floral axle
#

Finally starting to get this one in place 🙂

floral axle
mint lance
floral axle
#

Yes i have it in th 4th row, is it possible to do it a other way maby ?

mint lance
#

oh okay, I think I had it floating outside the grid, with positition: absolute

floral axle
#

ah ok, i could try

mint lance
#

and thren you jsut create a second pulse, with a delay to the animation

#

this is how I positioned the pulse card

floral axle
#

ah ok 🙂

#

Will that give a difference if you open it on pc, tablet and phone?

#

because now my pulse move about 5 pixels from the top if i use my wifes phone

mint lance
#

yes, you should probalby change the card dimensions and the units in the custom field styling to something else than pixes

#

fr seems to be a good unit

floral axle
#

noted 🙂

mint lance
#

or actually, does not works for me in this case now when trying. Not % either...

#

sorry I mixed up, I mean rem and not fr

floral axle
#

ok

mint lance
#
styles:
  custom_fields:
    img:
    pulse:
      - position: absolute
      - top: 52%
      - left: 50%
      - margin-top: 1rem
      - margin-left: '-10rem'
custom_fields:
  pulse:
    card:
      type: custom:button-card
      styles:
        card:
          - height: 2rem
          - width: 20rem
          - border-radius: 50%
          - border: 6px solid green
          - background: green
          - z-index: 1
          - animation: pulse 3s ease-in-out infinite
      extra_styles: |
        @keyframes pulse {
          0% {transform: scale(.8); opacity: .6}
          50% {transform: scale(1.2); opacity: .3}
          100% {transform: scale(.8); opacity: .6}
        }
````
floral axle
#

noted thanks, i will test 🙂

#

using rem did the trick! thank you again for the 100 time for the support @mint lance ! now get that buy me a coffy thing hehe

mint lance
#

no worries 🙂

floral axle
#

its a good start, but needs tweaking hehe

mint lance
#

very nice 🙂

floral axle
#

This is what i ended up with, not sure if you like this or the other one best hehe

#

Just need to find a better green color that is "glowing" but not to bright for the white background

floral axle
#

The idea is to get it looks like it is pumping power hehe but not sure if I got the effect right or if I should keep it more simple

mint lance
#

I prefer the other one. That resembles charging more I think

floral axle
#

Noted 🙂 I kind of agree but it was fun making it hehe

mint lance
#

nice to see you mastering the button card. Everything becomes way for fun right? 😄

floral axle
#

Indeed. It reminds me of what I managed before (about 15 years ago).. when I actually knew css and stuff hehe. I have had a long break 🤣 I switched to animation in after effects and sutch hehe.

But only a hobby though

#

Oh I feel old now

mint lance
#

haha I get you

floral axle
mint lance
#

yes I'm sure (y)

floral axle
#

Do you know if it is possible to add a bubble card or some kind of a popup inside a button card ? Like a settings popup but all settings inside the button card ?

mint lance
#

Yes if you use - display: none for card state then you can toggle it on an off lika s pupup

floral axle
#

Oh, I will try this tomorrow

mint lance
#

Here is the card styles for a popup I had before for my media player EQ settings.
Using helper to toggle it

  card:
    - height: 220px
    - width: 360px
    - border-radius: "var(--border-radius)"
    - padding: 1.5rem
    - background: "var(--contrast-10)"
    - position: fixed
    - top: 50%
    - left: 50%
    - margin-top: -140px; /* Negative half of height -30px */
    - margin-left: -180px;
    - z-index: 4
    - display: >
        [[[
          if (states['input_boolean.eq_dropdown'].state == "on"){
            return 'block';
          } else {
            return 'none';
          }
        ]]]
floral axle
mint lance
#

When talking to me you won't get much else than custom button card 😅

floral axle
#

Hehhehe I should have known

obtuse owl
mint lance
obtuse owl
#

I have two similar methods for Jinja too. But, at the moment, I cannot seem to find them.

floral axle
#

or does this thing need browser mode?

mint lance
#

no, no need for browser_mod. By using the absolute position you can place it where you want in your dashboard. Or in a card as you asked for

floral axle
#

i did not get it working lol sorry!

mint lance
#

share your full card and I can have a look

floral axle
#

oh i havent tested in the card i want it on, i wanted to check if i got it popping with just its on as a pop-up

mint lance
#

that should work. With that it will hide/unhide
Ofc you can take it the next level and add animations later on

floral axle
#

it added a huge button to my dashboard, it enables and disables the card.. but no poppup thingy

mint lance
#

well how do you define a pop-up? 😛

floral axle
#

A card that goes over the other card with new information, that you can close and your back at the view

#

same as the bubble-card pop-up card

mint lance
#

yes, the above is that very same card. now you just have to fill it with your content

#

and ofc you need a button to trigger it

floral axle
#

hehe this is how it looks now

#

the button will toggle the input_boolean.soc right?

mint lance
#

yes, but you need another button to toggle pop-up (the big card with the gears). As this wil dissapear when off, you need something else to click

floral axle
#

for me, the icon only goes yellow when its on hehe but ok.
I will try to make some info, and create a toggle button

#

it wont go away when i toggle it off, so there must be a stupid mistake of mine somewhere hehe

mint lance
#

this is how it should work

floral axle
#

haha the differance is huge

mint lance
#

I have no idea what you are doing 😛

floral axle
#

show off!! hehe

#

ok, let me check again

#
  - type: custom:button-card
    entity: input_boolean.soc
    name: Settings
    icon: mdi:cogs
    name: Test pop-up thingy
    show_name: true
    show_icon: false
    tap_action:
      action: toggle
    style:
      card:
        - height: 220px
        - width: 360px
        - border-radius: "var(--border-radius)"
        - padding: 1.5rem
        - background: "var(--contrast-10)"
        - position: fixed
        - top: 50%
        - left: 50%
        - margin-top: -140px
        - margin-left: -180px
        - z-index: 4
        - display: >
            [[[
              if (states['input_boolean.soc'].state == "on"){
                return 'block';
              } else {
                return 'none';
              }
            ]]]
#

i dont get it lol

mint lance
#

do you have that same entity in the button you are clicking?

floral axle
#

yes

#
 - type: custom:button-card
    entity: input_boolean.soc
    name: Settings
    icon: mdi:cogs
    show_name: true
    show_icon: true
    tap_action:
      action: toggle

mint lance
#

hmm ok well here is my example

#
  - type: custom:button-card
    view_layout:
      grid-area: btn
    entity: input_boolean.dummy_light1
    name: Button
    show_name: true
    show_icon: false
    show_label: false
    show_state: false
    styles:
      card:
        - height: 200px
        - width: 200px
        - background: orange
        - padding: 0
        - margin: 0


  - type: custom:button-card
    name: Pop-Up
    show_name: true
    show_icon: false
    show_label: false
    show_state: false
    tap_action: none
    styles:
      card:
        - height: 300px
        - width: 300px
        - position: absolute
        - top: 50%
        - left: 50%
        - background: black
        - padding: 0
        - margin-left: -150px
        - margin-top: 150px
        - display: >
            [[[
              if (states['input_boolean.dummy_light1'].state == "on"){
                return 'block';
              } else {
                return 'none';
              }
            ]]]
        - animation:
            - slide-up .5s ease-out
            - opacity .5s ease-in
    extra_styles: |
      @keyframes slide-up {
        0% {transform: translateY(50px);}
        100% {transform: translateY(0);}
      }
      @keyframes opacity {
        0% {opacity:0;}
        20% {opacity:1;}
      }
floral axle
#

ohhh its the tap_action: none

#

probably.. i used toggle.. so basically it toggels off and on at the same time

mint lance
#

oh haha

floral axle
#

hehe nice.. thanks for helping bro!

floral axle
#

Is it possible to toggle the pop-up when clicking on my main Battery button, that already have an entity?

mint lance
#

yes if you change the action from toggling the entity to a call service instead, then you can toggle another entity

floral axle
#

oh yes! thanks

#

I got it all working, just struggeling with placing it correctly inside the card

floral axle
#

i put one outside, and one inside

mint lance
#

hmm no, I mean the pop-up is just a normal button card. Works the same way as your other cards

floral axle
#

wierd

#

wait... i might have it now

#

lol im dumb

#

what is the first thing i should ask myself before asking you for help? hehe

mint lance
#

spelling? 😛

floral axle
#

yeah.. but in my defence... i used ` instead of ' hhe

#

hehe* they are hard to se some times

#

there, just need to figure out why its not centering correctly 🙂 probably padding

mint lance
#

yes I think I had a similar problem in a card, I can checj

floral axle
#

thanks, i checked forums, but everyone asking the question did not get a replay hehe

mint lance
#

are you using custom:my-slider-v2?

floral axle
#

no, im using bar-card

#

custom:bar-card

#

mainly because you can visualize the SOC and Target SOC for the vehicle

mint lance
#

ah see, same problem here. Mayb I never solved it XD

#

it does not show too good in the screenshot but halv the bar is outside the card

floral axle
#

i fixed it last time with padding-right: 100%, but i cant figure out where i did it hehe

#

yeah i see it

#

i tried to add this styling, but no changes

mint lance
#

I found out why the card was f*cked up. I had to old version of card_mod applied

floral axle
#

wait what?

#

is there a new way of doing card_mod?

mint lance
#

yes you cannot just write style anymore

#

try addid this to your bar card and see what happens

#
      card_mod:
        style: |-
          bar-card-currentbar {
            right: 0;
          }
          bar-card-backgroundbar {
            right: 0;
          }
          bar-card-background {
            height: 35px !important;
            background: none !important;
            left: 0;
          }
floral axle
#

YOU SEXY MF..

#

thanks!

#

oh i have a new question.. anny suggestion how to put in a slider ? im not sure how to make this "bautifyl"

#

my goal is actually to add all of this:

mint lance
#

custom:my-slider-v2 is what I use, you can style to look however you want too

floral axle
#

oh ok cool. thanks!

mint lance
#

this card is a bit broken now, not using it anymore but here I have emdebed 2 sliders into the button card.

#

haha forgot I have a new one... 😛 here, three sliders

floral axle
#

oh nice

#

The only thing missing there, is to show the %.. so i need to show how much in value

mint lance
#

I think default look is like the bar card. So here I just made the track/progress bar super thin, and then the thumb/controller bigger and with a radius

floral axle
#

ah noted

mint lance
#

you ust have to remember that usability can be tricky on small screens if you have clumsy fingers 😛 better if you can scale everything up a bit. Here I've taken it to the extreme. It works, but could be better

floral axle
#

hehe i noticed on those small buttons up right for the alarm you made.. i had to make them bigger for my fat fingers to hit the right one hehe

floral axle
#

starting to take form... but i do struggle a bit with figuring out the layout and design of this thing hehe

floral axle
#

I do wonder.. if at any point the button-card can start beeing slow?
I`m currently up to 700 lines soon with this card, and should probably stop? hehe

mint lance
#

Maybe you should start looking at templates includes and yaml anchors:)

#

Check the UI Minimalist cards, they usually have several layers of templates

floral axle
#

yeah i probably should

#

i will finish this card, and probably pick it apart and try it out

floral axle
#

You have some nice gradient colors

mint lance
#

Yes suits the car too:) google css gradient generator. There are lots off tools online to help make nice swatches

floral axle
#

Ah ok. Just trying to find the best layout to fig everything hehe

floral axle
#

is there a way to force these to be same hight?

#

i tried with height: 100%, checked that the grid has 1fr on both row and column

#

i can force it to set a pixel hight, but not exacly what i wanted hehe

floral axle
#

Endet up with this 🙂 and will style it later hehe, i need to focus on finishing some other project, and come back to chane the style here 🙂

mint lance
#

nice, try experimenting with the animation properties also. Would look good if it slides up from the bottom of the screen without the opacity face for example

floral axle
#

Yeah. I have a feeling I'm going to split the pop-up out of the card, and add it as it's own card, so it fits better to the dashboard, and reduce the amount of code in the card

mint lance
#

yes I think that makes sense

floral axle
#

is there a way to make this pop-up by user and not for everyone?

#

i should probably change this to browser mod?

mint lance
#

hmm yes probably. I never managed to make nice pop'ups with browser mod, hence this method. But sure you have some more conditions you can set there

floral axle
#

well, aint it possible to use browser mod, and put a button-card in it?

mint lance
#

it is, but I struggled with the size. But give it a try and let me know 🙂 For me this was more practical though

floral axle
#

Any suggestions on where to place my power consumption and price ?

#

I can't figure out hot to make it look ok 🤣