esphome / esphome/issues

dfplayer automatically raises volume

Open
#5,928 1 comment 0 reactions 0 assignees View on GitHub
stale
Dominant language
No language data
Stars
313
Forks
40
PR merge metrics
No merged PRs in 30d

Description

### The problem

The audio volume is raised to max after starting playback. Changing volume works, after it ist reset to max about 1 second after.

There are no automations connected to this entity running in home assistant.

### Which version of ESPHome has the issue?

2024.6.1

### What type of installation are you using?

Docker

### Which version of Home Assistant has the issue?

2024.6.3

### What platform are you using?

ESP32

### Board

esp32dev

### Component causing the issue

dfplayer

### Example YAML snippet

```yaml
substitutions:
name: esphome-web-a52754
friendly_name: esphome-web-a52754

esphome:
name: ${name}
friendly_name: ${friendly_name}
name_add_mac_suffix: false
project:
name: esphome.web
version: '1.0'
on_boot:
then:
- dfplayer.play_mp3: 1
- dfplayer.set_volume: 6

esp32:
board: esp32dev
framework:
type: arduino

# Enable logging
logger:

# Allow Over-The-Air updates
ota:
- platform: esphome

# Allow provisioning Wi-Fi via serial
improv_serial:

wifi:
# Set up a wifi access point
#ap: {}

# In combination with the `ap` this allows the user
# to provision wifi credentials to the device via WiFi AP.
#captive_portal:

dashboard_import:
package_import_url: github://esphome/example-configs/esphome-web/esp32.yaml@main
import_full_config: true

# Sets up Bluetooth LE (Only on ESP32) to allow the user
# to provision wifi credentials to the device.
#esp32_improv:
# authorizer: none

## To have a "next url" for improv serial
web_server:

uart:
tx_pin: GPIO26
rx_pin: GPIO27
baud_rate: 9600

button:
- platform: template
name: "Play Audio"
id: play
icon: "mdi:play"
on_press:
- dfplayer.play_mp3:
file: 1
- platform: template
name: "Stop Audio"
id: stop
icon: "mdi:stop"
on_press:
- dfplayer.stop

number:
- platform: template
name: "Volume"
id: "volumeSlider"
step: 1
min_value: 0
max_value: 30
mode: slider
icon: "mdi:volume-high"
optimistic: true
restore_value: true
on_value:
then:
- dfplayer.set_volume: !lambda 'return x;'

dfplayer:

api:
```

### Anything in the logs that might be useful for us?

```txt
[12:16:56][D][number:054]: 'Volume' - Setting number value
[12:16:56][D][number:113]: New number value: 9.000000
[12:16:56][D][number:012]: 'Volume': Sending state 9.000000
[12:16:56][D][dfplayer:032]: Send Command 0x6 arg 0x09
[12:16:58][D][number:054]: 'Volume' - Setting number value
[12:16:58][D][number:113]: New number value: 0.000000
[12:16:58][D][number:012]: 'Volume': Sending state 0.000000
[12:16:58][D][dfplayer:032]: Send Command 0x6 arg 0000
```

### Additional information

This issue is not new with this version. It seems to have worked with the 2024.04 release, but I cannot pin it down to a specific version.

The console output above is after setting the volume to 0, the actual volume is at max.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the dfplayer component and reproduce the ESP32/esp32dev configuration from the YAML snippet, especially playback followed by set_volume. Confirm the fix by ensuring playback no longer resets the configured volume to maximum and that the volume slider commands still produce the requested level.

Written by the indexing model from the issue text.

Assessment

Tech stack
embedded-iot
Domain
embedded-iot
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.