Custom bubble-card How to solve this?


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;
        }

One of your calls has hass.state instead of hass.states (search for “deur” - it’s the last one). It will be returning null, so it cannot find properties on it.

many thanks !!! , i surely overlooked that