{"id":4248,"date":"2023-05-25T02:52:25","date_gmt":"2023-05-25T00:52:25","guid":{"rendered":"https:\/\/www.sigalou-domotique.fr\/?p=4248"},"modified":"2026-01-02T17:01:40","modified_gmt":"2026-01-02T15:01:40","slug":"signaler-un-defaut-sur-le-dashboard","status":"publish","type":"post","link":"https:\/\/www.sigalou-domotique.fr\/en\/signaler-un-defaut-sur-le-dashboard","title":{"rendered":"I visually report a defect on the dashboard"},"content":{"rendered":"<h3>Objective<\/h3>\r\n<ul>\r\n<li>Visually report a defect with a red icon on the dashboard<\/li>\r\n<li>Do not display anything when everything is fine<\/li>\r\n<\/ul>\r\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4249\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/icone.png\" alt=\"\" width=\"221\" height=\"115\" \/><\/p>\r\n<p><!--more--><\/p>\r\n<p>The example above shows on the left a concern to connect with the portal automation management cabinet, everything goes well on the right.<\/p>\r\n<p>Will not be treated here the way I get the information <em><strong>on<\/strong> <\/em>or <em><strong>off<\/strong> <\/em>but only its display.<\/p>\r\n<p>For an example, see: <a href=\"https:\/\/www.sigalou-domotique.fr\/en\/domotiser-son-portail\/#Bonus_Ping_pour_verifier_que_l%E2%80%99equipement_est_en_ligne\" target=\"_blank\" rel=\"noopener\">this paragraph<\/a>.<\/p>\r\n<p>For my example, the entity that gives me the information is: binary_sensor.ping_portal<\/p>\r\n<ul>\r\n<li><em><strong>on<\/strong> <\/em>= ping ok so everything is fine<\/li>\r\n<li><strong><em>off<\/em> <\/strong>= failure<\/li>\r\n<\/ul>\r\n<h3>Customise the icon to display<\/h3>\r\n<p>Customization is done in the file <a href=\"https:\/\/github.com\/sigalou\/home-assistant-config-fr\/blob\/main\/customize_glob.yaml\" target=\"_blank\" rel=\"noopener\">customized_glob.yaml<\/a><\/p>\r\n<p>Here is the code of my example, it will be valid for all entities that start with binary_sensor.ping_:<\/p>\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"yaml\">binary_sensor.ping_*: templates: icon: \"if (state === 'off') return 'mdi:close-network-outline'; else return 'mdi:void';\" icon_color: \"if (state === 'off') return '#ff0000'; else return '#00b300';\"<\/pre>\r\n<ul>\r\n<li><em>mdi:close-network-outline<\/em> corresponds to the icon with the cross symbolising the connection gap<\/li>\r\n<li><em>mdi:void<\/em> corresponds to an empty icon<\/li>\r\n<\/ul>\r\n<p>&nbsp;<\/p>","protected":false},"excerpt":{"rendered":"<p>Objective Visually report a defect with a red icon on the dashboard Display nothing when all is well<\/p>","protected":false},"author":1,"featured_media":4400,"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-4248","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\/4248","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=4248"}],"version-history":[{"count":0,"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/posts\/4248\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/media\/4400"}],"wp:attachment":[{"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/media?parent=4248"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/categories?post=4248"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/tags?post=4248"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}