SmartHome-yourself / sonoff-tx-ultimate-for-esphome

ESPHome Custom Component for Sonoff TX Ultimate
https://smarthomeyourself.de/sonoff-tx-ultimate-mit-esphome-custom-component/
MIT License
87 stars 36 forks source link

Sound volume too low #13

Open tiagombrito opened 11 months ago

tiagombrito commented 11 months ago

Hi,

I noticed you managed to have sound playing in the Sonoff, but the sound is too low volume, even with volume at max settings in home assistant.

Sonoff's promo videos mention alarm siren as a use case, which was my need, is there anything that can be done to increase the sound volume further (maybe some config i missed)?

Thank you.

danielscheidler commented 11 months ago

I don't think that it can work as a real siren. At least I don't know of anything to get the audio output significantly louder. I can test it with an unflashed one, but I suspect that these will not be louder either.

tiagombrito commented 11 months ago

Hi Daniel,

This is the youtube video I was refering to from Sonoff's channel, I just hope they didn't remove this from the specs, it'd be a cool feature to have.

Thank you very much for your reply.

chrisrock1984 commented 11 months ago

I have the same issue - sound is cristal clear but way too low ;-/ Tested it on 2 devices

tiagombrito commented 11 months ago

I bought some more wall switches, and i can't find any option in ewelink to make volume higher. So maybe this is a feature they discarded, and that video is not correct anymore.

loadedlouie commented 10 months ago

Hi , i tryed the sound from the switch, but although it works, it adds some "rain" to the sound itself, a bit, white noise if you can say that.. Also using for example google TTS it also adds that white noise sound ... is there any way to fix this ? Also great job doing this, I also add some other light effects to it, and I love it... thanks in advance for your time dedication and effort to create this for esphome/home assistant.

loadedlouie commented 10 months ago

Hi , i tryed the sound from the switch, but although it works, it adds some "rain" to the sound itself, a bit, white noise if you can say that.. Also using for example google TTS it also adds that white noise sound ... is there any way to fix this ? Also great job doing this, I also add some other light effects to it, and I love it... thanks in advance for your time dedication and effort to create this for esphome/home assistant.

In case anyone is wondering... i2s_comm_fmt: lsb (found it on another thread BLE proxy) solves the rain but keep the sound low.. :D

TeDeVPrime commented 10 months ago

yeah the speaker is VERY low. with the official firmware the sound is excellent. you can play doorbell sounds and it is just fine. in this case through ESP, you can barely hear it

danielscheidler commented 10 months ago

In case anyone is wondering... i2s_comm_fmt: lsb (found it on another thread BLE proxy) solves the rain but keep the sound low.. :D

Yes, the i2s_comm_fmt is already updated in my variants too (did I miss one?). But I've no idea how to get it louder.

TeDeVPrime commented 10 months ago

i am not even sure if it is louder in the tasmota. the sound is like 10% of the volume even though Home Assistant says 100%

conrad784 commented 9 months ago

I today flashed esphome without ever using it with ewelink and I am very happy about this project here. Initially I did not think about using the speakers, but it would be nice to have. So I hope what was said here is true that the original firmware does something differently.

yeah the speaker is VERY low. with the official firmware the sound is excellent. you can play doorbell sounds and it is just fine. in this case through ESP, you can barely hear it

May I ask how you found out which of the GPIOs are doing what @danielscheidler ? Maybe there is some pin which only has to be pulled high/low to enable some amplification?

letsautomatenet commented 7 months ago

So is the sound supposed to be working but just quiet at the moment?

When I try TTS from Home Assistant to it I just get very quiet static noise. No words are spoken. (The yaml has "i2s_comm_fmt: lsb" in it)

(Great work btw @danielscheidler. I was using a really old hand cracked yaml for this switch. This is much nicer)

barth11 commented 7 months ago

@letsautomatenet - The speaker is working flawlessly. I can put there mp3 song you can understand words. It's not loud or very good but that's not something I'd expect from something so small. For ringtone, notifications, doorbell it's enough.

Whatsek commented 7 months ago

@letsautomatenet - The speaker is working flawlessly. I can put there mp3 song you can understand words. It's not loud or very good but that's not something I'd expect from something so small. For ringtone, notifications, doorbell it's enough.

I want to use it as a doorbell, but the volume on my device is very low. If In play a mp3, I can nearly hear it when my ear is 20cm from the device. Could you share your config?

letsautomatenet commented 6 months ago

@letsautomatenet - The speaker is working flawlessly. I can put there mp3 song you can understand words. It's not loud or very good but that's not something I'd expect from something so small. For ringtone, notifications, doorbell it's enough.

Is there anything special you did? The audio section is as follows, as per the file tx_ultimate_local.yaml:

media_player:
  - platform: i2s_audio
    id: media_out
    name: ${friendly_name} Player
    dac_type: external
    i2s_dout_pin: ${audio_sdata_pin}
    i2s_audio_id: audio_i2s
    i2s_comm_fmt: lsb    
    mode: mono

The documentation here also says it doesn't work at moment so would be good to know how you got it working!

https://github.com/SmartHome-yourself/sonoff-tx-ultimate-for-esphome#media-player

Thanks.

barth11 commented 6 months ago

Is there anything special you did?

@letsautomatenet - I didn't change anything. I just used the setup from this repo and played mp3 from HA.

image

@Whatsek - I can hear the sound from another room but it's not loud but for me it was enough as it's not my primary speaker for ringbell. I didn't change anything.

letsautomatenet commented 6 months ago

Thanks for the reply.

No idea why mine isn't working. :-( It just goes straight to "Idle" when I try TTS or MP3.

letsautomatenet commented 6 months ago

