{"id":19844,"date":"2023-10-10T03:13:48","date_gmt":"2023-10-10T02:13:48","guid":{"rendered":"https:\/\/elcb.net\/?post_type=api&#038;p=19844"},"modified":"2023-10-17T12:10:01","modified_gmt":"2023-10-17T11:10:01","slug":"tuya-smart-device-api","status":"publish","type":"api","link":"https:\/\/www.tongou.com\/es\/api\/tuya-smart-device-api\/","title":{"rendered":"Tongou tuya smart device API command set"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"19844\" class=\"elementor elementor-19844\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-c1e7a34 elementor-section-full_width elementor-section-height-default elementor-section-height-default\" data-id=\"c1e7a34\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-bf96bf8\" data-id=\"bf96bf8\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-abf8c19 elementor-widget elementor-widget-heading\" data-id=\"abf8c19\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<style>\/*! elementor - v3.23.0 - 05-08-2024 *\/\n.elementor-heading-title{padding:0;margin:0;line-height:1}.elementor-widget-heading .elementor-heading-title[class*=elementor-size-]>a{color:inherit;font-size:inherit;line-height:inherit}.elementor-widget-heading .elementor-heading-title.elementor-size-small{font-size:15px}.elementor-widget-heading .elementor-heading-title.elementor-size-medium{font-size:19px}.elementor-widget-heading .elementor-heading-title.elementor-size-large{font-size:29px}.elementor-widget-heading .elementor-heading-title.elementor-size-xl{font-size:39px}.elementor-widget-heading .elementor-heading-title.elementor-size-xxl{font-size:59px}<\/style><h1 class=\"elementor-heading-title elementor-size-default\">Tongou tuya smart device API command set<\/h1>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-e065572 elementor-widget elementor-widget-heading\" data-id=\"e065572\" data-element_type=\"widget\" id=\"Instructions-and-steps\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Instructions and Steps for Parsing RAW Type Data under the Device Status Set \u2018Code Phase_a, Phase_b, Phase_c\u2019 in the API Debugging of tongou Tuya smart breakers and circuit breakers Products on the Tuya IOT Platform\uff1a<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-566bcd2 elementor-widget elementor-widget-text-editor\" data-id=\"566bcd2\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<style>\/*! elementor - v3.23.0 - 05-08-2024 *\/\n.elementor-widget-text-editor.elementor-drop-cap-view-stacked .elementor-drop-cap{background-color:#69727d;color:#fff}.elementor-widget-text-editor.elementor-drop-cap-view-framed .elementor-drop-cap{color:#69727d;border:3px solid;background-color:transparent}.elementor-widget-text-editor:not(.elementor-drop-cap-view-default) .elementor-drop-cap{margin-top:8px}.elementor-widget-text-editor:not(.elementor-drop-cap-view-default) .elementor-drop-cap-letter{width:1em;height:1em}.elementor-widget-text-editor .elementor-drop-cap{float:left;text-align:center;line-height:1;font-size:50px}.elementor-widget-text-editor .elementor-drop-cap-letter{display:inline-block}<\/style>\t\t\t\t<p>In the rapidly evolving world of smart homes and industrial automation, the ability to efficiently parse and interpret data from devices is crucial. The Tuya API stands out as a beacon in this realm, offering insights into critical electrical parameters like current, voltage, and power. This article takes you on a journey through the intricacies of Tuya&#8217;s data points (DP) and the techniques employed for data extraction and interpretation.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-81c3eb5 elementor-widget elementor-widget-heading\" data-id=\"81c3eb5\" data-element_type=\"widget\" id=\"tuya-approach-to-electrical-data-points\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Tuya\u2019s Approach to Electrical Data Points<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-71aeac7 elementor-widget elementor-widget-text-editor\" data-id=\"71aeac7\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p><span style=\"color: var( --e-global-color-text );\">Tuya&#8217;s representation of electrical data points, specifically for current, voltage, and power, uses specific codes such as phase_a, phase_b, and phase_c. An example of this representation is &#8220;{code: &#8220;phase_a&#8221;, value: &#8220;COkAABUAAAU=&#8221;}&#8221;. But how do we decipher this value?<\/span><\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-e325453 elementor-widget elementor-widget-heading\" data-id=\"e325453\" data-element_type=\"widget\" id=\"data-aecoding-a-step-by-step-guide\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Data Decoding: A Step-by-Step Guide<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-adad0b8 elementor-widget elementor-widget-text-editor\" data-id=\"adad0b8\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Base64 Decoding: The first step involves translating the Base64 encoded data. There is online tool available:<\/p><p><a href=\"https:\/\/cryptii.com\/pipes\/base64-to-hex\" target=\"_blank\" rel=\"nofollow noopener\"><u>Base64 to hex: Encode and decode bytes online &#8211; cryptii<\/u>\u00a0<\/a><\/p><p>to assist in this decoding process.<img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone wp-image-19853 size-full\" src=\"https:\/\/elcb.net\/wp-content\/uploads\/2023\/10\/api-code-phase_a.jpg\" alt=\"\" width=\"1335\" height=\"358\" data-wp-editing=\"1\" srcset=\"https:\/\/www.tongou.com\/es\/wp-content\/uploads\/2023\/10\/api-code-phase_a.jpg 1335w, https:\/\/www.tongou.com\/es\/wp-content\/uploads\/2023\/10\/api-code-phase_a-300x80.jpg 300w, https:\/\/www.tongou.com\/es\/wp-content\/uploads\/2023\/10\/api-code-phase_a-1024x275.jpg 1024w, https:\/\/www.tongou.com\/es\/wp-content\/uploads\/2023\/10\/api-code-phase_a-768x206.jpg 768w, https:\/\/www.tongou.com\/es\/wp-content\/uploads\/2023\/10\/api-code-phase_a-847x227.jpg 847w, https:\/\/www.tongou.com\/es\/wp-content\/uploads\/2023\/10\/api-code-phase_a-600x161.jpg 600w\" sizes=\"(max-width: 1335px) 100vw, 1335px\" \/><\/p><p>Hexadecimal Representation: Once decoded, you might obtain a string like\u00a0<\/p><p><strong>\u201c08 e9 00 00 15 00 00 05\u201d<\/strong>.\u00a0<\/p><p><span style=\"color: var( --e-global-color-text );\">Utilizing programmer&#8217;s calculators, we can interpret this hexadecimal string.<\/span><\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-e49732f elementor-widget elementor-widget-heading\" data-id=\"e49732f\" data-element_type=\"widget\" id=\"interpreting-the-data\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Interpreting the Data:<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-d377499 elementor-widget elementor-widget-text-editor\" data-id=\"d377499\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<table style=\"border-collapse: collapse; width: 100%;\"><tbody><tr><td style=\"width: 33.3333%;\"><img decoding=\"async\" class=\"alignnone wp-image-19866 size-full\" src=\"https:\/\/elcb.net\/wp-content\/uploads\/2023\/10\/Interpreting-the-Data1.jpg\" alt=\"\" width=\"342\" height=\"399\" srcset=\"https:\/\/www.tongou.com\/es\/wp-content\/uploads\/2023\/10\/Interpreting-the-Data1.jpg 342w, https:\/\/www.tongou.com\/es\/wp-content\/uploads\/2023\/10\/Interpreting-the-Data1-257x300.jpg 257w\" sizes=\"(max-width: 342px) 100vw, 342px\" \/><\/td><td style=\"width: 33.3333%;\"><img decoding=\"async\" class=\"alignnone size-full wp-image-19867\" src=\"https:\/\/elcb.net\/wp-content\/uploads\/2023\/10\/Interpreting-the-Data2.jpg\" alt=\"\" width=\"338\" height=\"394\" srcset=\"https:\/\/www.tongou.com\/es\/wp-content\/uploads\/2023\/10\/Interpreting-the-Data2.jpg 338w, https:\/\/www.tongou.com\/es\/wp-content\/uploads\/2023\/10\/Interpreting-the-Data2-257x300.jpg 257w\" sizes=\"(max-width: 338px) 100vw, 338px\" \/><\/td><td style=\"width: 33.3333%;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-19868\" src=\"https:\/\/elcb.net\/wp-content\/uploads\/2023\/10\/Interpreting-the-Data3.jpg\" alt=\"\" width=\"343\" height=\"400\" srcset=\"https:\/\/www.tongou.com\/es\/wp-content\/uploads\/2023\/10\/Interpreting-the-Data3.jpg 343w, https:\/\/www.tongou.com\/es\/wp-content\/uploads\/2023\/10\/Interpreting-the-Data3-257x300.jpg 257w\" sizes=\"(max-width: 343px) 100vw, 343px\" \/><\/td><\/tr><\/tbody><\/table><p>The initial &#8220;08 e9&#8221; (2 bytes) represents voltage in volts (V). By converting it to its decimal representation and dividing by 10, we derive the voltage value as 228.1V\u00a0(2281\/10).<\/p><p>The next segment &#8220;00 00 15&#8221; (3 bytes) indicates current in amperes (A). Converting this to its decimal equivalent and dividing by 1000 gives us the current value of 0.021A\u00a0(21\/1000).<\/p><p>Lastly, the &#8220;00 00 05&#8221; segment (3 bytes) denotes power in watts (W). Its direct decimal equivalent reveals the power value as 5W.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-80ffb83 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"80ffb83\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-d5fb7d3\" data-id=\"d5fb7d3\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-0bfebf0 elementor-widget elementor-widget-wp-widget-smart_contact_box\" data-id=\"0bfebf0\" data-element_type=\"widget\" data-widget_type=\"wp-widget-smart_contact_box.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"tt-aside-content\">\n\t\t\t\t\t<ul class=\"box-aside-info\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/ul>\n\t\t\t\t\t\t\t\t\t\t<a href=\"#\" data-toggle=\"modal\" data-target=\"#modalMakeAppointment\" class=\"tt-btn btn__color01\">\t\t\t\t\t\t\t\t<span class=\"icon-lightning\"><\/span>\n\t\t\t\t\t\t\t\t Make an Appointment<\/a>\n\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"featured_media":0,"template":"","meta":{"_links_to":"","_links_to_target":""},"class_list":["post-19844","api","type-api","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.tongou.com\/es\/wp-json\/wp\/v2\/api\/19844","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tongou.com\/es\/wp-json\/wp\/v2\/api"}],"about":[{"href":"https:\/\/www.tongou.com\/es\/wp-json\/wp\/v2\/types\/api"}],"version-history":[{"count":0,"href":"https:\/\/www.tongou.com\/es\/wp-json\/wp\/v2\/api\/19844\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tongou.com\/es\/wp-json\/wp\/v2\/media?parent=19844"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}