Hide a sub button next state main button

Good morning,

I would like to hide the sub button if the main state is off, here is my card :

type: custom:bubble-card
card_type: button
button_type: state
name: Arrosage automatique
force_icon: false
tap_action:
  action: toggle
button_action:
  tap_action:
    action: toggle
styles: |
  .bubble-icon-container {
  background: ${state === 'on' ?  '#1bc257' : 'white'} !important;
  }
show_last_changed: true
entity: input_boolean.bout_arrosage_automatique_potager
icon: mdi:watering-can-outline
sub_button:
  - entity: input_datetime.pot_prochain_arrosage
    show_icon: false
    show_state: true

could you help me?

My guess it is not possible with that card.
Some cards support templates, but templates only work on the value (the part to the right of the : ).
Templates are not possible on the key (the part to the left of the : ).

Well, it is possible, but then it requires a radical shift in your setup to use Lovelace_gen and YAML-only editing.

You may have to find another card.
There is a custom button card in HACS that is extremely versatile.