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

 找回密码
 立即注册
查看: 300|回复: 8

[技术探讨] esphome pwm控制风扇转速 怎么配置呢

[复制链接]

55

主题

621

帖子

3810

积分

论坛元老

Rank: 8Rank: 8

积分
3810
金钱
3184
HASS币
20
发表于 2024-4-20 00:07:33 | 显示全部楼层 |阅读模式
本帖最后由 gmshiwoge 于 2024-4-20 00:09 编辑
esphome:
  name: jin-yu-fan
  friendly_name: jin_yu_fan

esp8266:
  board: esp01_1m





# Enable logging
logger:

# Enable Home Assistant API

web_server:
  port: 80




wifi:
  reboot_timeout: 180s
  ssid: "JDCwifi_404"
  password: "adminadmin"
  ap:
    ssid: "esp_fan"
    password: "12345678"
captive_portal:

api:

ota:

button: #重启
  - platform: restart
    name: newfanlight_restart
    # inverted: true
    id: Restart



fan:
  - platform: speed
    output: fan_output
    name: "金鱼缸抽风"

output:
  - platform: esp8266_pwm
    pin: GPIO02
    frequency: "19531Hz"
    id: fan_output
上面配置可以正常 但是在使用百分比操作。40%以下基本是关闭的状态了。上面的代码应该怎么配置呢
回复

使用道具 举报

16

主题

142

帖子

1203

积分

金牌会员

Rank: 6Rank: 6

积分
1203
金钱
1061
HASS币
0
发表于 2024-4-20 09:01:03 | 显示全部楼层
是不是和风扇本身性能有关,研究下pwm风扇的死区
回复

使用道具 举报

8

主题

95

帖子

507

积分

高级会员

Rank: 4

积分
507
金钱
412
HASS币
0
发表于 2024-4-20 11:45:05 | 显示全部楼层
用ESP32,8266不是硬件PWM会受WIFI信号干扰
回复

使用道具 举报

1

主题

31

帖子

134

积分

注册会员

Rank: 2

积分
134
金钱
103
HASS币
0
发表于 2024-4-20 17:32:37 | 显示全部楼层
风扇有pwm死区
回复

使用道具 举报

55

主题

621

帖子

3810

积分

论坛元老

Rank: 8Rank: 8

积分
3810
金钱
3184
HASS币
20
 楼主| 发表于 2024-4-20 18:38:43 | 显示全部楼层

led灯也是吗。我弄一个双色的台灯的,pwm控制 低于20%以下 就没有亮度了   什么照亮度传感器  触控传感器 雷达2410b雷达 都添加进去了
esphome:
  name: tai-deng
  friendly_name: tai deng
  on_boot:
    priority: 700
    then:
      - wait_until: 
          api.connected:
      - lambda: id(config_mode).turn_on();
      - script.execute: get_all_params
      - uart.write: [0xFD,0xFC,0xFB,0xFA,0x02,0x00,0x63,0x00,0x04,0x03,0x02,0x01] #ĬÈϹرչ¤³Ìģʽ
      - delay: 1s
      - lambda: id(config_mode).turn_off();

  includes:
    - ld2410h.h

esp32:
  board: esp32dev
  framework:
    type: arduino

script:
  - id: get_all_params
    then:
      - uart.write: [0xFD,0xFC,0xFB,0xFA,0x02,0x00,0x61,0x00,0x04,0x03,0x02,0x01]
      - delay: 1s



# Enable logging
logger:

# Enable Home Assistant API

web_server:
  port: 80




wifi:
  reboot_timeout: 180s
  ssid: "JDCwifi_404"
  password: "adminadmin"
  ap:
    ssid: "esp_台灯"
    password: "12345678"
captive_portal:

api:

ota:

