『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
查看: 1819|回复: 1

[经验分享] broadlink mini3 改造,接入esp32 or esp8266

[复制链接]

80

主题

388

帖子

1680

积分

金牌会员

Rank: 6Rank: 6

积分
1680
金钱
1292
HASS币
0
发表于 2022-8-9 12:55:32 | 显示全部楼层 |阅读模式
本帖最后由 ciasdmxhxjjpd@c 于 2022-8-9 20:46 编辑

RT,

broadlink 自己的固件,发热量挺大的。感觉灭有必要给这个小东西单独供电,单独控制。
把他接入到 家里的 esp32 ,不是更方便吗。

参考这里,https://github.com/chaeplin/rm-mini3-to-esp8266
他是换 模块。

其实不用那么麻烦,只需要把线引出来,接入到 esp32 。正好客厅里有个 esp32 用来 做 pzem 电量统计的。焊完之后,扔到弱电箱里,避免无处可放。

焊盘位,依次

3.3v - gnd - 5v - ir 收 - ir 发

ir 收发模块电路很简单。5v 给 ir 发送 led 供电,每2个 led 都有一个 三极管 用来 做开关,3.3v 给 ir 接收 led 供电。拆开发现有一路led 的三极管没接到 ir 发上。不知道是基于什么考虑。
拿一根跳线,把他们接上。

实际使用过程中,如果不用学码,3.3v 可以不接。我的 esp32 ,3.3v 给了 pzem。所以,学完码后,只需要接 3 根线。

加一点 704 的胶,固定下。

微信图片_20220809124832.jpg

以下 code 适用于 松下 led


remote_receiver:
 pin: 
 number: GPIO12
 inverted: True
 mode: INPUT_PULLUP
 dump: all

remote_transmitter:
  pin: GPIO14
  # Infrared remotes use a 50% carrier signal
  carrier_duty_percent: 50%
  
