LifeSmart超级碗刷入ESPHome接入HomeAssistant:红外收发及全彩小夜灯

By | 2025/07/10

最近入手了一批 LifeSmart(云起)超级碗闪联版(标识 LS034SL)。还记得第一次购买时,单个价格是 20 元,而现在两个的价格已经稳定在 29-30 元,并且持续了一年多。这两家卖家都来自上海,估计是同一货源,他们提供的设备基本全新,还附带充电器,库存也比较充足。相比之下,天津的卖家虽然价格稍低,但货品大多是回收件,号称九五新,实际只有八成新,而且不带充电器。


我所购买的超级碗情况

这次我从上海的卖家那里购买了 4 个超级碗,它们都贴有电信的标签。其中 3 个是全新的,只有一个是旧的,底壳有明显的变色。拆卸方面,有 2 个很容易就拧开了,但另外 2 个费尽了各种办法都打不开,最后只能撬开,所幸没有造成损伤。至于从天津卖家那里买的一个,就不多提了,品相实在太差。

总的来说,以 15 元一个的价格入手,还是非常实惠的。这款设备自带 ESP8266 芯片,并集成了 19 颗 5050 彩色 LED 灯珠、9 颗红外发射二极管以及 1 颗红外接收管。这意味着你只需花费 15 元,就能拥有一个功能齐全的红外遥控器,外加一个颜值不俗的全彩小夜灯,性价比真的很高!


改造方案

我的改造方案参考了瀚思彼岸上 szlww 大佬的教程。下面是 szlww 大佬提供的 IO 接口图以及我的具体连接方式:

我的改造步骤如下:

  1. 使用热风枪移除了 STM 芯片。
  2. 利用漆包线焊接了新的线路。
  3. 涂抹光固化胶(或绿油等)来保护焊接好的线路。
  4. 将 1Mb 的 Flash 更换为 4Mb 的 Flash。

已实现的功能及拓展

目前,我的超级碗已实现以下功能:

  • 前 3 个功能: 控制 LED 灯的颜色。
  • 第 4-6 个功能: 显示红外识别结果。
  • 第 7 个功能: 实现 LED 灯的一些特定效果。由于 LED 是并联连接,无法实现串行灯的效果。
  • 第 8 个功能: 红外发射功能。你可以根据接收到的按键信息来配置发射信息,也可以直接在 Home Assistant 中调用红外发射功能。

可拓展功能:

在完成上述连接后,ESP8266 芯片还剩下几个空闲的 IO 口,可以用于连接 433 或 315 的收发模块,从而将超级碗改造为一个功能更全面的无线收发设备。

温馨提示: 不建议连接温度传感器。 经过测试,在灯光开启状态下,板子的温度会达到 50 摄氏度左右,这会严重影响温度测量的准确性。


注意事项

在改造过程中,有几点需要特别注意:

  1. 串口线要短: 串口线过长可能会导致无法连接芯片。如果遇到连接问题,也可能是受到干扰,请多尝试几次。
  2. 烧录模式指示: 成功进入烧录模式后,蓝色指示灯会常亮。如果没有进入烧录模式,指示灯会先亮蓝光,然后变为粉色。
  3. 更换 Flash 至关重要: 强烈建议将原有的 1Mb Flash 更换为 4Mb Flash。目前的固件打包后大小约为 600KB,1Mb 的 Flash 无法支持在线更新(OTA)。更换为 4Mb Flash 后,固件就可以进行 OTA 更新了。

esphome核心代码


esp8266:
  board: nodemcuv2

# Enable Home Assistant API
api:
  actions:
    - action: send_raw_command
      variables:
        command: int[]
      then:
        - remote_transmitter.transmit_raw:
            code: !lambda 'return command;'
            carrier_frequency: 38kHz
    - action: send_nec_command
      variables:
        address: int
        command: int
      then:
        - remote_transmitter.transmit_nec:
            address: !lambda 'return address;'
            command: !lambda 'return command;'
    - action: send_pronto_command
      variables:
        command: string
      then:
        - remote_transmitter.transmit_pronto:
            data: !lambda 'return command;'
    