button: #重启
  - platform: restart
    name: newfanlight_restart
    # inverted: true
    id: Restart

  - platform: template
    name: update params
    id: update_params
    on_press:
      - lambda: id(config_mode).turn_on();
      - script.execute: get_all_params
      - lambda: id(config_mode).turn_off();

  - platform: template
    name: "Set default"
    id: set_default
    on_press:
      - lambda: id(config_mode).turn_on();
      - uart.write: [0xFD,0xFC,0xFB,0xFA,0x02,0x00,0xA2,0x00,0x04,0x03,0x02,0x01]
      - delay: 1s
      - script.execute: get_all_params
      - delay: 1s
      - lambda: id(config_mode).turn_off();
output:
  - platform: ledc
    pin: GPIO18
    id: output_component_warm
    frequency: "19531Hz"
  - platform: ledc
    pin: GPIO19
    id: output_component_cool
    frequency: "19531Hz"



switch:
  - platform: gpio
    name: "lightlan"
    pin: GPIO33
    id: lightlan




  - platform: template
    name: "Config mode"
    id: config_mode
    optimistic: true
    on_turn_on:
      - uart.write: [0xFD,0xFC,0xFB,0xFA,0x04,0x00,0xFF,0x00,0x01,0x00,0x04,0x03,0x02,0x01]
      - delay: 1s
    on_turn_off:
      - uart.write: [0xFD,0xFC,0xFB,0xFA,0x02,0x00,0xFE,0x00,0x04,0x03,0x02,0x01]
      - delay: 1s
      
  - platform: template
    name: run_RTA    #´ò¿ªÊµÊ±¼à¿Ø
    id: run_rta
    optimistic: true
    
  - platform: template
    name: "Debug mode"
    id: debug_mode
    optimistic: true
    on_turn_on:
      - lambda: id(config_mode).turn_on();
      - uart.write: [0xFD,0xFC,0xFB,0xFA,0x02,0x00,0x62,0x00,0x04,0x03,0x02,0x01]
      - delay: 1s
      - lambda: id(config_mode).turn_off();
    on_turn_off:
      - lambda: id(config_mode).turn_on();
      - uart.write: [0xFD,0xFC,0xFB,0xFA,0x02,0x00,0x63,0x00,0x04,0x03,0x02,0x01]
      - delay: 1s
      - lambda: id(config_mode).turn_off();

light:
  - platform: cwww
    name: "Livingroom Lights"
    cold_white: output_component_warm
    warm_white: output_component_cool
    cold_white_color_temperature: 6536 K
    warm_white_color_temperature: 2000 K
    constant_brightness: true
    id: light_output
    on_turn_on:
      then:
        - switch.turn_on: lightlan
    on_turn_off:
      then:
        - switch.turn_off: lightlan
binary_sensor:
  - platform: gpio
    pin:
      number: GPIO25
      mode: INPUT_PULLUP
      inverted: true
    name: "leida"
  - platform: gpio
    pin:
      number: GPIO26
      mode: INPUT_PULLDOWN
     
    name: "key"
    on_press:
      then:
        - light.toggle: light_output
    on_release:
      then:
        - light.toggle: light_output

i2c:
  sda: GPIO15
  scl: GPIO02
  scan: True
  id: bus_a