switch:
  # off        
  - platform: template
    name: keting off
    id: keting_off
    optimistic: true
    lambda: "return id(keting_off).state;"
    turn_on_action:
      - remote_transmitter.transmit_raw:
          carrier_frequency: 38kHz
          code: [ 3458, -1770, 418, -457, 444, -463, 383, -1335, 419, -1332, 417, -460, 413, -1335, 419, -458, 415, -489, 388, -458, 413, -1337, 416, -463, 411, -461, 415, -1333, 443, -436, 413, -1337, 441, -463, 386, -1335, 414, -461, 415, -461, 413, -1337, 
                  414, -460, 416, -462, 413, -481, 395, -480, 398, -1332, 441, -1310, 415, -1334, 418, -1335, 439, -435, 416, -1336, 439, -435, 415, -462, 414, -488, 385, -1337, 416, -1334, 440, -436, 415, -491, 385, -1335, 415, -462, 414, -461, 411]
      - delay: 100ms
      - switch.turn_off: keting_off
      
  # night mode 
  - platform: template
    name: keting night mode
    id: keting_night_mode
    optimistic: true
    lambda: "return id(keting_night_mode).state;" 
    turn_on_action:
      - remote_transmitter.transmit_raw:
          carrier_frequency: 38kHz
          code: [ 3470, -1763, 393, -483, 416, -462, 409, -1342, 442, -1308, 419, -457, 415, -1338, 473, -404, 438, -437, 442, -430, 416, -1335, 417, -460, 417, -458, 415, -1335, 394, -484, 414, -1334, 418, -458, 469, -1281, 423, -454, 415, -459, 419, -1333, 
                  418, -456, 418, -460, 412, -464, 413, -458, 418, -479, 399, -1330, 392, -1359, 418, -1333, 444, -433, 416, -1335, 393, -481, 418, -459, 413, -1335, 440, -1311, 416, -1334, 418, -459, 414, -460, 418, -1332, 394, -480, 414, -509, 370]
    turn_off_action:
      - switch.turn_on: keting_off
      
  # warm white mode    
  - platform: template
    name: keting warm white mode
    id: keting_warm_white_mode
    optimistic: true
    lambda: "return id(keting_warm_white_mode).state;"    
    turn_on_action:
      - remote_transmitter.transmit_raw:
          carrier_frequency: 38kHz
          code: [ 3460, -1770, 415, -460, 418, -459, 415, -1335, 417, -1336, 418, -458, 414, -1336, 417, -459, 414, -460, 415, -484, 393, -1334, 417, -461, 438, -435, 415, -1335, 418, -505, 319, -1384, 420, -455, 417, -1335, 415, -490, 386, -460, 415, -1333, 
                  416, -1335, 443, -1307, 419, -479, 399, -487, 384, -1336, 416, -1336, 417, -457, 415, -1337, 415, -460, 414, -459, 417, -458, 417, -1335, 417, -460, 412, -1337, 415, -458, 418, -458, 415, -1336, 415, -1336, 418, -479, 396, -1332, 445]
    turn_off_action:
      - delay: 100ms
      - switch.turn_on: keting_off
      - delay: 3s
      - switch.turn_on: keting_off
      - delay: 1s
      - switch.turn_on: keting_off 
      
  # full bright mode
  - platform: template
    name: keting full bright mode
    id: keting_full_bright_mode
    optimistic: true
    lambda: "return id(keting_full_bright_mode).state;" 
    turn_on_action:
      - remote_transmitter.transmit_raw:
          carrier_frequency: 38kHz
          code: [ 3462, -1769, 417, -462, 412, -490, 387, -1340, 412, -1336, 416, -481, 398, -1334, 415, -458, 419, -456, 418, -460, 440, -1310, 441, -435, 414, -461, 417, -1335, 442, -463, 387, -1334, 417, -460, 416, -1335, 439, -438, 413, -460, 415, -1336, 
                  417, -458, 412, -465, 415, -458, 412, -465, 412, -459, 419, -457, 416, -1335, 416, -1333, 419, -460, 413, -1335, 391, -485, 415, -462, 413, -1338, 417, -458, 415, -1335, 420, -460, 412, -460, 416, -1335, 416, -461, 416, -458, 416]
    turn_off_action:
      - delay: 100ms
      - switch.turn_on: keting_off
      - delay: 3s
      - switch.turn_on: keting_off
      - delay: 1s
      - switch.turn_on: keting_off      
  # sun mode      
  - platform: template
    name: keting sun mode
    id: keting_sun_mode
    optimistic: true
    lambda: "return id(keting_sun_mode).state;"
    turn_on_action:
      - remote_transmitter.transmit_raw:
          carrier_frequency: 38kHz
          code: [ 3461, -1771, 417, -458, 418, -490, 385, -1337, 417, -1335, 419, -487, 386, -1334, 417, -460, 414, -463, 414, -459, 415, -1337, 443, -433, 442, -464, 361, -1360, 415, -462, 417, -1333, 419, -459, 413, -1335, 418, -460, 415, -480, 397, -1333, 
                  416, -1336, 417, -1334, 416, -462, 416, -456, 418, -460, 389, -1362, 412, -464, 414, -1335, 416, -460, 416, -459, 416, -459, 415, -1337, 390, -1359, 393, -1359, 419, -456, 415, -461, 413, -1335, 419, -1334, 417, -461, 414, -1334, 418]
    turn_off_action:
      - delay: 100ms
      - switch.turn_on: keting_off
      - delay: 3s
      - switch.turn_on: keting_off
      - delay: 1s
      - switch.turn_on: keting_off 
      
  # brightness -     
  - platform: template
    name: keting brightness minus
    id: keting_brightness_minus
    optimistic: true
    lambda: "return id(keting_brightness_minus).state;"    
    turn_on_action:
      - remote_transmitter.transmit_raw:
          carrier_frequency: 38kHz
          code: [ 3450, -1801, 438, -440, 434, -438, 386, -1365, 413, -1315, 465, -407, 466, -1285, 442, -461, 386, -490, 385, -463, 435, -1316, 440, -462, 436, -438, 360, -1392, 412, -462, 414, -1312, 411, -490, 384, -1365, 413, -461, 439, -411, 413, -1363, 
                  411, -468, 409, -462, 412, -463, 413, -440, 431, -1315, 415, -1338, 464, -414, 436, -1338, 440, -438, 465, -1257, 414, -462, 413, -517, 385, -436, 440, -1341, 433, -415, 439, -487, 383, -492, 410, -1288, 466, -439, 435, -408, 469]
      - delay: 100ms
      - switch.turn_off: keting_brightness_minus

  # brightness +
  - platform: template
    name: keting brightness plus
    id: keting_brightness_plus
    optimistic: true
    lambda: "return id(keting_brightness_plus).state;"   
    turn_on_action:
      - remote_transmitter.transmit_raw:
          carrier_frequency: 38kHz
          code: [ 3425, -1777, 435, -439, 407, -470, 406, -1343, 410, -1342, 383, -517, 353, -1372, 408, -464, 388, -464, 435, -439, 410, -1370, 437, -464, 357, -518, 384, -1369, 358, -491, 408, -1344, 411, -464, 411, -1314, 465, -437, 359, -545, 358, -1395, 
                  407, -467, 358, -492, 357, -546, 382, -493, 384, -466, 410, -1317, 432, -493, 384, -1368, 356, -493, 409, -1343, 411, -439, 411, -464, 465, -1313, 412, -1313, 464, -468, 382, -465, 435, -440, 410, -1316, 436, -491, 413, -437, 407]
      - delay: 100ms
      - switch.turn_off: keting_brightness_plus

  # warm    
  - platform: template
    name: keting warm
    id: keting_warm
    optimistic: true
    lambda: "return id(keting_warm).state;"
    turn_on_action:
      - remote_transmitter.transmit_raw:
          carrier_frequency: 38kHz
          code: [ 3455, -1801, 465, -381, 465, -439, 413, -1307, 441, -1312, 444, -459, 388, -1364, 414, -437, 463, -412, 436, -465, 412, -1311, 412, -491, 412, -490, 360, -1339, 413, -488, 387, -1336, 442, -437, 411, -1339, 468, -461, 387, -463, 410, -1341, 
                  414, -1312, 441, -1309, 414, -488, 387, -515, 383, -1316, 467, -406, 468, -436, 386, -489, 439, -1284, 442, -435, 438, -462, 413, -1340, 414, -462, 410, -437, 467, -461, 354, -1373, 385, -487, 414, -1310, 440, -486, 362, -1338, 437]
      - delay: 100ms
      - switch.turn_off: keting_warm

  # cold 
  - platform: template
    name: keting cold
    id: keting_cold
    optimistic: true
    lambda: "return id(keting_cold).state;"    
    turn_on_action:
      - remote_transmitter.transmit_raw:
          carrier_frequency: 38kHz
          code: [ 3426, -1775, 409, -519, 385, -464, 410, -1343, 409, -1318, 435, -465, 409, -1314, 441, -464, 437, -438, 411, -491, 383, -1339, 438, -440, 463, -437, 330, -1399, 378, -495, 410, -1342, 437, -463, 412, -1313, 412, -464, 410, -468, 459, -1262, 
                  436, -1316, 435, -1346, 406, -465, 411, -463, 409, -466, 385, -517, 359, -516, 383, -467, 406, -1372, 412, -406, 437, -496, 408, -1286, 431, -1348, 438, -435, 413, -462, 412, -1342, 411, -464, 412, -1342, 409, -461, 383, -1370, 435]
      - delay: 100ms
      - switch.turn_off: keting_cold








回复

使用道具 举报

33

主题

2196

帖子

5838

积分

论坛元老

Rank: 8Rank: 8

积分
5838
金钱
3642
HASS币
60
QQ
发表于 2022-8-9 22:21:21 | 显示全部楼层
膜拜大佬 。
我不生产技术,我只是技术的搬运工。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-29 02:38 , Processed in 0.086415 second(s), 27 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表