Hi all,
Thanks a million for any help!
What I’m trying to achieve is the following:
- to have a room card for my front hall
- the icon would be dependent on the state of the door sensor = mdi:door/mdi:door-open
- what I’m also trying to integrate the whole fricking day is link my light to that icon, so when it’s on the icon’s border would have an animation.
I can do one or the other, but no matter what I do, I can’t achieve both.
Here’s my code, at this stage it’s a mess I changed everything like a million times:
type: custom:button-card
icon: mdi:door
name: xxx
entity: light.hallway_2nd_light
view_layout:
grid-area: xxx
state:
- entity: light.hallway_2nd_light
value: 'on'
styles:
icon:
- animation: borderFadeIn 4.5s ease-in-out infinite
- border: 30px solid rgba(222,212,115,0.8)
- border-radius: 50%
- overflow: hidden
- width: 40px
- height: 40px
img_cell:
- border: 1px solid rgba(222,212,115,0.5)
- overflow: hidden
- entity: binary_sensor.door_sensor_contact
value: 'on'
icon: mdi:door
- entity: binary_sensor.door_sensor_contact
value: 'off'
icon: mdi:door-open
extra_styles: |
@keyframes borderFadeIn {
0% { border-color: rgba(222,212,115,0.2); }
50% { border-color: rgba(222,212,115,0.45); }
100% { border-color: rgba(222,212,115,0.2); }
}
@keyframes borderFadeOut {
0% { border-color: rgba(222,212,115,0.4); }
50% { border-color: rgba(222,212,115,0.75); }
100% { border-color: rgba(222,212,115,0.4); }
}
styles:
card:
- height: 100%
- padding: 5px
- background: '#e7e7e6'
- border-radius: 30px 20px 36px 6px
grid:
- grid-template-areas: '"n i" "temp temp"'
- gridtemplate-rows: 1fr min-content
- grid-template-columns: min-content 1fr
img_cell:
- justify-self: left
- align-self: start
- background: '#76906f'
- border-radius: 100%
- width: 55px
- height: 55px
- left: 100px
icon:
- width: 40px
- color: black
- padding-bottom: px
- justify-self: right
As said, it’s a mess now, but at least you can get a picture and references.
omg, Boheme61, thank you so much for investing your time into me