card:
card_type: button
sub_button:
- entity: binary_sensor.contact_sensor_deur
card_type: button
entity: binary_sensor.contact_sensor_deur
button_type: state
show_name: false
styles: |-
.bubble-button-background {
background-color: ${(hass.states['binary_sensor.contact_sensor_deur'].state === 'open') ? 'white'
: hass.states['binary_sensor.contact_sensor_deur'].state === 'closed' ? 'white'
: 'white'} !important;
opacity: 1 !important;
}
.bubble-icon {
animation: ${hass.states["binary_sensor.contact_sensor_deur"].state === 'on' ? 'blink 2s linear infinite' : ''};
color: ${
hass.states["binary_sensor.contact_sensor_deur"].state === 'off'
? 'darkgreen' // Blue
: hass.state["binary_sensor.contact_sensor_deur"].state === 'on'
? "#FF0000" // Red
: "#FF0000" // Orange;
} !important;
}
@keyframes blink {
opacity: 1}
}
.bubble-sub-button {
height: 60px !important;
min-width: 40px !important;
}