Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PWM support?
#11
(09-22-2024, 11:36 PM)admin Wrote: KCS not support PWM output. you can try to use by ESPHome.

Update to this thread got it working in ESPHome with the following config:

Code:
# PWM output for fan control
output:
  - platform: ledc
    pin: GPIO14
    id: fan_output
    frequency: 25000Hz
    min_power: 0.0
    max_power: 1.0

fan:
  - platform: speed
    output: fan_output
    name: "PWM Fan"
    id: pwm_fan
    speed_count: 100

sensor:
  - platform: pulse_counter
    pin:
      number: GPIO32
      mode:
        input: true
        pullup: true
    name: "Fan RPM"
    id: fan_rpm
    unit_of_measurement: "RPM"
    filters:
      - multiply: 0.5
      - lambda: return round(x);  # Round to nearest whole number
    accuracy_decimals: 0  # Display no decimal places
    update_interval: 3s
    count_mode:
      rising_edge: INCREMENT
      falling_edge: DISABLE

  - platform: template
    name: "Fan Speed Percentage"
    id: fan_speed_percentage
    unit_of_measurement: "%"
    accuracy_decimals: 0
    lambda: |-
      return (id(fan_rpm).state / 6600.0) * 100.0;
    update_interval: 3s
Reply


Messages In This Thread
PWM support? - by luis15pt - 09-19-2024, 06:10 PM
RE: PWM support? - by admin - 09-19-2024, 11:16 PM
RE: PWM support? - by luis15pt - 09-20-2024, 08:06 AM
RE: PWM support? - by admin - 09-20-2024, 11:50 AM
RE: PWM support? - by luis15pt - 09-20-2024, 12:01 PM
RE: PWM support? - by luis15pt - 09-20-2024, 04:12 PM
RE: PWM support? - by admin - 09-20-2024, 12:14 PM
RE: PWM support? - by admin - 09-21-2024, 02:55 AM
RE: PWM support? - by luis15pt - 09-22-2024, 10:48 PM
RE: PWM support? - by admin - 09-22-2024, 11:36 PM
RE: PWM support? - by luis15pt - 09-25-2024, 03:19 PM
RE: PWM support? - by admin - 09-25-2024, 11:05 PM

Forum Jump:


Users browsing this thread:
1 Guest(s)