#HELP Digital clock with HACS
1 messages ยท Page 1 of 1 (latest)
install card-mod on hacs if you dont already have it then add the following section to the yaml for the digital clock card:
style: |
ha-card {
background-color: transparent !important;
border-width: 0px !important;
}
should then look like this
did not appear transparent on dashboard
have you done full refresh (ctrl+f5) since installing card-mod?
can you post the yaml for the whole vertical stack
everything should work but perhaps someone else in the stack is doing something strange
type: custom:digital-clock
card_mod:
style: |
ha-card {
background-color: transparent !important;
border-width: 0px !important;
}
thats just the yaml for the clock card. you seem to have the clock card inside of a vertical stack
yes
at the bottom you can open the vertical stack code editor and see the full stack code editor
type: vertical-stack
cards:
- type: markdown
content: |Hello, {{ user }}
Welcome Home ๐ฅณ๐๐ก
text_only: true - type: custom:digital-clock
card_mod:
style: |
ha-card {
background-color: transparent !important;
border-width: 0px !important;
}
sorry for not understanding i think that is it ๐
use triple ` around your code paste
like this
โโโ
type: vertical-stack
cards:
- type: markdown
content: |Hello, {{ user }}
Welcome Home ๐ฅณ๐๐ก
text_only: true - type: custom:digital-clock
card_mod:
style: |
ha-card {
background-color: transparent !important;
border-width: 0px !important;
}
โโโ
โโโ
type: vertical-stack
cards:
- type: markdown
content: |Hello, {{ user }}
Welcome Home ๐ฅณ๐๐ก
text_only: true - type: custom:digital-clock
card_mod:
style: |
ha-card {
background-color: transparent !important;
border-width: 0px !important;
}
โโโ
this symbol - `
cards:
- type: markdown
content: |
# Hello, {{ user }}
Welcome Home :partying_face::grin::house_with_garden:
text_only: true
- type: custom:digital-clock
card_mod:
style: |
ha-card {
background-color: transparent !important;
border-width: 0px !important;
}```
copy my example and paste it if you have to
got it
do you have something thing installed to make it show the emoji's? thats not default behavior
no emojis show fine
this is the stock behavior
do you have any other custom stuff installed from hacs?
no but i need the clock to be transparent the message is already
yeah i understand where your trying to get to and the code you have should work. i am trying to work out why it doesnt
what version of home assistant are you on?
and can you try it on another browser to see if the formatting is isolated to the browser?
Sure thing
Did Not work
the only thing that i can think of is that card-mod is not working correctly. you could try uninstalling and reinstalling it
or you have some other custom theme or something interfering with how the cards are being drawn
The custom: digital-clock card may not follow the same syntax found in stock cards. Stock cards, for the most part, use the same syntax. Devs for custom cards can do whatever they want. Another option to try is just background:. I'll try to inspect the card later this evening and get better info.
both background-color and background work on my machine actually
Looking at the code for the card, I think it uses background.
try this
card_mod:
style: |
ha-card {
background: transparent !important;
border-width: 0px !important;
}```
Yeah. If you have it working on your side but it is not for the OP, then the browser may need refreshed and/or cache cleared. Reinstalling card-mod, like Michael mentioned, is another good option (followed by a refresh and cache clear.)
Card mod where do I get that
That explains why it is not working :p
timeFormat: hh:mm a
card_mod:
style: |
ha-card {
background-color: transparent !important;
border-width: 0px !important;
}
If you want to "design" your own time card, you can use the Markdown card. This is for the top example: ```yaml
type: markdown
content: "{{ now().strftime("%m/%d/%Y, %H:%M")
To help with the strftime syntax, I recommend [Python strftime cheatsheet](<https://strftime.org/>)
The yellow one has template to handle to text and a bunch of card_mod for the styling.
This one is similar to the first example but has some card_mod to pin it to the top of the screen. ```yaml
type: markdown
content: "{{ now().strftime("%m/%d/%y, %H:%M") }}"
card_mod:
style: |
ha-card {
background: transparent;
color: white
}
:host {
position: fixed;
top: 0px;
right: 50%;
z-index: 99;
font-size:25px;
}
Lastly, a custom:button-card using its internal styling and the Time & Date integration which gives a sensor.time entity.
I forgot the Mushroom card's template card ```yaml
type: custom:mushroom-template-card
primary: |
{{ (states('sensor.date_time_iso') | as_datetime).strftime('%H:%M') }}
layout: vertical
icon: ""
card_mod:
style: |
:host {
--card-primary-font-size: 55px !important;
--card-primary-line-height: 1.0 !important;
}
ha-card {
border: none;
background: transparent;
}
Hello how can i center the Message?
โโโtype: vertical-stack
cards:
- type: markdown
content: |
# Hello, {{ user }}
Welcome Home ๐ฅณ๐๐
text_only: true
- type: custom:digital-clock
card_mod:
style: |
ha-card {
background: transparent !important;
border-width: 0px !important;
}โโโ
add the center tags
<center>Welcome Home</center>
i need the hello welcome homein the center too
then put center tags around that too