{"id":3844,"date":"2023-05-04T19:59:09","date_gmt":"2023-05-04T17:59:09","guid":{"rendered":"https:\/\/www.sigalou-domotique.fr\/?p=3844"},"modified":"2026-01-02T17:02:13","modified_gmt":"2026-01-02T15:02:13","slug":"utilisation-de-la-carte-decluttering-card","status":"publish","type":"post","link":"https:\/\/www.sigalou-domotique.fr\/en\/utilisation-de-la-carte-decluttering-card","title":{"rendered":"Using the Decluttering Card"},"content":{"rendered":"<h3>Principle of Decluttering Card<\/h3>\r\n<p dir=\"auto\">We all use the same configuration block several times in our lovelace configuration and we don't want to change the same things in a hundred places in our configuration every time we want to change something.<\/p>\r\n<p dir=\"auto\">This card allows you to reuse the same configuration multiple times in your lovelace configuration to avoid repetitions and supports default variables and values.<!--more--><\/p>\r\n<h3 dir=\"auto\">Map reference\u00a0<\/h3>\r\n<p><a href=\"https:\/\/github.com\/custom-cards\/decluttering-card\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/custom-cards\/decluttering-card<\/a><\/p>\r\n<h3 dir=\"auto\">Map model definition (in UI)<\/h3>\r\n<p dir=\"auto\">The model declaration is done by adding a block <code>decluttering _templates:<\/code><\/p>\r\n<p dir=\"auto\">To add it: 3-point menu at the top right =&gt; Edit dashboard =&gt; RE 3-point menu at the top right =&gt; Configuration editor.<br \/>The block is to be placed BEFORE<strong> views:<\/strong><\/p>\r\n<p dir=\"auto\">For this example, I made it very very simple, I use only one variable, it is the id entity of the zone that will appear as [[zone]].<\/p>\r\n<pre>decluttering _templates:<br \/>  image_zone:<br \/>    element:<br \/>      type: image<br \/>      entity: '[[area]]'<br \/>      style:<br \/>        width: 100%<br \/>        top: 50%<br \/>        left: 50%<br \/>      state_image:<br \/>        'on': \/local\/house\/1920x1000\/[[zone]].png<br \/>        'off': \/local\/house\/1920x1000\/transparent.png<\/pre>\r\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3851\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/decl1.png\" alt=\"\" width=\"544\" height=\"281\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/decl1.png 544w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/decl1-300x155.png 300w\" sizes=\"auto, (max-width: 544px) 100vw, 544px\" \/><\/p>\r\n<h3>Call my _zone image model from the decluttering map<\/h3>\r\n<p>It is therefore sufficient to use 4 lines instead of 11 to display the map of an area; as I have 12 areas, the interest is obvious.<\/p>\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">- type: custom:decluttering-card template: image_zone variables: - area: light.light_chambre_parents<\/pre>\r\n<h3>Edit \/ Bonus, evolution\u00a0<\/h3>\r\n<p>Since the creation of the tutorial, I have further improved my decluttering cards, here are the codes.<\/p>\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">decluttering _templates: image_zone: element: type: image entity: '[[zone]]' style: width: 100% top: 50% left: 50% state_image: 'on': \/local\/house\/1920x1000\/[[zone]].png 'off': \/local\/house\/1920x1000\/transparent.png image_binary _sensor: default: - bonuson: '' - bonusoff: '' - zoneoff: transparent element: type: image entity: '[[zone]]' tap_action: action: none style: width: 100% top: 50% left: 50% state_image: 'on': \/local\/house\/1920x1000\/[[zone]][[bonuson]].png 'off': \/local\/house\/1920x1000\/[[zoneoff]][[bonusoff]].png image_lock: default: - bonuson: '' - bonusoff: '' - zoneoff: transparent element: type: image entity: '[[zone]]' tap_action: action: none style: width: 100% top: 50% left: 50% state_image: locked: \/local\/house\/1920x1000\/[[zone]][[bonuson]].png unlocked: \/local\/house\/1920x1000\/[[zoneoff]][[bonusoff]].png<\/pre>\r\n<p>Then on the views:<\/p>\r\n<ul>\r\n<li>For the lights<\/li>\r\n<\/ul>\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">- type: custom:decluttering-card template: image_zone variables: - area: light.light_chambre_parents - type: custom:decluttering-card template: image_zone variables: - area: light.eclairage _ staircase_corridor - type: custom:decluttering-card template: image_zone variables: - area: light.light _de _la _salle _a _manger<\/pre>\r\n<ul>\r\n<li>For lock or binary _sensor<\/li>\r\n<\/ul>\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">- type: custom:decluttering-card template: _lock image variables: - area: lock.porte - zoneoff: lock.porte - bonuson: _close - bonusoff: _open - type: custom:decluttering-card template: image_binary _sensor variables: - area: binary_sensor.porte_dentree_contact - type: custom:decluttering-card template: image_binary _sensor variables: - area: binary_sensor.salle_de_bains_porte_contact - bonuson: _grise - type: custom:decluttering-card template: image_binary _sensor variables: - area: binary_sensor.volet_de_la_cuisine_contact - zoneoff: binary_sensor.volet_de_la_cuisine_contact - bonusoff: _close - type: custom:decluttering-card template: image_binary _sensor variables: - area: binary_sensor.petit_volet_de_la_salle_a_manger_contact - zoneoff: binary_sensor.petit_volet_de_la_salle_a_manger_contact - bonusoff: _close - type: custom:decluttering-card template: image_binary _sensor variables: - area: binary_sensor.grand_volet_de_la_salle_a_manger_contact - zoneoff: binary_sensor.grand_volet_de_la_salle_a_manger_contact - bonusoff: _close<\/pre>\r\n<p>&nbsp;<\/p>","protected":false},"excerpt":{"rendered":"<p>We all use the same setup block multiple times in our lovelace setup and we don't want to change the same things in a hundred places in our setup every time we want to change something. This card allows you to reuse several times the same configuration in your [...]<\/p>","protected":false},"author":1,"featured_media":3851,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[14,53,166],"tags":[81],"class_list":["post-3844","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-domotique","category-home-assistant","category-retex","tag-developpement"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/posts\/3844","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/comments?post=3844"}],"version-history":[{"count":0,"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/posts\/3844\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/media\/3851"}],"wp:attachment":[{"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/media?parent=3844"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/categories?post=3844"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/tags?post=3844"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}