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

Looks like you are on step 3 which says

You should get a popup. If you don’t, go to 192.168.4.1 and fill-in your wifi network name, password, MQTT server IP, and credentials. Click SAVE and connect back to your home wifi.

Looks like you have done everything except “SAVE”.

Hello. Can I use this esp8266?

Yes of course.

Hi. i got it connected and it works great but i don’t know how to get audio from pc or convert text to audio and stream it there.

Look under MQTT Commands in the docs https://github.com/schmurtzm/MrDiy-Audio-Notifier

Can somebody help me?

I’ve used D1mini v 3.0.0, and can’t connect to AP. It says that the password is incorrect.

Can see wifi network “MrDIYNotifier-145574”, but can’t connect (wifi wrong password)
What do i do wrong?

23:33:57.168 → Config size: 357
23:33:57.168 → Wrong config version. Applying defaults.
23:33:57.168 → [iwcAll]
23:33:57.168 → |-- [iwcSys]
23:33:57.168 → | |-- ‘iwcThingName’ with value: ‘MrDIYNotifier-145574’
23:33:57.215 → | |-- ‘iwcApPassword’ with value:
23:33:57.215 → | |-- [iwcWifi0]
23:33:57.215 → | | |-- ‘iwcWifiSsid’ with value: ‘’
23:33:57.215 → | | – ‘iwcWifiPassword’ with value:
23:33:57.215 → | – ‘iwcApTimeout’ with value: ‘30’
23:33:57.215 → |-- [iwcCustom]
23:33:57.215 → | |-- [mqttgroup]
23:33:57.215 → | | |-- ‘mqttServer’ with value: ‘’
23:33:57.215 → | | |-- ‘mqttUser’ with value: ‘’
23:33:57.215 → | | |-- ‘mqttPass’ with value:
23:33:57.215 → | | – ‘mqttTopic (without / at the end)’ with value: ‘’
23:33:57.215 → | – [soundgroup]
23:33:57.215 → | |-- ‘Sound_output’ with value: ‘’
23:33:57.215 → | |-- ‘Sound_Volume’ with value: ‘0.5’
23:33:57.215 → | |-- ‘samVoice :’ with value: ‘’
23:33:57.262 → | – ‘GoogleTTSvoice’ with value: ‘’
23:33:57.262 → – [hidden]
23:33:57.262 →
23:33:57.262 → Using No DAC output on ESP8266, audio output on pins
23:33:57.262 → speaker L & R → GPIO3 (RX)
23:33:57.262 → Don’t try and drive the speaker pins can’t give enough current to drive even a headphone well and you may end up damaging your device
23:33:57.262 → SkipApStartup is requested, but either no WiFi was set up, or configButton was pressed.
23:33:57.262 → AP password was not set in configuration
23:33:57.262 → State changing from: 0 to 1
23:33:57.262 → Setting up AP: MrDIYNotifier-145574
23:33:57.309 → With default password:
23:33:58.152 → AP IP address: 192.168.4.1
23:33:58.152 → AP password was not set.
23:33:58.152 → WiFi SSID was not set.
23:33:58.152 → Will stay in AP mode.
23:33:58.152 → State changed from: 0 to 1
23:33:59.559 → [MQTT] /status idle

What password are you using?

mrdiy.ca is the pass i use.

Hi,

When I copy your code to my configuration.yaml I get the following error:

any idea on what I am doing wrong?

This is a GREAT post! I was looking for a way to get notifications without the need of an intermediary like Alexa or Google Assistant. I have been able to successfully flash the D1 Mini with “MrDIY_notifier_custom_MQTT.bin” file. I go through the process of AP configuration, and all goes smoothly:

For Access Point Password I put “mrdiy.ca” and for the MQTT Server, I put the IP of my home assistant server (10.0.0.171), my MQTT USER and MQTT Password (which I added as a user). For the MQTT Topic I add the “/mrdiynotifier”.

image

I then restart my mqtt broker, wait a minute for it to start and then I plug the D1 Mini to a speaker and plug the USB to power, I hear the connection sound that indicates connection to WIFI and MQTT server. After hearing the connection sound, I can see the following mqtt log (although I keep refreshing, and connecting back again the D1 Mini (hearing the sound), I cannot see anything coming up as MrDIy Notifier in the mqtt log):

If I let a couple of hours to go by, I will see the following:

The 10.0.0.237 is the mrdiynotifier D1 Mini, and the other IP 172.30.32.5 I have no idea what it is…

I try publish mqtt commands to give me a status, but still cannot hear anything and cannot see anything in the mqtt log:

Any ideas on what I could be doing wrong?

Update:

I have decided to completely uninstall my Mosquitto broker from my home assistant adds-on, and I have disabled my Wyze Docker Bridge (it was using mqtt to discover cameras in my home). Then I uninstalled my Core-Mosquitto MQTT from my integrations, and proceeded to restart my server.

I then re-installed my Mosquitto broker and restarted my HA server again. When restarted, a new integration MQTT was discovered and I configured it. The following default configuration is shown:

I plug my D1 Mini (already flashed) and I hear the connection sound… After that, I try to publish the following:

But nothing happens…

hello,

since a few month you have a i2s media_player available in Esphome, its simple and work right of the box with an Esp32 (not 8266).

You can TTS messages with.

Enjoy

1 Like

Perhaps you missed this, as you named your user homeassistant

Create a new user for MQTT via your Home Assistant’s frontend ConfigurationUsers (manage users) , (i.e. not on Mosquitto’s Configuration tab). Notes:

  1. This name cannot be homeassistant or addons, those are reserved usernames.
  2. If you do not see the option to create a new user, ensure that Advanced Mode is enabled in your Home Assistant profile.

EDITED Hey you don’t publish to status, you subscribe to it.

Thanks for your reply! I appreciate your time :slight_smile:

For the username, I created a user (user: mqttuser ; password: mqttpassord in the homeassistant users configuration). That is the user I add to the AP configuration:

The image below only shows the mqtt broker configuration (Settings > Integrations > MQTT Configuration > Reconfigure).

image

you mean: /mrdiynotifier/subscribe?

Not sure what you mean with subscribe to it…

You probably need to read a good MQTT primer, but basically MQTT communicates outward by a client (HA) subscribing to a topic. The other device (the esp) publishes to the topic. MQTT is a kind of postbox. See Beginners Guide To The MQTT Protocol

now its done natively in EspHome what a great improvement!!!

So you are saying we don’t need to flash with the tasmota bin file and use esphome with an esp32 instead?

Will this 12S dac work? Where is the i2s_dout_pin in the image??

i just read the docs…nothing i have invented lol

And i have make some soldering with a ssd1351 screen and its work great. Mine is stereo, this board is mono.

so the response to your questions are YES and YES

i2s_dout_pin in yur picture is din
i2s_lrclk_pin in yur picture is lrc
i2s_bclk_pin in yur picture is bclk

and yu need vin and gnd thats all, 5v work better as 3,3v on my i2s board (white noise) which is a cheap clony of this Adafruit board from Aliexpress

I have built a media player using a DAC and esp32. All seems fine but I don’t have an entity associated with the player so I can’t play to it.
Any ideas?
Here is the main part of the code.

media_player:

  - platform: i2s_audio

    id: media_out_1

    name: Media Player 1

    dac_type: external

    i2s_lrclk_pin: GPIO33

    i2s_dout_pin: GPIO22

    i2s_bclk_pin: GPIO19

    mode: mono