sensor:
  - platform: bh1750
    name: "光照传感器"
    id: illuminance
    address: 0x23
    update_interval: 1s
  - platform: custom
    lambda: |-
      auto s = new ld2410(id(uart_bus1));
      App.register_component(s);
      return {s->mov_distance_sensor, s->occ_distance_sensor, s->detect_distance_sensor, s->en_mov_0, s->en_mov_1, s->en_mov_3, s->en_mov_3, s->en_mov_4, s->en_mov_5, s->en_mov_6, s->en_mov_7, s->en_mov_8, s->en_occ_0, s->en_occ_1, s->en_occ_2, s->en_occ_3, s->en_occ_4, s->en_occ_5, s->en_occ_6, s->en_occ_7, s->en_occ_8};
      
    sensors:
      - name: mov_distance_sensor
        id: mov_distance_sensor
        #internal: true
        unit_of_measurement: m
        accuracy_decimals: 2
        filters:
          - lambda: return x/100;
      - name: occ_distance_sensor
        id: occ_distance_sensor
        #internal: true
        unit_of_measurement: m
        accuracy_decimals: 2
        filters:
          - lambda: return x/100;
      - name: detect_distance_sensor
        id: detect_distance_sensor
        #internal: true
        unit_of_measurement: m
        accuracy_decimals: 2
        filters:
          - lambda: return x/100;
      # ¸÷¸ö¾àÀëÃÅÄÜÁ¿Öµ    
      - name: en_mov_0
        id: en_mov_0
      - name: en_mov_1
        id: en_mov_1
      - name: en_mov_2
        id: en_mov_2
      - name: en_mov_3
        id: en_mov_3
      - name: en_mov_4
        id: en_mov_4
      - name: en_mov_5
        id: en_mov_5
      - name: en_mov_6
        id: en_mov_6
      - name: en_mov_7
        id: en_mov_7
      - name: en_mov_8
        id: en_mov_8
      - name: en_occ_0
        id: en_occ_0
      - name: en_occ_1
        id: en_occ_1
      - name: en_occ_2
        id: en_occ_2
      - name: en_occ_3
        id: en_occ_3
      - name: en_occ_4
        id: en_occ_4
      - name: en_occ_5
        id: en_occ_5
      - name: en_occ_6
        id: en_occ_6
      - name: en_occ_7
        id: en_occ_7
      - name: en_occ_8
        id: en_occ_8
      
      

text_sensor:
  - platform: template
    name: "target state"
    id: target_state
        

