Advertisement
Guest User

MagicHome TCP API

a guest
Nov 6th, 2020
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.27 KB | None | 0 0
  1. RGBW WIFI Bulb Command Definition
  2. Device Type Code:0x44 Version:0x04
  3. ---------------------------------------
  4. Command title Command Format
  5. 0x10 command of syncing time:
  6. Send 【0X10】+【0x14】+【10 digit and single digit of year】+【month】+【day】+【hour】+【minute】+【second】+【week】+【reserved for future use:0x0】+【0xF0 remote,0x0F local】+【check digit】(length of command:12)
  7.  
  8. Return 【0xF0 remote,0x0F local】+ 【0X10】+ 【0x00】+【check digit】(length of command:4)
  9. ---------------------------------------
  10. 0x11 command of requesting time :
  11. Send 【0X11】+【0X1A】+【0X1B】+【0xF0 remote,0x0F local】+【check digit】(length of command:5)
  12.  
  13. Return 【0xF0 remote,0x0F local】+【0X11】+【0x14】+【10 digit and single digit of year】+【month】+【day】+【hour】+【minute】+【second】+【week】+【reserved for future use:0x0】+【check digit】(length of command:12)
  14. ---------------------------------------
  15. 0x21 command of setting timing content:
  16. Send 【0X21】+
  17. 【Timer switch for time 1】+【10 digit and single digit of year for time 1】+【month for time 1】+【day for time 1】+【hour for time 1】+【minute for time 1】+【second for time 1】+【week for time 1】+【mode for time 1】+【32bit Value1~Value4 for time 1】+【switch for time 1】+
  18. 【Timer switch for time 2】+【10 digit and single digit of year for time 2】+【month for time 2】+【day for time 2】+【hour for time 2】+【minute for time 2】+【second for time 2】+【week for time 2】+【mode for time 2】+【32bit Value1~Value4 for time 2】+【switch for time 2】+
  19. 【Timer switch for time 3】+【10 digit and single digit of year for time 3】+【month for time 3】+【day for time 3】+【hour for time 3】+【minute for time 3】+【second for time 3】+【week for time 3】+【mode for time 3】+【32bit Value1~Value4 for time 3】+【switch for time 3】+
  20. 【Timer switch for time 4】+【10 digit and single digit of year for time 4】+【month for time 4】+【day for time 4】+【hour for time 4】+【minute for time 4】+【second for time 4】+【week for time 4】+【mode for time 3】+【32bit Value1~Value4 for time 4】+【switch for time 4】+
  21. 【Timer switch for time 5】+【10 digit and single digit of year for time 5】+【month for time 5】+【day for time 5】+【hour for time 5】+【minute for time 5】+【second for time 5】+【week for time 5】+【mode for time 5】+【32bit Value1~Value4 for time 5】+【switch for time 5】+
  22. 【Timer switch for time 6】+【10 digit and single digit of year for time 6】+【month for time 6】+【day for time 6】+【hour for time 6】+【minute for time 6】+【second for time 6】+【week for time 6】+【mode for time 6】+【32bit Value1~Value4 for time 6】+【switch for time 6】+
  23. 【Reserved bits:0x0】+【0xF0 remote,0x0F local】+【check digit】(length of command:88)
  24.  
  25. Return 【0xF0 remote,0x0F local】+ 【0X21】+ 【0x00】+【check digit】(length of command:4)
  26. "Note:Send command of timing content
  27. 1.when mode value is 0x61,value 1,2,3 and 4 means value of RGBW separately.In addition,RGB and W cannot lihgt together.In this command,either value of RGB or W must be 0.If both value of RGB and W are not 0,then W will be 0.
  28. 2.when mode value is 0x00,do not mind value 1~value 4.Bulbs'RGBW value will same as the previous.
  29. 3.when mode value is not 0x61,it is dynamic mode value.Value1 means speed,range is from 0x01 to 0x1f.
  30. 4.Timing available:when value is 0xF0,timing works;when value is 0x0F,timing doesn't work.
  31. 5.Timing switcher:when value is 0xF0,it means ""turn on"";when value is 0x0F,it means ""turn off""
  32. 6.Week:when setting cycle timing,bit0 is empty,bit 1~bit 7 correspond Monday,Tuesday,Wendnesday~Sunday.For example,bit 7 is Sunday.
  33. ---------------------------------------
  34. 0x22 command of requesting time content
  35. Send 【0X22】+【0X2A】+【0X2B】+【0xF0remote,0x0F local】+【check digit】(length of command:5)
  36.  
  37. Return 【0xF0 remote,0x0F local】+【0X22】+
  38. 【Timer switch for time 1】+【10 digit and single digit of year for time 1】+【month for time 1】+【day for time 1】+【hour for time 1】+【minute for time 1】+【second for time 1】+【week for time 1】+【mode for time 1】+【32bit Value1~Value4 for time 1】+【switch for time 1】+
  39. 【Timer switch for time 2】+【10 digit and single digit of year for time 2】+【month for time 2】+【day for time 2】+【hour for time 2】+【minute for time 2】+【second for time 2】+【week for time 2】+【mode for time 2】+【32bit Value1~Value4 for time 2】+【switch for time 2】+
  40. 【Timer switch for time 3】+【10 digit and single digit of year for time 3】+【month for time 3】+【day for time 3】+【hour for time 3】+【minute for time 3】+【second for time 3】+【week for time 3】+【mode for time 3】+【32bit Value1~Value4 for time 3】+【switch for time 3】+
  41. 【Timer switch for time 4】+【10 digit and single digit of year for time 4】+【month for time 4】+【day for time 4】+【hour for time 4】+【minute for time 4】+【second for time 4】+【week for time 4】+【mode for time 3】+【32bit Value1~Value4 for time 4】+【switch for time 4】+
  42. 【Timer switch for time 5】+【10 digit and single digit of year for time 5】+【month for time 5】+【day for time 5】+【hour for time 5】+【minute for time 5】+【second for time 5】+【week for time 5】+【mode for time 5】+【32bit Value1~Value4 for time 5】+【switch for time 5】+
  43. 【Timer switch for time 6】+【10 digit and single digit of year for time 6】+【month for time 6】+【day for time 6】+【hour for time 6】+【minute for time 6】+【second for time 6】+【week for time 6】+【mode for time 6】+【32bit Value1~Value4 for time 6】+【switch for time 6】+
  44. 【reserved for future use:0x0】+【check digit】(length of command:88)
  45. ---------------------------------------
  46. 0x31 command of setting color and color temperature
  47. Send 【0X31】+【8bit red data 】+【8bit green data】+【8bit blue data】+【8bit warm white data】+【8bit status sign】+【0xF0 remote,0x0F local】+【check digit】(length of command:8)
  48.  
  49. Return Local(0x0F):no return
  50. Remote(0xF0):【0xF0 remote】+ 【0X31】+【0x00】+【check digit】 Status sign:【0XF0】 means changing RGB,【0X0F】means W
  51. Note:phone send commands which control static color.Range of static color value is 00-0xff.When value is 0,PWM is 0%;when value is 0XFF,PWM is 100%;
  52. ---------------------------------------
  53. 0x41 command of setting color,color temperature(in music mode,this value will not be saved)
  54. Send 【0X41】+【8bit red value】+【8bit green data】+【8bit blue data】+【8bit warm white data】+【8bit status sign】+【0x0F local】+【check digit】(length of command:8)
  55.  
  56. Return No return
  57. Status sign:【0XF0】means changing RGB,【0X0F】means changing W
  58. ---------------------------------------
  59. 0x51 command of setting command of custom mode
  60. Send 【0X51】+【First point 32bit color value】+【Second point 32bit color value】+【Third point 32bit color value】+
  61. 【Fourth point 32bit color value】+【Fifth point 32bit color value】+【Sixth point 32bit color value】+
  62. 【Seventh point 32bit color value】+【Eighth point 32bit color value】+【Ninth point 32bit color value】+
  63. 【Tenth point 32bit color value】+【Eleventh point 32bit color value】+【Twelfth point 32bit color value】+
  64. 【Thirteenth point 32bit color value】+【Fourteenth point 32bit color value】+【Fifteenth point 32bit color value】+
  65. 【Sixteenth point 32bit color value】+【8bit speed value】+【8bit mode value】+
  66. 【0XFF】+【0xF0 remote,0x0F local】+【check digit】(length of command:55)"
  67.  
  68. Return "If command is local(0x0F):no return
  69. If command is remote (0xF0):【0xF0 remote】+ 【0X51】+【0x00】+【check digit】"
  70. Note:In command of custom mode,value of RGB cannot be 0x01,0x02,0x03.Otherwise,RGB is over.
  71. ---------------------------------------
  72. 0x52 command of requesting custom mode's content
  73. Send 【0X52】+【0X5A】+【0X5B】+【0xF0 remote,0x0F local】+【check digit】(length of command:5)
  74.  
  75. Return "【0xF0 remote,0x0F local】+【【0X52】+【First point 32bit color value】+【Second point 32bit color value】+【Third point 32bit color value】+
  76. 【Fourth point 32bit color value】+【Fifth point 32bit color value】+【Sixth point 32bit color value】+
  77. 【Seventh point 32bit color value】+【Eighth point 32bit color value】+【Ninth point 32bit color value】+
  78. 【Tenth point 32bit color value】+【Eleven point 32bit color value】+【Twelfth point 32bit color value】+
  79. 【Thirteenth point 32bit color value】+【Fourteenth point 32bit color value】+【Fifteenth point 32bit color value】+
  80. 【Sixteenth point 32bit color value】+【8bit speed value】+【8bit changing mode value】+
  81. 【0XFF】+【check digit】(length of command:70)"
  82. ---------------------------------------
  83. 0x61 command of setting builted-in mode
  84. Send 【0x61】+【8bit mode value】+【8bit speed value】+【0xF0 remote,0x0F local】+【check digit】(length of command:5)
  85. Return If command is local(0x0F):no return
  86. If command is remote (0xF0):【0xF0 remote】+ 【0X61】+【0x00】+【check digit】"
  87. Note:mode value refers to definition in the end of file,range of speed value is 0x01--0x1F
  88. ---------------------------------------
  89. 0x71 command of setting key's value(switcher command) command
  90.  
  91. Send 【0X71】+【8bit value】+【0xF0remote,0x0F local】+【check digit】(length of command:4)
  92. Reurn 【0xF0remote,0x0F local】+ 【0X71】+【switcher status value】+【check digit】
  93. Note:key value0x23 means "turn on",0x24 means "turn off"
  94. ---------------------------------------
  95. 0x81 command of requesting devices'status
  96. Send 【0X81】+【0X8A】+【0X8B】+【check digit】(length of comman:4)
  97.  
  98. Return 【0X81】+【8bit device name】+【8bit turn on/off】+【8bit mode value】+【8bit run/pause】+ 【8bit speed value】+【8bit red value】+【8bit green data】+【8bit blue data】+ 【8bit warm white data】+【version NO】+【8bit cool white data】+【8bit status sign】+【check digit】(length of command:14)
  99. "Note:when module received command of checking devices's status,module will reply,
  100. 【8bit turn on/off】:0x23 means turn on;0x24 means turn off
  101. 【8bit run/pause status】:0x20 means status in present,0x21 means pause status,it is unuseful in this item
  102. 【8bit speed value】means speed value of dynamic model,range:0x01-0x1f,0x01 is the fast
  103. Status sign:【0XF0】means RGB,【0X0F】means W"
  104. ---------------------------------------
  105. RGBW value definition
  106. COLOR R 0x00--0xFF
  107. G 0x00--0xFF
  108. B 0x00--0xFF
  109. W 0x00--0xFF
  110. C 0x00--0xFF
  111. SPEED SPEED 0x01--0x1F
  112. KEY PAUSE 0x20
  113. PLAY 0x21
  114. SWITCH 0x22
  115. POWER ON 0x23
  116. POWER OFF 0x24
  117. CHANGING gradual 0x3A
  118. jump 0x3B
  119. flash 0x3C
  120. MODE 1:7 colors gradual change 0x25
  121. 2:red gradual change 0x26
  122. 3:green gradual change 0x27
  123. 4:glue gradual change 0x28
  124. 5:yellow gradual change 0x29
  125. 6:cyan gradual change 0x2A
  126. 7:purple gradual change 0x2B
  127. 8:white gradual change 0x2C
  128. 9:red and green gradual change 0x2D
  129. 10:red and blue gradual change 0x2E
  130. 11:green and blue gradual change 0x2F
  131. 12:7 colors stroboflash 0x30
  132. 13:red stroboflash 0x31
  133. 14:green stroboflash 0x32
  134. 15:glue stroboflash 0x33
  135. 16:yellow stroboflash 0x34
  136. 17:cyan stroboflash 0x35
  137. 18:purple stroboflash 0x36
  138. 19:white stroboflash 0x37
  139. 20:7 colors jump change 0x38
  140. custom Mode 0x60
  141. static Mode 0x61
  142. music Mode 0x62
  143. testing Mode 0x63
  144.  
  145. Description check digit:a byte sum which a whole command minus "check digit"
  146.  
  147.  
  148.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement