# Problème exception dans Custom side-bar

**URL:** <https://forum.hacf.fr/t/probleme-exception-dans-custom-side-bar/86301>\
**Category:** Entraide Home Assistant\
**Tags:** aide\
**Created:** [Décembre 1, 2026, 10:43 UTC](https://forum.hacf.fr/t/probleme-exception-dans-custom-side-bar/86301 "2026-12-01T22:43:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![pascal\_ha](https://forum.hacf.fr/user_avatar/forum.hacf.fr/pascal_ha/32/10823_2.png) [@pascal\_ha](https://forum.hacf.fr/u/pascal_ha)\
**Post date:** [Décembre 1, 2026, 10:43 UTC](https://forum.hacf.fr/t/probleme-exception-dans-custom-side-bar/86301/1 "2026-12-01T22:43:25Z")

</div>

Bonjour,

je rencontre un problème pour la mise en place exceptions pour custom side-bar

j'ai mis en place, grâce au code de warcozes une custom side-bar avec 3 menus.

- outils de développement
- market-place
- clear front end

je voudrais que les 2 premiers soit masqué pour les non admin.

j'ai utilisé l'option `- is_admin: true`

mais c'est pas bon, tout disparait pour tout le monde.

```auto
exceptions:
  - is_admin: true
    order:
      - new_item: true
        item: "Clear Frontend Cache"
        icon: "mdi:cached"
        bottom: true
        order: 0
        on_click:
          action: 'javascript'
          code: |
          const event = new CustomEvent(
            'll-custom',
            {
              detail: {
                uix: {
                  action: 'clear_cache'
                }
              }
            }
            );
           document.dispatchEvent(event);  
        
      - new_item: true
        item: "Outils de développement"
        icon: "mdi:tools"
        href: "/config/developer-tools"
        bottom: true
        order: 1

      - new_item: true
        item: "Marketplace"
        href: /marketplace
        icon: mdi:store
        notification: |
        [[[
          const outdated = Object.values(entities.update).filter(
            (entity) => entity.platform === 'marketplace' && is_state(entity.entity_id, 'on')
          );
          return outdated.length || '';
        ]]]
        icon_color: |
        [[[
          const outdated = Object.values(entities.update).filter(
            (entity) => entity.platform === 'marketplace' && is_state(entity.entity_id, 'on')
          );
          return outdated.length > 0 ? 'rgba(255,0,0,1)' : 'rgba(0,128,0,1)';
        ]]]
        icon_color_selected: |
        [[[
          const outdated = Object.values(entities.update).filter(
            (entity) => entity.platform === 'marketplace' && is_state(entity.entity_id, 'on')
          );
          return outdated.length > 0 ? 'rgba(255,0,0,1)' : 'rgba(0,128,0,1)';
        ]]]
        item_background_hover: |
        [[[
          const outdated = Object.values(entities.update).filter(
            (entity) => entity.platform === 'marketplace' && is_state(entity.entity_id, 'on')
          );
          return outdated.length > 0 ? 'rgba(255,0,0,1)' : 'rgba(0,128,0,1)';
        ]]]
        item_background_hover_opacity: |
        [[[
          const outdated = Object.values(entities.update).filter(
            (entity) => entity.platform === 'marketplace' && is_state(entity.entity_id, 'on')
          );
          return outdated.length > 0 ? '0.4' : '0.2';
        ]]]
        selection_opacity: |
        [[[
          const outdated = Object.values(entities.update).filter(
            (entity) => entity.platform === 'marketplace' && is_state(entity.entity_id, 'on')
          );
          return outdated.length > 0 ? '0.4' : '0.2';
        ]]]
        bottom: true  
        order: 2
	

```

j'ai essayé de suivre la Doc fourni par warcozes, mais je suis nul en yaml.  
je dois louper quelque chose, merci pour votre aide.

> **[Short Configuration Example​ - Exceptions | Custom Sidebar Docs](https://elchininet.github.io/custom-sidebar/configuration/exceptions#short-configuration-example)**
>
> You can define user/device-specific options using the exceptions feature. Creating an exception basically means starting a new configuration different from the main one when certian matchers match. If multiple exceptions match with the current...

---

<div class="post-metadata">

**Author:** ![WarC0zes](https://forum.hacf.fr/user_avatar/forum.hacf.fr/warc0zes/32/137471_2.png) [@WarC0zes](https://forum.hacf.fr/u/WarC0zes)\
**Post date:** [Décembre 2, 2026, 3:36 UTC](https://forum.hacf.fr/t/probleme-exception-dans-custom-side-bar/86301/2 "2026-12-02T03:36:50Z")

</div>

Salut,  
Teste ce code. Tu fais ta configuration des orders avant l'exception et tu ajoutes l'exception après. Les non-admin, vois la configuration des orders, mais pas pour outils de dev et marketplace.

```auto
exceptions:
  - is_admin: false
    extend_from: base
    order:
      - item: "Outils de développement"
        hide: true
      - item: "Marketplace"
        hide: true

```

Sinon, l'inverse, tu mets que pour admin, avec l'item Outils de dev et Marketplace. L'item Clear Frontend Cache, tu le mets dans l'order principal.

```auto
exceptions:
  - is_admin: true
    extend_from: base
    order:
      - new_item: true
        item: "Outils de développement"
        # ton href / icon / name habituels
      - new_item: true
        item: "Marketplace"
        # ton href / icon / name habituels

```

PS : Outils de développement est devenu Outils. 😅

```auto
  - new_item: true
    item: "Outils"
    icon: "mdi:tools"
    href: "/config/tools"
    bottom: true
    order: 1

```

 ![image](https://forum.hacf.fr/uploads/default/original/3X/2/6/265e86f0ce1750a188e38087bfa2d9bedd0f078c.png)  
 ![image](https://forum.hacf.fr/uploads/default/original/3X/a/9/a9c35b9a0a454749421aec5d75e4a0a7a390a3c7.png)

---

<div class="post-metadata">

**Author:** ![pascal\_ha](https://forum.hacf.fr/user_avatar/forum.hacf.fr/pascal_ha/32/10823_2.png) [@pascal\_ha](https://forum.hacf.fr/u/pascal_ha)\
**Post date:** [Décembre 2, 2026, 4:29 UTC](https://forum.hacf.fr/t/probleme-exception-dans-custom-side-bar/86301/3 "2026-12-02T16:29:19Z")

</div>

Merci Warc0zes

Je viens de mettre en place, je test et te tiens au courant.

J'ai corrigé pour les outils 😆

---

<div class="post-metadata">

**Author:** ![WarC0zes](https://forum.hacf.fr/user_avatar/forum.hacf.fr/warc0zes/32/137471_2.png) [@WarC0zes](https://forum.hacf.fr/u/WarC0zes)\
**Post date:** [Décembre 2, 2026, 4:31 UTC](https://forum.hacf.fr/t/probleme-exception-dans-custom-side-bar/86301/4 "2026-12-02T16:31:15Z")

</div>

La deuxième façon sera mieux, je pense. Comme ça, il n'y a que l'admin qui aura les items créés, pour les autres ils ne le seront pas.

> [@WarC0zes](#):
>
> Sinon, l'inverse, tu mets que pour admin, avec l'item Outils de dev et Marketplace. L'item Clear Frontend Cache, tu le mets dans l'order principal.
> 
> ```yaml
> exceptions:
> - is_admin: true
> extend_from: base
> order:
> - new_item: true
> item: "Outils de développement"
> # ton href / icon / name habituels
> - new_item: true
> item: "Marketplace"
> # ton href / icon / name habituels
> 
> ```

---

<div class="post-metadata">

**Author:** ![pascal\_ha](https://forum.hacf.fr/user_avatar/forum.hacf.fr/pascal_ha/32/10823_2.png) [@pascal\_ha](https://forum.hacf.fr/u/pascal_ha)\
**Post date:** [Décembre 2, 2026, 4:57 UTC](https://forum.hacf.fr/t/probleme-exception-dans-custom-side-bar/86301/5 "2026-12-02T16:57:40Z")

</div>

Salut

J'ai essayé la version 2, mais pareil tout disparaît :  
(il y a peut être un problème indexation sur le marketplace)  
PS: c'est bien cela, problème indexation 😠 Maintenant les deux versions fonctionnent  
le Yaml ci dessous est corrigé.

```auto
order:
  - new_item: true
    item: "Clear Frontend Cache"
    icon: "mdi:cached"
    bottom: true
    order: 0
    on_click:
      action: 'javascript'
      code: |
          const event = new CustomEvent(
            'll-custom',
            {
              detail: {
                uix: {
                  action: 'clear_cache'
                }
              }
            }
            );
           document.dispatchEvent(event);        
exceptions:
  - is_admin: true
    extend_from: base
    order:
      - new_item: true
        item: "Outils"
       # ton href / icon / name habituels
        icon: "mdi:tools"
        href: "/config/tools"
        bottom: true
        order: 1

      - new_item: true
        item: "Marketplace"
        # ton href / icon / name habituels
        href: /marketplace
        icon: mdi:store
        notification: |
            [[[
              const outdated = Object.values(entities.update).filter(
                (entity) => entity.platform === 'marketplace' && is_state(entity.entity_id, 'on')
              );
              return outdated.length || '';
            ]]]
        icon_color: |
            [[[
              const outdated = Object.values(entities.update).filter(
                (entity) => entity.platform === 'marketplace' && is_state(entity.entity_id, 'on')
              );
              return outdated.length > 0 ? 'rgba(255,0,0,1)' : 'rgba(0,128,0,1)';
            ]]]
        icon_color_selected: |
            [[[
              const outdated = Object.values(entities.update).filter(
                (entity) => entity.platform === 'marketplace' && is_state(entity.entity_id, 'on')
              );
              return outdated.length > 0 ? 'rgba(255,0,0,1)' : 'rgba(0,128,0,1)';
            ]]]
        item_background_hover: |
            [[[
              const outdated = Object.values(entities.update).filter(
                (entity) => entity.platform === 'marketplace' && is_state(entity.entity_id, 'on')
              );
              return outdated.length > 0 ? 'rgba(255,0,0,1)' : 'rgba(0,128,0,1)';
            ]]]
        item_background_hover_opacity: |
            [[[
              const outdated = Object.values(entities.update).filter(
                (entity) => entity.platform === 'marketplace' && is_state(entity.entity_id, 'on')
              );
              return outdated.length > 0 ? '0.4' : '0.2';
            ]]]
        selection_opacity: |
            [[[
              const outdated = Object.values(entities.update).filter(
                (entity) => entity.platform === 'marketplace' && is_state(entity.entity_id, 'on')
              );
              return outdated.length > 0 ? '0.4' : '0.2';
            ]]]
        bottom: true  
        order: 2

```

Je test la première version :  
Cela fonctionne correctement

```auto
order:
  - new_item: true
    item: "Clear Frontend Cache"
    icon: "mdi:cached"
    bottom: true
    order: 0
    on_click:
      action: 'javascript'
      code: |
          const event = new CustomEvent(
            'll-custom',
            {
              detail: {
                uix: {
                  action: 'clear_cache'
                }
              }
            }
            );
           document.dispatchEvent(event);  
        
  - new_item: true
    item: "Outils"
    icon: "mdi:tools"
    href: "/config/tools"
    bottom: true
    order: 1

  - new_item: true
    item: "Marketplace"
    href: /marketplace
    icon: mdi:store
    notification: |
        [[[
          const outdated = Object.values(entities.update).filter(
            (entity) => entity.platform === 'marketplace' && is_state(entity.entity_id, 'on')
          );
          return outdated.length || '';
        ]]]
    icon_color: |
        [[[
          const outdated = Object.values(entities.update).filter(
            (entity) => entity.platform === 'marketplace' && is_state(entity.entity_id, 'on')
          );
          return outdated.length > 0 ? 'rgba(255,0,0,1)' : 'rgba(0,128,0,1)';
        ]]]
    icon_color_selected: |
        [[[
          const outdated = Object.values(entities.update).filter(
            (entity) => entity.platform === 'marketplace' && is_state(entity.entity_id, 'on')
          );
          return outdated.length > 0 ? 'rgba(255,0,0,1)' : 'rgba(0,128,0,1)';
        ]]]
    item_background_hover: |
        [[[
          const outdated = Object.values(entities.update).filter(
            (entity) => entity.platform === 'marketplace' && is_state(entity.entity_id, 'on')
          );
          return outdated.length > 0 ? 'rgba(255,0,0,1)' : 'rgba(0,128,0,1)';
        ]]]
    item_background_hover_opacity: |
        [[[
          const outdated = Object.values(entities.update).filter(
            (entity) => entity.platform === 'marketplace' && is_state(entity.entity_id, 'on')
          );
          return outdated.length > 0 ? '0.4' : '0.2';
        ]]]
    selection_opacity: |
        [[[
          const outdated = Object.values(entities.update).filter(
            (entity) => entity.platform === 'marketplace' && is_state(entity.entity_id, 'on')
          );
          return outdated.length > 0 ? '0.4' : '0.2';
        ]]]
    bottom: true  
    order: 2
exceptions:
  - is_admin: false
    extend_from: base
    order:
      - item: "Outils"
        hide: true
      - item: "Marketplace"
        hide: true

```

---

<div class="post-metadata">

**Author:** ![WarC0zes](https://forum.hacf.fr/user_avatar/forum.hacf.fr/warc0zes/32/137471_2.png) [@WarC0zes](https://forum.hacf.fr/u/WarC0zes)\
**Post date:** [Décembre 2, 2026, 5:42 UTC](https://forum.hacf.fr/t/probleme-exception-dans-custom-side-bar/86301/6 "2026-12-02T17:42:54Z")

</div>

![image](https://forum.hacf.fr/uploads/default/original/3X/d/9/d9da65b5588a60b325e305a21fd39b763666ac48.png)

Si ça t'intéresse, voici une version pour avoir que les mises à jour du core, supervisor, OS, esphome, application, sans les mises à jour du marketplace incluses dans l'icône paramètre :

```auto
order:
  - item: "Paramètres"
    hide: true
  - new_item: true
    item: "custom_settings"
    name: "Paramètres"
    href: "/config"
    icon: "mdi:cog"
    notification: |
      [[[
        const updates = Object.values(entities.update).filter(
          (entity) =>
            entity.platform !== 'marketplace' &&
            is_state(entity.entity_id, 'on')
        );
        const activeIssues = parseInt(states('sensor.active_issues') || 0, 10);
        const total = updates.length + activeIssues;
        return total > 0 ? total : '';
      ]]]
    icon_color: |
      [[[
        const updates = Object.values(entities.update).filter(
          (entity) =>
            entity.platform !== 'marketplace' &&
            is_state(entity.entity_id, 'on')
        );
        const activeIssues = parseInt(states('sensor.active_issues') || 0, 10);
        const total = updates.length + activeIssues;
        return total > 0 ? 'rgba(255,0,0,1)' : 'rgba(0,128,0,1)';
      ]]]
    icon_color_selected: |
      [[[
        const updates = Object.values(entities.update).filter(
          (entity) =>
            entity.platform !== 'marketplace' &&
            is_state(entity.entity_id, 'on')
        );
        const activeIssues = parseInt(states('sensor.active_issues') || 0, 10);
        const total = updates.length + activeIssues;
        return total > 0 ? 'rgba(255,0,0,1)' : 'rgba(0,128,0,1)';
      ]]]
    item_background_hover: |
      [[[
        const updates = Object.values(entities.update).filter(
          (entity) =>
            entity.platform !== 'marketplace' &&
            is_state(entity.entity_id, 'on')
        );
        const activeIssues = parseInt(states('sensor.active_issues') || 0, 10);
        const total = updates.length + activeIssues;
        return total > 0 ? 'rgba(255,0,0,1)' : 'rgba(0,128,0,1)';
      ]]]
    item_background_hover_opacity: |
      [[[
        const updates = Object.values(entities.update).filter(
          (entity) =>
            entity.platform !== 'marketplace' &&
            is_state(entity.entity_id, 'on')
        );
        const activeIssues = parseInt(states('sensor.active_issues') || 0, 10);
        const total = updates.length + activeIssues;
        return total > 0 ? '0.35' : '0.3';
      ]]]
    selection_opacity: |
      [[[
        const updates = Object.values(entities.update).filter(
          (entity) =>
            entity.platform !== 'marketplace' &&
            is_state(entity.entity_id, 'on')
        );
        const activeIssues = parseInt(states('sensor.active_issues') || 0, 10);
        const total = updates.length + activeIssues;
        return total > 0 ? '0.4' : '0.2';
      ]]]
    bottom: true
    order: 4

```

---

<div class="post-metadata">

**Author:** ![pascal\_ha](https://forum.hacf.fr/user_avatar/forum.hacf.fr/pascal_ha/32/10823_2.png) [@pascal\_ha](https://forum.hacf.fr/u/pascal_ha)\
**Post date:** [Décembre 2, 2026, 6:13 UTC](https://forum.hacf.fr/t/probleme-exception-dans-custom-side-bar/86301/7 "2026-12-02T18:13:30Z")

</div>

Ok merci

Je vais regarder cela, ce week-end 😉