number:
  - platform: template
    name: max_distance  #×î´ó̽²â¾àÀë
    id: max_distance
    min_value: 0.75
    max_value: 6
    initial_value: 6
    step: 0.75
    #restore_value: true
    optimistic: true
    unit_of_measurement: m   #ÊÖ²áûÓÐÅäÖÃÃüÁ£¿·þÁË
    
  - platform: template
    name: max_mov_distance  #×î´óÒƶ¯Ì½²â¾àÀë
    id: max_mov_distance
    min_value: 0.75
    max_value: 6
    initial_value: 6
    step: 0.75
    #restore_value: true
    optimistic: true
    unit_of_measurement: m
    set_action:
      - uart.write: !lambda
          id(config_mode).turn_on();
          return {0xFD,0xFC,0xFB,0xFA, 0x14, 0x00, 0x60, 0x00, 0x00, 0x00, (unsigned char)(int)(x/0.75), 0x00, 0x00, 0x00, 0x01, 0x00, (unsigned char)(int)(id(max_occ_distance).state/0.75), 0x00, 0x00, 0x00, 0x02, 0x00, (unsigned char)id(none_duration).state, 0x00, 0x00, 0x00, 0x04, 0x03, 0x02, 0x01};

    
  - platform: template
    name: max_occ_distance  #×î´ó¾²Ö¹Ì½²â¾àÀë
    id: max_occ_distance
    min_value: 0.75
    max_value: 6
    initial_value: 6
    step: 0.75
    #restore_value: true
    optimistic: true
    unit_of_measurement: m
    set_action:
      - uart.write: !lambda
          id(config_mode).turn_on();
          return {0xFD,0xFC,0xFB,0xFA, 0x14, 0x00, 0x60, 0x00, 0x00, 0x00, (unsigned char)(int)(id(max_mov_distance).state/0.75), 0x00, 0x00, 0x00, 0x01, 0x00, (unsigned char)(int)(x/0.75), 0x00, 0x00, 0x00, 0x02, 0x00, (unsigned char)id(none_duration).state, 0x00, 0x00, 0x00, 0x04, 0x03, 0x02, 0x01};

  - platform: template
    name: none_duration  #ÎÞÈ˳ÖÐøʱ¼ä
    id: none_duration
    min_value: 0
    max_value: 120
    initial_value: 5
    step: 1
    #restore_value: true
    optimistic: true
    unit_of_measurement: s
    set_action:
      - uart.write: !lambda
          id(config_mode).turn_on();
          return {0xFD,0xFC,0xFB,0xFA, 0x14, 0x00, 0x60, 0x00, 0x00, 0x00, (unsigned char)(int)(id(max_mov_distance).state/0.75), 0x00, 0x00, 0x00, 0x01, 0x00, (unsigned char)(int)(id(max_occ_distance).state/0.75), 0x00, 0x00, 0x00, 0x02, 0x00, (unsigned char)x, 0x00, 0x00, 0x00, 0x04, 0x03, 0x02, 0x01};

  - platform: template
    name: mov_sn_distance_0
    id: mov_sn_distance_0
    min_value: 0
    max_value: 100
    initial_value: 40
    step: 1
    #restore_value: true
    optimistic: true
    set_action:
      - uart.write: !lambda
          id(config_mode).turn_on();
          return {0xFD,0xFC,0xFB,0xFA, 0x14, 0x00, 0x64, 0x00, 0x00, 0x00, (unsigned char)0, 0x00, 0x00, 0x00, 0x01, 0x00, (unsigned char)x, 0x00, 0x00, 0x00, 0x02, 0x00, (unsigned char)id(occ_sn_distance_0).state, 0x00, 0x00, 0x00, 0x04, 0x03, 0x02, 0x01};
  - platform: template
    name: mov_sn_distance_1
    id: mov_sn_distance_1
    min_value: 0
    max_value: 100
    initial_value: 40
    step: 1
    #restore_value: true
    optimistic: true
    set_action:
      - uart.write: !lambda
          id(config_mode).turn_on();
          return {0xFD,0xFC,0xFB,0xFA, 0x14, 0x00, 0x64, 0x00, 0x00, 0x00, (unsigned char)1, 0x00, 0x00, 0x00, 0x01, 0x00, (unsigned char)x, 0x00, 0x00, 0x00, 0x02, 0x00, (unsigned char)id(occ_sn_distance_1).state, 0x00, 0x00, 0x00, 0x04, 0x03, 0x02, 0x01};
  - platform: template
    name: mov_sn_distance_2
    id: mov_sn_distance_2
    min_value: 0
    max_value: 100
    initial_value: 40
    step: 1
    #restore_value: true
    optimistic: true
    set_action:
      - uart.write: !lambda
          id(config_mode).turn_on();
          return {0xFD,0xFC,0xFB,0xFA, 0x14, 0x00, 0x64, 0x00, 0x00, 0x00, (unsigned char)2, 0x00, 0x00, 0x00, 0x01, 0x00, (unsigned char)x, 0x00, 0x00, 0x00, 0x02, 0x00, (unsigned char)id(occ_sn_distance_2).state, 0x00, 0x00, 0x00, 0x04, 0x03, 0x02, 0x01};
  - platform: template
    name: mov_sn_distance_3
    id: mov_sn_distance_3
    min_value: 0
    max_value: 100
    initial_value: 40
    step: 1
    #restore_value: true
    optimistic: true
    set_action:
      - uart.write: !lambda
          id(config_mode).turn_on();
          return {0xFD,0xFC,0xFB,0xFA, 0x14, 0x00, 0x64, 0x00, 0x00, 0x00, (unsigned char)3, 0x00, 0x00, 0x00, 0x01, 0x00, (unsigned char)x, 0x00, 0x00, 0x00, 0x02, 0x00, (unsigned char)id(occ_sn_distance_3).state, 0x00, 0x00, 0x00, 0x04, 0x03, 0x02, 0x01};
  - platform: template
    name: mov_sn_distance_4
    id: mov_sn_distance_4
    min_value: 0
    max_value: 100
    initial_value: 40
    step: 1
    #restore_value: true
    optimistic: true
    set_action:
      - uart.write: !lambda
          id(config_mode).turn_on();
          return {0xFD,0xFC,0xFB,0xFA, 0x14, 0x00, 0x64, 0x00, 0x00, 0x00, (unsigned char)4, 0x00, 0x00, 0x00, 0x01, 0x00, (unsigned char)x, 0x00, 0x00, 0x00, 0x02, 0x00, (unsigned char)id(occ_sn_distance_4).state, 0x00, 0x00, 0x00, 0x04, 0x03, 0x02, 0x01};
  - platform: template
    name: mov_sn_distance_5
    id: mov_sn_distance_5
    min_value: 0
    max_value: 100
    initial_value: 40
    step: 1
    #restore_value: true
    optimistic: true
    set_action:
      - uart.write: !lambda
          id(config_mode).turn_on();
          return {0xFD,0xFC,0xFB,0xFA, 0x14, 0x00, 0x64, 0x00, 0x00, 0x00, (unsigned char)5, 0x00, 0x00, 0x00, 0x01, 0x00, (unsigned char)x, 0x00, 0x00, 0x00, 0x02, 0x00, (unsigned char)id(occ_sn_distance_5).state, 0x00, 0x00, 0x00, 0x04, 0x03, 0x02, 0x01};
  - platform: template
    name: mov_sn_distance_6
    id: mov_sn_distance_6
    min_value: 0
    max_value: 100
    initial_value: 40
    step: 1
    #restore_value: true
    optimistic: true
    set_action:
      - uart.write: !lambda
          id(config_mode).turn_on();
          return {0xFD,0xFC,0xFB,0xFA, 0x14, 0x00, 0x64, 0x00, 0x00, 0x00, (unsigned char)6, 0x00, 0x00, 0x00, 0x01, 0x00, (unsigned char)x, 0x00, 0x00, 0x00, 0x02, 0x00, (unsigned char)id(occ_sn_distance_6).state, 0x00, 0x00, 0x00, 0x04, 0x03, 0x02, 0x01};
  - platform: template
    name: mov_sn_distance_7
    id: mov_sn_distance_7
    min_value: 0
    max_value: 100
    initial_value: 40
    step: 1
    #restore_value: true
    optimistic: true
    set_action:
      - uart.write: !lambda
          id(config_mode).turn_on();
          return {0xFD,0xFC,0xFB,0xFA, 0x14, 0x00, 0x64, 0x00, 0x00, 0x00, (unsigned char)7, 0x00, 0x00, 0x00, 0x01, 0x00, (unsigned char)x, 0x00, 0x00, 0x00, 0x02, 0x00, (unsigned char)id(occ_sn_distance_7).state, 0x00, 0x00, 0x00, 0x04, 0x03, 0x02, 0x01};
  - platform: template
    name: mov_sn_distance_8
    id: mov_sn_distance_8
    min_value: 0
    max_value: 100
    initial_value: 40
    step: 1
    #restore_value: true
    optimistic: true
    set_action:
      - uart.write: !lambda
          id(config_mode).turn_on();
          return {0xFD,0xFC,0xFB,0xFA, 0x14, 0x00, 0x64, 0x00, 0x00, 0x00, (unsigned char)8, 0x00, 0x00, 0x00, 0x01, 0x00, (unsigned char)x, 0x00, 0x00, 0x00, 0x02, 0x00, (unsigned char)id(occ_sn_distance_8).state, 0x00, 0x00, 0x00, 0x04, 0x03, 0x02, 0x01};

  - platform: template
    name: occ_sn_distance_0
    id: occ_sn_distance_0
    min_value: 0
    max_value: 100
    initial_value: 40
    step: 1
    #restore_value: true
    optimistic: true
    set_action:
      - uart.write: !lambda
          id(config_mode).turn_on();
          return {0xFD,0xFC,0xFB,0xFA, 0x14, 0x00, 0x64, 0x00, 0x00, 0x00, (unsigned char)0, 0x00, 0x00, 0x00, 0x01, 0x00, (unsigned char)id(mov_sn_distance_0).state, 0x00, 0x00, 0x00, 0x02, 0x00, (unsigned char)x, 0x00, 0x00, 0x00, 0x04, 0x03, 0x02, 0x01};
  - platform: template
    name: occ_sn_distance_1
    id: occ_sn_distance_1
    min_value: 0
    max_value: 100
    initial_value: 40
    step: 1
    #restore_value: true
    optimistic: true
    set_action:
      - uart.write: !lambda
          id(config_mode).turn_on();
          return {0xFD,0xFC,0xFB,0xFA, 0x14, 0x00, 0x64, 0x00, 0x00, 0x00, (unsigned char)1, 0x00, 0x00, 0x00, 0x01, 0x00, (unsigned char)id(mov_sn_distance_1).state, 0x00, 0x00, 0x00, 0x02, 0x00, (unsigned char)x, 0x00, 0x00, 0x00, 0x04, 0x03, 0x02, 0x01};
  - platform: template
    name: occ_sn_distance_2
    id: occ_sn_distance_2
    min_value: 0
    max_value: 100
    initial_value: 40
    step: 1
    #restore_value: true
    optimistic: true
    set_action:
      - uart.write: !lambda
          id(config_mode).turn_on();
          return {0xFD,0xFC,0xFB,0xFA, 0x14, 0x00, 0x64, 0x00, 0x00, 0x00, (unsigned char)2, 0x00, 0x00, 0x00, 0x01, 0x00, (unsigned char)id(mov_sn_distance_2).state, 0x00, 0x00, 0x00, 0x02, 0x00, (unsigned char)x, 0x00, 0x00, 0x00, 0x04, 0x03, 0x02, 0x01};
  - platform: template
    name: occ_sn_distance_3
    id: occ_sn_distance_3
    min_value: 0
    max_value: 100
    initial_value: 40
    step: 1
    #restore_value: true
    optimistic: true
    set_action:
      - uart.write: !lambda
          id(config_mode).turn_on();
          return {0xFD,0xFC,0xFB,0xFA, 0x14, 0x00, 0x64, 0x00, 0x00, 0x00, (unsigned char)3, 0x00, 0x00, 0x00, 0x01, 0x00, (unsigned char)id(mov_sn_distance_3).state, 0x00, 0x00, 0x00, 0x02, 0x00, (unsigned char)x, 0x00, 0x00, 0x00, 0x04, 0x03, 0x02, 0x01};
  - platform: template
    name: occ_sn_distance_4
    id: occ_sn_distance_4
    min_value: 0
    max_value: 100
    initial_value: 40
    step: 1
    #restore_value: true
    optimistic: true
    set_action:
      - uart.write: !lambda
          id(config_mode).turn_on();
          return {0xFD,0xFC,0xFB,0xFA, 0x14, 0x00, 0x64, 0x00, 0x00, 0x00, (unsigned char)4, 0x00, 0x00, 0x00, 0x01, 0x00, (unsigned char)id(mov_sn_distance_4).state, 0x00, 0x00, 0x00, 0x02, 0x00, (unsigned char)x, 0x00, 0x00, 0x00, 0x04, 0x03, 0x02, 0x01};
  - platform: template
    name: occ_sn_distance_5
    id: occ_sn_distance_5
    min_value: 0
    max_value: 100
    initial_value: 40
    step: 1
    #restore_value: true
    optimistic: true
    set_action:
      - uart.write: !lambda
          id(config_mode).turn_on();
          return {0xFD,0xFC,0xFB,0xFA, 0x14, 0x00, 0x64, 0x00, 0x00, 0x00, (unsigned char)5, 0x00, 0x00, 0x00, 0x01, 0x00, (unsigned char)id(mov_sn_distance_5).state, 0x00, 0x00, 0x00, 0x02, 0x00, (unsigned char)x, 0x00, 0x00, 0x00, 0x04, 0x03, 0x02, 0x01};
  - platform: template
    name: occ_sn_distance_6
    id: occ_sn_distance_6
    min_value: 0
    max_value: 100
    initial_value: 40
    step: 1
    #restore_value: true
    optimistic: true
    set_action:
      - uart.write: !lambda
          id(config_mode).turn_on();
          return {0xFD,0xFC,0xFB,0xFA, 0x14, 0x00, 0x64, 0x00, 0x00, 0x00, (unsigned char)6, 0x00, 0x00, 0x00, 0x01, 0x00, (unsigned char)id(mov_sn_distance_6).state, 0x00, 0x00, 0x00, 0x02, 0x00, (unsigned char)x, 0x00, 0x00, 0x00, 0x04, 0x03, 0x02, 0x01};
  - platform: template
    name: occ_sn_distance_7
    id: occ_sn_distance_7
    min_value: 0
    max_value: 100
    initial_value: 40
    step: 1
    #restore_value: true
    optimistic: true
    set_action:
      - uart.write: !lambda
          id(config_mode).turn_on();
          return {0xFD,0xFC,0xFB,0xFA, 0x14, 0x00, 0x64, 0x00, 0x00, 0x00, (unsigned char)7, 0x00, 0x00, 0x00, 0x01, 0x00, (unsigned char)id(mov_sn_distance_7).state, 0x00, 0x00, 0x00, 0x02, 0x00, (unsigned char)x, 0x00, 0x00, 0x00, 0x04, 0x03, 0x02, 0x01};
  - platform: template
    name: occ_sn_distance_8
    id: occ_sn_distance_8
    min_value: 0
    max_value: 100
    initial_value: 40
    step: 1
    #restore_value: true
    optimistic: true
    set_action:
      - uart.write: !lambda
          id(config_mode).turn_on();
          return {0xFD,0xFC,0xFB,0xFA, 0x14, 0x00, 0x64, 0x00, 0x00, 0x00, (unsigned char)8, 0x00, 0x00, 0x00, 0x01, 0x00, (unsigned char)id(mov_sn_distance_8).state, 0x00, 0x00, 0x00, 0x02, 0x00, (unsigned char)x, 0x00, 0x00, 0x00, 0x04, 0x03, 0x02, 0x01};

  - platform: template
    name: update_interval  #ʵʱ¼à¿Øˢмä¸ô£¬Ô½´óÔ½Âý£¬´ó¸Å500¼ä¸ôΪ1Ãë
    id: update_interval
    min_value: 100
    max_value: 5000
    initial_value: 500
    step: 100
    restore_value: true
    optimistic: true