I finally got it to work! Here were my issues in case someone else has similar:

It is indeed pretty quiet.

Whatsek commented 6 months ago

I will test some MP3`s tonight, @letsautomatenet pretty quiet, can you hear it from 3 meters away? (I cant)

knuppe commented 5 months ago

Same problem here, I can't hear the device from 3 meters away.

I was thinking about exploring the original firmware and see if we find something for it, does anyone have its original .bin file?

Nalith commented 5 months ago

Same problem here, I can't hear the device from 3 meters away.

I was thinking about exploring the original firmware and see if we find something for it, does anyone have its original .bin file?

I have the US version firmware for 2G and 3G.

robbiedehand commented 5 months ago

for me the sound is not hearable, if i put my ear against is i hear some static and when i play media that static is changing in tone for a short while, anybody got suggestions?

for now i connected out the audio component and will install, see if the static is gone

robbiedehand commented 5 months ago

@letsautomatenet

I finally got it to work! Here were my issues in case someone else has similar:

  • The URL presented by Home Assistant is my https external URL, as this is what is required for TTS with Google Home. This was not resolving/being blocked by my firewall for my ESP device. I assigned the ESP device a DNS address of my local AdGuard DNS server with a local rewrite rule to the HA ip address to prevent any potential DNS loopback/hairpin issues
  • Some of my MP3s simply don't play on it. So when I thought I hadn't resolved the comms issue, I in fact had. Perhaps it's the encoding of these MP3s it doesn't like. The same files play on the Google speakers.

It is indeed pretty quiet.

how did you see that is was blocked? i allready got adgaurd dns rewrites, but i suspect i have the sam isseu, i cant pinpoint it though

the-mentor commented 4 months ago

Anyone knows what's the i2c audio chip by any chance?

the-mentor commented 4 months ago

I found this from Jessie on the esphome discord

`media_player` volume is software driven, but if the amp itself has a default low max volume setting and can be configured via i2c etc then it needs its own compoennt to do that configuration at boot

Maybe we need to figure it out somewhere

robbiedehand commented 3 months ago

So i figured i did some testing while the wifey was away, with a glass of whiskey and no pressure what so ever :-)

my findings in my case, tts or media browser from home assistant was using https, and my home assistant is https , local also for some reason it would not play (even so de url would not be local but for some reason allway via nabu casa), and so i made an test scenario which server the files on my NAS on a simple http server

simple as this.

`alias: Nieuwe automatisering
description: ""
trigger:
  - type: occupied
    platform: device
    device_id: 19c7bf41f11e0c024dbde6588a6ad5b6
    entity_id: a824329a64949469b6f7c99fca669ce8
    domain: binary_sensor
condition: []
action:
  - service: media_player.play_media
    metadata: {}
    data:
      media_content_id: http://192.168.100.202/files/2.mp3
      media_content_type: music
    target:
      entity_id: media_player.tx_tom_tx_tom_player
mode: single
`

now for the fun part i hav multiple files there; ring.mp3 ring2.mp3 same as ring.mp3 but increase the volume of the file via mp3loader.com 1.mp 3, which is a MONO mp3 2.mp3 which is the same as 1.mp 3 but again i increase the volume of the file via mp3loader.com 4 decibels 3.mp3 which is the same as 1.mp 3 but again i increase the volume of the file via mp3loader.com 10 decibels 4.mp3 which is the same as 1.mp 3 but again i increase the volume of the file via mp3loader.com 7.5 decibels

it seems that with the right file you would get something feasable. i'm in the process of uploading the video files for reference

(so every link is a .mov with the relevant sound from the mp3 playing on my tx-ultimate.

for me that's a problem solved!

ring.mp3 https://github.com/SmartHome-yourself/sonoff-tx-ultimate-for-esphome/assets/88730917/8a796341-f04d-422d-90a4-bc7842f8aa28

ring2.mp3 https://github.com/SmartHome-yourself/sonoff-tx-ultimate-for-esphome/assets/88730917/4059ae34-1681-4e1f-b484-743b8c4d7b04

1.mp 3 https://github.com/SmartHome-yourself/sonoff-tx-ultimate-for-esphome/assets/88730917/42c67d2b-9238-4942-b899-a4750eef878a

2.mp3 https://github.com/SmartHome-yourself/sonoff-tx-ultimate-for-esphome/assets/88730917/a0f13024-fd22-45b6-8900-5f7bee68c05b

3.mp3 https://github.com/SmartHome-yourself/sonoff-tx-ultimate-for-esphome/assets/88730917/82a3e2e8-11a1-4489-b9b9-5cb53629a726

4.mp3 https://github.com/SmartHome-yourself/sonoff-tx-ultimate-for-esphome/assets/88730917/208a152c-9d6b-4a16-a886-8e6e4c610707

xHirscHx commented 3 months ago

Anybody fig this out yet when using tts. I bought a bigger speaker and it works but would prefer the smaller original one.

the-mentor commented 3 months ago

@xHirscHx what do you mean by you bought a bigger speaker ? did you replace the speaker in the device ?

xHirscHx commented 3 months ago

@xHirscHx what do you mean by you bought a bigger speaker ? did you replace the speaker in the device ?

yes, much bigger, i 3d printed an case , im not using the tough part just voice and the rgbs for my project

the-mentor commented 3 months ago

@xHirscHx do you mind sharing how you connected the speaker to the switch ? thanks

xHirscHx commented 3 months ago

Took it apart bought 1mm 2 pin conecters on Amazon. Bought multiple sized speakers to test.

QapaMcFly commented 1 day ago

@xHirscHx Please let us know how it went @robbiedehand Thank you thats decent solution in my case