{"id":4228,"date":"2021-01-17T17:22:02","date_gmt":"2021-01-17T16:22:02","guid":{"rendered":"https:\/\/www.fanjoe.be\/?p=4228"},"modified":"2021-01-17T17:22:13","modified_gmt":"2021-01-17T16:22:13","slug":"utiliser-sequematic-pour-connaitre-letat-dun-element-domotique-wifi-pilote-par-tuya-smart-life","status":"publish","type":"post","link":"https:\/\/www.fanjoe.be\/?p=4228","title":{"rendered":"Utiliser SEQUEmatic pour connaitre l\u2019\u00e9tat d\u2019un \u00e9l\u00e9ment domotique WiFi pilot\u00e9 par Tuya \/ Smart Life"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">Introduction<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Dans un <a href=\"https:\/\/www.fanjoe.be\/?p=4008\" target=\"_blank\" aria-label=\"pr\u00e9c\u00e9dent article (opens in a new tab)\" rel=\"noreferrer noopener\" class=\"ek-link\">pr\u00e9c\u00e9dent article<\/a>, j&rsquo;avais indiqu\u00e9 une m\u00e9thode pour connaitre l&rsquo;\u00e9tat d&rsquo;un \u00e9l\u00e9ment domotique WiFi pilot\u00e9 par Tuya \/ Smart Life \u00e0 l&rsquo;aide d&rsquo;un petit script qui allait interroger les serveurs de Tuya. Malheureusement, le service \u00e0 impos\u00e9 un d\u00e9lais de 10 minutes entre chaque demande, sous peine de se voir retourner un message d&rsquo;erreur.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">C&rsquo;est une chose que sait maintenant faire <a href=\"https:\/\/sequematic.com\/\" target=\"_blank\" aria-label=\"SEQUEmatic (opens in a new tab)\" rel=\"noreferrer noopener\" class=\"ek-link\">SEQUEmatic<\/a>, nous allons voir comment.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">R\u00e9alisation<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">Pr\u00e9requis<\/h2>\n\n\n\n<div class=\"wp-block-media-text alignwide is-stacked-on-mobile\" style=\"grid-template-columns:17% auto\"><figure class=\"wp-block-media-text__media\"><img loading=\"lazy\" decoding=\"async\" width=\"175\" height=\"175\" data-attachment-id=\"4238\" data-permalink=\"https:\/\/www.fanjoe.be\/?attachment_id=4238\" data-orig-file=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-05.png\" data-orig-size=\"460,460\" data-comments-opened=\"1\" data-image-title=\"SEQUEmatic-SmartLife-05\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-05.png\" src=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-05-175x175.png\" alt=\"\" class=\"wp-image-4238 size-thumbnail\" srcset=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-05-175x175.png 175w, https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-05-300x300.png 300w, https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-05-100x100.png 100w, https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-05.png 460w\" sizes=\"auto, (max-width: 175px) 100vw, 175px\" \/><\/figure><div class=\"wp-block-media-text__content\">\n<p class=\"wp-block-paragraph\">Nous partons du principe que vous avez d\u00e9j\u00e0 connect\u00e9 un p\u00e9riph\u00e9rique domotique \u00e0 votre compte et application <a rel=\"noreferrer noopener\" href=\"https:\/\/apps.apple.com\/fr\/app\/smart-life-smart-living\/id1115101477\" target=\"_blank\">SmartLife<\/a>.<\/p>\n<\/div><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">C\u00f4t\u00e9 SEQUEmatic<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Si ce n&rsquo;est d\u00e9j\u00e0 fait, cr\u00e9ez-vous un compte utilisateur sur <a aria-label=\"SEQUEmatic (opens in a new tab)\" href=\"https:\/\/sequematic.com\/\" target=\"_blank\" rel=\"noreferrer noopener\" class=\"ek-link\">SEQUEmatic<\/a>. C&rsquo;est un service gratuit, g\u00e9r\u00e9 par un passionn\u00e9, qui se d\u00e9veloppe et acquiert r\u00e9guli\u00e8rement de nouvelles fonctions.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Ex\u00e9cution d&rsquo;une s\u00e9quence<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Sur le <a aria-label=\" (opens in a new tab)\" href=\"https:\/\/sequematic.com\/dashboard\" target=\"_blank\" rel=\"noreferrer noopener\" class=\"ek-link\">Dashboard<\/a>, nous allons cr\u00e9er une nouvelle s\u00e9quence :<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"620\" height=\"134\" data-attachment-id=\"4229\" data-permalink=\"https:\/\/www.fanjoe.be\/?attachment_id=4229\" data-orig-file=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-01.png\" data-orig-size=\"992,214\" data-comments-opened=\"1\" data-image-title=\"SEQUEmatic-SmartLife-01\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-01-620x134.png\" src=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-01-620x134.png\" alt=\"\" class=\"wp-image-4229\" srcset=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-01-620x134.png 620w, https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-01-300x65.png 300w, https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-01-175x38.png 175w, https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-01.png 992w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Nous allons lui donner un nom et une description facultative :<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"620\" height=\"158\" data-attachment-id=\"4231\" data-permalink=\"https:\/\/www.fanjoe.be\/?attachment_id=4231\" data-orig-file=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-02.png\" data-orig-size=\"992,253\" data-comments-opened=\"1\" data-image-title=\"SEQUEmatic-SmartLife-02\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-02-620x158.png\" src=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-02-620x158.png\" alt=\"\" class=\"wp-image-4231\" srcset=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-02-620x158.png 620w, https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-02-300x77.png 300w, https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-02-175x45.png 175w, https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-02.png 992w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Ensuite, nous allons cr\u00e9er un \u00ab\u00a0webhook\u00a0\u00bb. C&rsquo;est une URL qui va d\u00e9clencher une action sur SEQUEmatic. En l&rsquo;occurence, la lecture de l&rsquo;\u00e9tat de notre lampe LED et son stockage dans une variable.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On clique sur l&rsquo;ic\u00f4ne de la petite prise, on s\u00e9lectionne \u00ab\u00a0Custom webhook\u00a0\u00bb, on laisse les param\u00e8tres par d\u00e9faut sur le Schema 1 et on enregistre.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"620\" height=\"527\" data-attachment-id=\"4234\" data-permalink=\"https:\/\/www.fanjoe.be\/?attachment_id=4234\" data-orig-file=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-03.png\" data-orig-size=\"992,843\" data-comments-opened=\"1\" data-image-title=\"SEQUEmatic-SmartLife-03\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-03-620x527.png\" src=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-03-620x527.png\" alt=\"\" class=\"wp-image-4234\" srcset=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-03-620x527.png 620w, https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-03-300x255.png 300w, https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-03-175x149.png 175w, https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-03.png 992w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">L&rsquo;URL est maintenant cr\u00e9\u00e9e. Il faut encore ajouter les diff\u00e9rents pas de la s\u00e9quence :<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"620\" height=\"189\" data-attachment-id=\"4237\" data-permalink=\"https:\/\/www.fanjoe.be\/?attachment_id=4237\" data-orig-file=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-04.png\" data-orig-size=\"992,303\" data-comments-opened=\"1\" data-image-title=\"SEQUEmatic-SmartLife-04\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-04-620x189.png\" src=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-04-620x189.png\" alt=\"\" class=\"wp-image-4237\" srcset=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-04-620x189.png 620w, https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-04-300x92.png 300w, https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-04-175x53.png 175w, https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-04.png 992w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">On s\u00e9lectionne \u00ab\u00a0Add step\u00a0\u00bb, puis la petite lampe des \u00ab\u00a0Devices\u00a0\u00bb, ensuite \u00ab\u00a0Tuya Smart Life device status\u00a0\u00bb et enfin, le status \u00ab\u00a0On\u00a0\u00bb (l&rsquo;\u00e9tat de la variable qu&rsquo;on va traiter) :<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"620\" height=\"458\" data-attachment-id=\"4245\" data-permalink=\"https:\/\/www.fanjoe.be\/?attachment_id=4245\" data-orig-file=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-06.png\" data-orig-size=\"992,732\" data-comments-opened=\"1\" data-image-title=\"SEQUEmatic-SmartLife-06\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-06-620x458.png\" src=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-06-620x458.png\" alt=\"\" class=\"wp-image-4245\" srcset=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-06-620x458.png 620w, https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-06-300x221.png 300w, https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-06-175x129.png 175w, https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-06.png 992w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">La validation de l&rsquo;\u00e9tape pr\u00e9c\u00e9dente va nous cr\u00e9er un cas : si\/sinon ou if\/else.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On va alors dire que :<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>SI l&rsquo;\u00e9tat est \u00ab\u00a0ON\u00a0\u00bb, on cr\u00e9e une variable \u00ab\u00a0etat_lampe_bureau\u00a0\u00bb et on la mets \u00e0 la valeur \u00ab\u00a01\u00a0\u00bb.<\/li><li>SINON, on mets la variable \u00ab\u00a0etat_lampe_bureau\u00a0\u00bb \u00e0 la valeur \u00ab\u00a00\u00a0\u00bb.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"620\" height=\"463\" data-attachment-id=\"4253\" data-permalink=\"https:\/\/www.fanjoe.be\/?attachment_id=4253\" data-orig-file=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-07.png\" data-orig-size=\"992,740\" data-comments-opened=\"1\" data-image-title=\"SEQUEmatic-SmartLife-07\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-07-620x463.png\" src=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-07-620x463.png\" alt=\"\" class=\"wp-image-4253\" srcset=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-07-620x463.png 620w, https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-07-300x224.png 300w, https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-07-175x131.png 175w, https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-07.png 992w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Ce qui, au final, nous donne ceci :<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"620\" height=\"409\" data-attachment-id=\"4254\" data-permalink=\"https:\/\/www.fanjoe.be\/?attachment_id=4254\" data-orig-file=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-08.png\" data-orig-size=\"992,654\" data-comments-opened=\"1\" data-image-title=\"SEQUEmatic-SmartLife-08\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-08-620x409.png\" src=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-08-620x409.png\" alt=\"\" class=\"wp-image-4254\" srcset=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-08-620x409.png 620w, https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-08-300x198.png 300w, https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-08-175x115.png 175w, https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-08.png 992w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Et pour finir, nous allons activer notre s\u00e9quence :<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"620\" height=\"57\" data-attachment-id=\"4255\" data-permalink=\"https:\/\/www.fanjoe.be\/?attachment_id=4255\" data-orig-file=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-09.png\" data-orig-size=\"992,91\" data-comments-opened=\"1\" data-image-title=\"SEQUEmatic-SmartLife-09\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-09-620x57.png\" src=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-09-620x57.png\" alt=\"\" class=\"wp-image-4255\" srcset=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-09-620x57.png 620w, https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-09-300x28.png 300w, https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-09-175x16.png 175w, https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-09.png 992w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Lecture de la variable<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Une fois que l&rsquo;on appelle le webhook par son URL, la s\u00e9quence se d\u00e9clenche, mais ne fournit pas de r\u00e9sultat. Il va alors falloir lire le contenu de la variable sur laquelle nous venons de travailler.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On retourne sur le Dashboard et on s\u00e9lectionne \u00ab\u00a0Variables\u00a0\u00bb :<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"620\" height=\"138\" data-attachment-id=\"4257\" data-permalink=\"https:\/\/www.fanjoe.be\/?attachment_id=4257\" data-orig-file=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-11.png\" data-orig-size=\"992,220\" data-comments-opened=\"1\" data-image-title=\"SEQUEmatic-SmartLife-11\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-11-620x138.png\" src=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-11-620x138.png\" alt=\"\" class=\"wp-image-4257\" srcset=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-11-620x138.png 620w, https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-11-300x67.png 300w, https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-11-175x39.png 175w, https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-11.png 992w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Dans la liste des variables, on clique sur la petite prise en regard du nom de la variable qui a \u00e9t\u00e9 cr\u00e9\u00e9e pr\u00e9c\u00e9demment :<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"620\" height=\"209\" data-attachment-id=\"4256\" data-permalink=\"https:\/\/www.fanjoe.be\/?attachment_id=4256\" data-orig-file=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-10.png\" data-orig-size=\"992,335\" data-comments-opened=\"1\" data-image-title=\"SEQUEmatic-SmartLife-10\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-10-620x209.png\" src=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-10-620x209.png\" alt=\"\" class=\"wp-image-4256\" srcset=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-10-620x209.png 620w, https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-10-300x100.png 300w, https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-10-175x59.png 175w, https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-10.png 992w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">La premi\u00e8re URL (Get value) va nous retourner l&rsquo;\u00e9tat de notre variable apr\u00e8s que notre s\u00e9quence ait \u00e9t\u00e9 lire son \u00e9tat :<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"620\" height=\"214\" data-attachment-id=\"4258\" data-permalink=\"https:\/\/www.fanjoe.be\/?attachment_id=4258\" data-orig-file=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-12.png\" data-orig-size=\"992,342\" data-comments-opened=\"1\" data-image-title=\"SEQUEmatic-SmartLife-12\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-12-620x214.png\" src=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-12-620x214.png\" alt=\"\" class=\"wp-image-4258\" srcset=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-12-620x214.png 620w, https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-12-300x103.png 300w, https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-12-175x60.png 175w, https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-12.png 992w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Script<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Voici un petit script qui nous permet de lire l&rsquo;\u00e9tat de notre lampe :<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n#!\/bin\/bash\n\n# Adresse IP de la lampe sur le r\u00e9seau local\nIP=&quot;XX.XX.XX.XX&quot;\n\n# -q param\u00e8tre du mode silencieux\n# -c nombre de pings \u00e0 effectuer\nping -q -c1 -W1 $IP &gt; \/dev\/null\n\n\nif &#x5B; $? -eq 0 ];\t\t\t# Si le r\u00e9sultat du ping est vrai =&gt; Donc si le device est trouv\u00e9\nthen\n\n\t# On va lire l&#039;\u00e9tat de la lampe et le stoker dans une variable sur Sequematic\n\tcurl --silent &quot;https:\/\/sequematic.com\/trigger-custom-webhook\/XXXXXXXXXX\/XXXXX&quot; &gt; \/dev\/null\n\n\t# On va lire la variable sur Sequematic\n\tCurlResult=$(curl --silent &quot;https:\/\/sequematic.com\/variable-get\/XXX\/XXXXXXXXXX\/etat_lampe_bureau&quot;)\n\n\tif &#x5B; $CurlResult -eq 0 ] || &#x5B; $CurlResult -eq 1 ];\n\tthen\n\n\t\tLightState=$CurlResult\n\n\tfi\n\nelse\n\n\tLightState=2\n\nfi\n\ncase $LightState in\n\n\t0)\n\techo &quot;Lampe \u00e9teinte&quot;\t\t\n\t;;\n\n\t1)\n\techo &quot;Lampe allum\u00e9e&quot;\n\t;;\n\n\t*)\n\techo &quot;Erreur !&quot;\n\t;;\n\nesac\n\n<\/pre><\/div>\n\n\n<h1 class=\"wp-block-heading\">Conclusion<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Par cette m\u00e9thode, il est possible de lire tous les param\u00e8tres d&rsquo;un \u00e9l\u00e9ment domotique via SEQUEmatic. Sa temp\u00e9rature de couleur, sa couleur, son intensit\u00e9, &#8230; Il suffit juste de charger quelques variables et de les lire par la suite.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Bon amusement ! \ud83d\ude09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction <\/p>\n<p class=\"wp-block-paragraph\">Dans un <a href=\"https:\/\/www.fanjoe.be\/?p=4008\" target=\"_blank\" aria-label=\"pr\u00e9c\u00e9dent article (opens in a new tab)\" rel=\"noreferrer noopener\" class=\"ek-link\">pr\u00e9c\u00e9dent article<\/a>, j&rsquo;avais indiqu\u00e9&#8230;<\/p>\n","protected":false},"author":1,"featured_media":4261,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","jetpack_post_was_ever_published":false},"categories":[179,10,3,12],"tags":[202,390,361,360,391],"class_list":["post-4228","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-domotique","category-geek","category-informatique","category-raspberrypi","tag-curl","tag-sequematic","tag-smart-life","tag-tuya","tag-webhook","end"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2021\/01\/SEQUEmatic-SmartLife-00.png","_links":{"self":[{"href":"https:\/\/www.fanjoe.be\/index.php?rest_route=\/wp\/v2\/posts\/4228","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fanjoe.be\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fanjoe.be\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fanjoe.be\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fanjoe.be\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4228"}],"version-history":[{"count":0,"href":"https:\/\/www.fanjoe.be\/index.php?rest_route=\/wp\/v2\/posts\/4228\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.fanjoe.be\/index.php?rest_route=\/wp\/v2\/media\/4261"}],"wp:attachment":[{"href":"https:\/\/www.fanjoe.be\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4228"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fanjoe.be\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4228"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fanjoe.be\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4228"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}