uart:
  id: uart_bus1
  tx_pin: GPIO01
  rx_pin: GPIO03
  baud_rate: 256000
  parity: NONE
  stop_bits: 1

评分

参与人数 1金钱 +12 收起 理由
隔壁的王叔叔 + 12 超级棒,又有作业抄啦

查看全部评分

回复

使用道具 举报

1

主题

31

帖子

134

积分

注册会员

Rank: 2

积分
134
金钱
103
HASS币
0
发表于 2024-4-21 07:52:55 | 显示全部楼层
gmshiwoge 发表于 2024-4-20 18:38
led灯也是吗。我弄一个双色的台灯的,pwm控制 低于20%以下 就没有亮度了   什么照亮度传感器  触控传感器 ...

一样的,亮太短眼睛看不到,或者转dc电压不够
回复

使用道具 举报

36

主题

172

帖子

1383

积分

金牌会员

Rank: 6Rank: 6

积分
1383
金钱
1211
HASS币
0
发表于 2024-4-21 19:13:31 | 显示全部楼层
运算符自己重写一个滑块从百分40开始计算就完事了.问gpt要代码
回复

使用道具 举报

69

主题

582

帖子

3228

积分

论坛元老

Rank: 8Rank: 8

积分
3228
金钱
2646
HASS币
0
发表于 2024-4-21 19:29:33 | 显示全部楼层
回复

使用道具 举报

0

主题

12

帖子

68

积分

注册会员

Rank: 2

积分
68
金钱
56
HASS币
0
发表于 2024-4-22 12:43:53 | 显示全部楼层
我搞了一个,直接ha控制设定启动,停止温度。强制转速。可以检测风扇的转速以及风扇的故障。暂时用在机柜上面在,感觉非常方便
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-5-3 12:59 , Processed in 0.105800 second(s), 31 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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