Sigma_Delta_Output not working with set_level

Hi, i have a slow_pwm speed controller and can perfectly set the speed by a lambda call: as mentioned in the esp-documentation under output.set_level Action: like: id(slow_pwm_thsol).set_level(pwr);

script:
    #
  - id: thsol_power_set
    parameters:
      pwr: float
    # ------------------
    then:
      - lambda: |-
          //
          if (pwr < 0.4) {
            //
            id(slow_pwm_thsol).turn_off() ; 
            //
          } else {
            //
            id(slow_pwm_thsol).turn_on() ; 
            //
            id(slow_pwm_thsol).set_level(pwr);
            //
          }
          //
          //

Now changing the speed controller to “sigma_delta_output” i can no more set the speed by the set_level command.

Setting manually as a number like 0.8 works fine…

Where is the bug `?

output:
  #- platform: sigma_delta_output
  - platform: slow_pwm
    pin: GPIO13
    id: slow_pwm_thsol
    period: 1000ms
    # update_interval: 200ms
    inverted: false
    min_power: 0.40
    max_power: 1.00
    #
    # Sets the output to use actual 0 instead of min_power
    # ---------------------------------------------------
    zero_means_zero: true
    #
    #
    turn_on_action:
      - switch.turn_on: pwm_check
    turn_off_action:
      - switch.turn_off: pwm_check

Post your sigma_delta_output: yaml, if that’s the one not working. Also post logs showing the attempted level change.

  name: pwm2
  friendly_name: PWM2
esp32:
  board: az-delivery-devkit-v4  #esp32dev
  framework:
    type: arduino
#
# Enable logging
# ----------------------------
logger:
  #
  #               
  level: VERY_VERBOSE      # Like debug, but a few more messages that are usually deemed to be 
  #                    # spam are also included. Color: grey

#
#
# Enable Home Assistant API
# ---------------------------------
api:
  #
  encryption:
    key: "3z0XylrZItTyLhny9qq6J9xGMHvftIItFn6BlIl+CfE="
#
#
#
# Over the air Zugriff
# --------------------------------------
ota:
  - platform: esphome
    password: "aee3c10b647e6c19de676e66175e7ed5"
#
#
#
#
# wifi
#---------------------------------------------
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  #
  on_disconnect:
  - wifi.disable:
  - delay: 15s
  - wifi.enable:
  #
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esp32-041 Fallback Hotspot"
    password: "30073007"
#
#
# ------------------------------------------------------------------------------------------------
captive_portal:
#
#
#
sensor:
    #
    # power ex HA an ESP übergeben
    # --------------------------------------
    #
  - platform: homeassistant
    entity_id: input_number.pumpenpower_thsol
    id: power
    accuracy_decimals: 2
    #
    #
    #
#############################################################################################################
#############################################################################################################
#
  - platform: template
    name: pumpencheck
    id: pumpencheck
    accuracy_decimals: 0
    update_interval: 10s
    lambda: |-
      id(thsol_power_set).execute(id(power).state) ;
      //
      return {1} ;
    #
    #
###############################################################################################################################################
# ---------------------------------------------
script:
    #
  - id: thsol_power_set
    parameters:
      pwr: float
    # ------------------
    then:
      - lambda: |-
          //
          if (pwr < 0.4) {
            //
            id(slow_pwm_thsol).turn_off() ; 
            //
          } else {
            //
            id(slow_pwm_thsol).turn_on() ; 
            //
            id(slow_pwm_thsol).set_level(pwr);
            //
          }
          //
          //
    #
#
#############################################################################################################
#############################################################################################################
#############################################################################################################
#
output:
  - platform: sigma_delta_output
    pin: GPIO13
    id: slow_pwm_thsol
    update_interval: 1000ms
    inverted: false
    min_power: 0.40
    max_power: 1.00
    #
    # Sets the output to use actual 0 instead of min_power
    # ---------------------------------------------------
    zero_means_zero: true
    #
    #
    turn_on_action:
      - switch.turn_on: pwm_check
    turn_off_action:
      - switch.turn_off: pwm_check
#
switch:
  - platform: template
    id: pwm_check
    name: pwm_check
    optimistic: True

Pls dont be confused, i just replaced the sigma_delta_output versus the slow_pwm names…

Here is the relevant LOG:

INFO ESPHome 2025.3.3
INFO Reading configuration /config/esphome/pwm2.yaml…
INFO Starting log output from 192.168.2.129 using esphome API
INFO Successfully connected to pwm2 @ 192.168.2.129 in 0.088s
INFO Successful handshake with pwm2 @ 192.168.2.129 in 0.152s
[19:14:18][I][app:100]: ESPHome version 2025.3.3 compiled on Apr 16 2025, 18:55:33
[19:14:18][C][wifi:600]: WiFi:
[19:14:18][C][wifi:428]: Local MAC: A0:B7:65:2C:5A:88
[19:14:18][C][wifi:433]: SSID: ‘GUANOLISK’[redacted]
[19:14:18][C][wifi:436]: IP Address: 192.168.2.129
[19:14:18][C][wifi:440]: BSSID: 7C:FF:4D:AF:DA:1E[redacted]
[19:14:18][C][wifi:441]: Hostname: ‘pwm2’
[19:14:18][C][wifi:443]: Signal strength: -46 dB ▂▄▆█
[19:14:18][V][wifi:445]: Priority: 0.0
[19:14:19][C][wifi:447]: Channel: 6
[19:14:19][C][wifi:448]: Subnet: 255.255.255.0
[19:14:19][C][wifi:449]: Gateway: 192.168.2.1
[19:14:19][C][wifi:450]: DNS1: 192.168.2.1
[19:14:19][C][wifi:451]: DNS2: 0.0.0.0
[19:14:19][VV][scheduler:226]: Running interval ‘update’ with interval=1000 last_execution=9050 (now=10105)
[19:14:19][C][logger:177]: Logger:
[19:14:19][C][logger:178]: Max Level: VERY_VERBOSE
[19:14:19][C][logger:179]: Initial Level: VERY_VERBOSE
[19:14:19][C][logger:181]: Log Baud Rate: 115200
[19:14:19][C][logger:182]: Hardware UART: UART0
[19:14:19][C][template.sensor:022]: Template Sensor ‘pumpencheck’
[19:14:19][C][template.sensor:022]: State Class: ‘’
[19:14:19][C][template.sensor:022]: Unit of Measurement: ‘’
[19:14:19][C][template.sensor:022]: Accuracy Decimals: 0
[19:14:19][C][output.sigma_delta:024]: Turn off automation configured
[19:14:19][C][output.sigma_delta:026]: Update Interval: 1.0s

and

after changing the input number from HA

19:14:52][VV][scheduler:226]: Running interval ‘update’ with interval=1000 last_execution=43050 (now=44056)
[19:14:52][VV][api.service:831]: on_home_assistant_state_response: HomeAssistantStateResponse {
entity_id: ‘input_number.pumpenpower_thsol’
state: ‘0.86’
attribute: ‘’
}
[19:14:52][D][homeassistant.sensor:024]: ‘input_number.pumpenpower_thsol’: Got state 0.86
[19:14:52][V][sensor:043]: ‘power’: Received new state 0.860000
[19:14:52][D][sensor:094]: ‘power’: Sending state 0.86000 with 2 decimals of accuracy
[19:14:53][VV][scheduler:226]: Running interval ‘update’ with interval=1000 last_execution=44050 (now=45053)
[19:14:53][VV][scheduler:226]: Running interval ‘update’ with interval=60000 last_execution=4294952411 (now=45115)

meaning that value was taken over as power…

But sigma_delta_output does not respond…

Do you need any more LOGs ??

some more information:

if i set a fix outputpower like

            id(slow_pwm_thsol).set_level(0.8);

and leave all the rest, the log ouput changes like that:

[19:43:26][C][template.switch:057]: Optimistic: YES
[19:43:26][C][output.sigma_delta:015]: Sigma Delta Output:
[19:43:26][C][output.sigma_delta:016]: Pin: GPIO13
[19:43:26][C][output.sigma_delta:021]: Turn on automation configured
[19:43:26][C][output.sigma_delta:024]: Turn off automation configured
[19:43:26][C][output.sigma_delta:026]: Update Interval: 1.0s
[19:43:26][C][output.sigma_delta:027]: Min Power: 40.0%
[19:43:26][C][captive_portal:089]: Captive Portal:

with the former variable power like:

        id(slow_pwm_thsol).set_level(id(power).state);

the logoutput was like:

[19:14:19][C][template.sensor:022]: Accuracy Decimals: 0
[19:14:19][C][output.sigma_delta:024]: Turn off automation configured
[19:14:19][C][output.sigma_delta:026]: Update Interval: 1.0s
[19:14:20][VV][scheduler:226]: Running in

so it seems, not to fully get the sigma_delta_output definitions…

So far …
BR
Norbert

So my conclusio is, that sigma_delta_output can NOT work with set_output funktion… :disappointed:

There’s not function like that on your code.
The differences between your two setups are very difficult to follow.

HI, sorry. Confused ".set_level" with “.set_output”…

So it should read as:

“So my conclusio is, that sigma_delta_output does NOT work with set_level funktion…”

neither directly in ESPHOME nor as a LAMBDA function.