Turn an ESP8266 WemosD1Mini into an audio notifier for Home Assistant: Play MP3, TTS & RTTL

By the way, I uploaded a new bin file that uses MQTT topics as shown in the video, with the leading “/”.

Since I can’t fix the video, I did the change in the bin file.

It is difficult to help without seeing the logs.

I tried it on 3 different D1 minis and they all worked fine. There could be an issue with yourEEPROM, maybe try another d1 mini?

Yes, at ESP8266Audio, Earle did a great job squeezing an MP3 decoder out the tiny ESP8266.

That is an intersting idea. I thought about utilizing the LED opening on the google mini for visual notifications and maybe the touch sensor as button intpus… but the mic didn’t click in. I will keep that in mind. Thanks.

How to share logs?

And this brings me to another question…

I I would have like 10 of these D1 minis with your bin?

How would I be able to send to the correct one?

Tried another one…

but not saving… what i do:

  1. tasmotizer it with your firmware
  2. connect to the ssid by phone
  3. fill all fields and (also your password (mrdiy.ca)
  4. it tells me to disconnect wifi (I do).
  5. I can see the device, ping it and it works.
  6. I pull the power, wait, replug an then it is not connected to my wifi but sending out the MrDIY Notifier ssid again…
    And then I can start at 3.

I have also tried multiple D1’s now, same behaviour.

Maybe… what are the fields for:

I tried both:
Access point name and password:
MrDIY Notifier - mrdiy.ca

WiFi name and password
my ssid and password

both not working… (saving)

EDIT: it is very reproducable on both mini’s

Can you go to the local IP address of the device and share a screenshot? I want to see what info is/not being saved.

Great project, I’m gonna give this a go.

1 Like

Edit: this is where it is still connected to my own wifi

Did you tried to turn off cellular data when connecting to D1? I used to have strange problems with my esp devices with cellular data on.

Thank you for your tip. that is not an issue since routing is gone well to the device (hence it is connected to my wifi).

Nevertheless I tried, same behaviour. - not working as well…

Extra info: After I thus configure via mobile and i önnect to my own wifi, I get this “plump” sound and then it works. On the mobile I get this:

BUT to avoid misunderstanding: it is never saved to the device.

EDIT: tried the latest bin…

also not working. I noticed that the mqtt topic changed there in deed with a “/”

I think it is a fantastic project.

And I like the video from start till end. There are so many good pieces of code posted on github or gitlab that never gets used because noone have a clue what it does. You video tells what your project does, how I can use it in practical and what advantages it has. It is also nice to hear the quality (and lack of for the TTS) that I can expect.

I will have a go with this for serving mp3.

The thing is that you can use your existing Google based TTS to create the mp3 files. You just type in the TTS strings you normally use and the mp3s are then cached in Home assistant. You can simply pick these files and rename/move them to where you have other web resources. The cache files are created in the …/homeassistant/tts directory and you just move the file over to the www folder and give it a better name. And then you can use these for the standard strings (“Someone at the front door”, “Washing machine is done”, “Diane is leaving work, remember to empty the dishwasher”). You need the cloud to create them but then with this project you can create a DIY speaker box that can service these files. I like the idea.

I actually did something like this with a Raspberry Pi but it is an expensive way to do it. A D1 mini cost 3 dollars. And a small amp a few dollars more. A real DIY solution where you get a lot for little.

The challenge would be to find a way that multiple boxes like these can play the same mp3 in sync. That could be a cool enhancement to the project.

2 Likes

“if” the wifi password stays saved :-)…

playing MP3 is not really flawless… there are a lot of hick ups in the start and stop of the audio, that “bump” the speaker… But I still love it for letting the dogs bark (that I do not even have :-)).

Then i would use esptool to erase flash on D1 and start fresh.

I know the IotWebConf library doesn’t move away from the AP mode when there are clients connected. Try to disable Wifi on your phone and start the device. This will eliminate the possiblity of your phone trying to connect to the AP and keeping it active.

You will need to download the source code for that and modify the MQTT topic for each device.

Thank you very much!

Yes, that is a greay way to get more natural TTS - way more natual than the built in one. There are also some great free online tools you can use like ttsmp3.com, www.text2voice.org or www.fromtexttospeech.com. They all provide MP3 files you can download directly. But I used the tmp folder to get the mp3 I played in the video that says “make sure to subscribe” - that was google TTS.

Raspberry Pi is probably more capable in doing full MP3 songs as compared to the D1 mini audio annoucer. They both have their purpose and place!

Thanks for sharing.

1 Like

Thank you kindly for these tips but I have no issue flashing. These minis, 3 same problem, work well with ordinary tasmota (saves well)