output:
  #红色led
  - platform: esp8266_pwm
    id: id_pin_led_red
    pin:
      number: GPIO15
      inverted: false

  #绿色led
  - platform: esp8266_pwm
    id: id_pin_led_green
    pin:
      number: GPIO4
      inverted: false

  #蓝色led
  - platform: esp8266_pwm
    id: id_pin_led_blue
    pin:
      number: GPIO14
      inverted: false
    
switch:
  - platform: output
    name: "Red"
    output: id_pin_led_red
  - platform: output
    name: "Green"
    output: id_pin_led_green
  - platform: output
    name: "Blue"
    output: id_pin_led_blue

light:
  - platform: rgb
    name: "light-Color Lights"
    id: id_light_color_lights
    red: id_pin_led_red
    green: id_pin_led_green
    blue: id_pin_led_blue
    default_transition_length: 0.5s
    effects:
      - random:
          transition_length: 4s
          update_interval: 5s
      - pulse:
      - random:
          name: "Fast Random Effect"
          transition_length: 4s
          update_interval: 5s

text_sensor:
  - platform: template
    id: ir_data
    name: ir_data
  - platform: template
    id: ir_protocol
    name: ir_protocol
    on_value:
      then:
        - lambda: id(ir_btn).publish_state(true);
        - delay: 200ms
        - lambda: id(ir_btn).publish_state(false);

remote_transmitter:
  pin: 
    number: GPIO12
  carrier_duty_percent: 50%

remote_receiver:
  pin:
    number: GPIO13
    inverted: true
    mode: INPUT_PULLUP
  tolerance: 50%
    then:
      - text_sensor.template.publish:
          id: ir_data
          state: !lambda |-
            char temp[20];
            sprintf(temp,"%X:%X",x.address,x.command);
            return temp;
      - text_sensor.template.publish:
          id: ir_protocol
          state: "nec"     
  dump: all

  
binary_sensor:
  - platform: template
    id: ir_btn
    name: ir_btn
  - platform: gpio
    id: id_button_main_key
    pin:
      number: 5
      inverted: true
      mode:
        input: true
        pullup: true
    on_multi_click:
    #长按5s以上,重置为出厂模式,进入配网状态
    - timing:
        - ON for at least 5s
      then:
        - logger.log: "Long press."
      invalid_cooldown: 0s
    #双击
    - timing:
        - ON for at most 0.5s
        - OFF for at most 0.5s
        - ON for at most 0.5s
        - OFF for at least 0.2s
      then:
        - logger.log: "double click."
      invalid_cooldown: 0s      
    #单击
    - timing:
        - ON for at most 0.5s
        - OFF for at least 0.01s
      then:
        - logger.log: "single click."
        - lambda: |-
              int color_type = id(id_color_type_lastvalue) % id(id_color_type_maxvalue);
              switch(color_type)
              {

                case 0:{
                  auto call = id(id_light_color_lights).turn_on();
                  call.set_brightness(1.0);
                  call.set_rgb(1.0, 0.0, 0.0);
                  call.perform();
                  break;
                  }
                case 1: {
                  auto call = id(id_light_color_lights).turn_on();
                  call.set_brightness(1.0);
                  call.set_rgb(0.0, 1.0, 0.0);
                  call.perform();
                  break;
                  }
                case 2: {
                  auto call = id(id_light_color_lights).turn_on();
                  call.set_brightness(1.0);
                  call.set_rgb(0.0, 0.0, 1.0);
                  call.perform();
                  break;
                  }
                case 3: {
                  auto call = id(id_light_color_lights).turn_on();
                  call.set_brightness(1.0);
                  call.set_rgb(1.0, 1.0, 1.0);
                  call.perform();
                  break;
                  }
                case 4: {
                  auto call = id(id_light_color_lights).turn_on();
                  call.set_effect("Random");
                  call.perform();
                  break;
                  }
                case 5: {
                  id(id_light_color_lights).turn_off().perform();
                  break;
                  }
                default:
                  break;
              }
              id(id_color_type_lastvalue) += 1;
      invalid_cooldown: 0s
globals:
  - id: id_color_type_lastvalue
    type: int
    restore_value: no
    initial_value: '0'
  - id: id_color_type_maxvalue
    type: int
    restore_value: no
    initial_value: '6'

© 2025, 爱上生活. 版权所有,非商业使用转载必须提供本文章的原始链接。

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注