Salut,
on n’est pas sur mushroom ou card_mod
C’est different sur bubble-card:
background-color: ${state === 'on' ? 'rgba(12,120,50,0.5)' : 'red'} !important;
ou
background-color: ${hass.states['binary_sensor.sm_s926b_wifi_state'].state === 'on' ? 'rgba(12,120,50,0.5)' : 'red'} !important;