DFPlayer Mini MP3 player with ESPHome

From the docs

but if you need feedback of playback active you will also need to connect the rx_pin to the module’s TX .

Thanks for the answer. Yeah, I saw that before, but I didn’t tinker deeper. My Rx on Sonoff SV is already wired with Tx on dfplayer, straight from the beginning of the project. Reading documentation again, and I believe that this could be used somehow with dfplayer.is_playing condition. Will check it these days.

Or some uart sensor I guess.

Good hint, thanks.

In the device’s docs (linked in the first post, repeated here for ease) there are a number of serial query commands. DFPlayer_Mini_SKU_DFR0299-DFRobot

Do you know maybe how could I deploy these queries? E.g. if I want to get dfplayer current status in HA, I can try with something like this below:

sensor:
  - platform: template
    name: "DFPlayer Current Status"
    lambda: |-
      return {0x42};

This is stupid of course, because this have no any relation with Tx port of dfplayer and will return decimal value of 0x42 instead:

image!

I want to say: Do you know maybe what would be right syntax to query serial port?

Thx.

Only this Custom UART Text Sensor — ESPHome

Me again :grinning:

I believe my question is hard to answer, and one of those it is hard to troubleshoot, because I believe it is related with well known problems related with different variations of same board, made by no name Chinese manufacturers, but let’s ask anyway, cause I’m interested was someone had similar/same problem.

Let’s say I had DFPlayer A, which I bought in city where I’m living.
And let’s say I have DFPlayer B, bought on Aliexpress, because they are 4-5 times cheaper there.

I have ESPHome setup for DFPlayer, we already discussed it in above posts. It is pretty default, basically, I copied all possible services from here. I can paste here whole ESPHome .yaml if someone is need it, but I think it is not relevant for my question.

Last weekend, I experimented something, and I burned DFPlayer A (white smoke :rofl:). I replaced it immediately with DFPlayer B which I already had as spare one, but it behave differently. They are look same, but with DFPlayer B if esphome.dfplayer_dfplayer_random service is called, it will play random song and that part is ok. But when that song finish, it wont continue with next random song, it will stop instead. Also, once when stop, if I call esphome.dfplayer_dfplayer_start it will start previously played song again, from beginning.

This was not the case with DFPlayer A. Once when esphome.dfplayer_dfplayer_random was triggered, DFPlayer A would shuffle all songs from SD card.

Did someone have similar problem, thx?