Hauptmenü

Sonos und Sprachausgabe

Begonnen von t1me2die, 16 Dezember 2016, 14:48:53

Vorheriges Thema - Nächstes Thema

t1me2die

Moin liebe Community,

ich habe soeben meine beiden Sonos Play1 in FHEM integriert. Soweit funktioniert auch alles, nun wollte ich die Funktion Speak testen.

Zitat
set Sonos_Kueche Speak 25 de Hallo dies ist ein Test

Wenn ich den Befehl absetze, startet das Radio leider nur, aber es kommt keine Sprachausgabe.

Die Attribute habe ich gesetzt
Zitat
attr Sonos targetSpeakDir /opt/fhem/SonosSpeak
attr Sonos targetSpeakURL \\meine_FHEM_IP\SonosSpeak
attr Sonos targetSpeakFileTimestamp
attr Sonos targetSpeakMP3FileDir /opt/fhem/SonosSpeak

Die Ordner und die jeweiligen Einstellungen habe ich wie beschrieben auf: http://www.meintechblog.de/2015/07/sonos-play1-und-fhem-sound-im-ganzen-haus/ durchgeführt.
Den Samba Server habe ich auch neu gestartet.

Leider finde ich den Fehler nicht so richtig.

Gruß
Mathias

Wuppi68

FHEM unter Proxmox als VM

t1me2die

Nach einem Restart von FHEM funktioniert es ohne das ich irgendwas verändert habe  :)

Devender

Änderungen am Sonosdevice brauchen meist einen Neustart.
Reicht schon das Anpassen des LogLevel. Ich vermute das Device speichert bissel was Intern beim Start.


FHEM 5.8 auf RasPi mit Jessy - CUL868, JeeLink Lacrosse
Komponenten: HM, IT, ELV, FB7390, FritzPL543,Sonos Play3
Mehrere Wandtablets sowie einen Smart Mirror
https://wiki.fhem.de/wiki/Anwesenheitserkennung#PRESENCE-Modul

Schiri1986

Ich habe leider auch große Probleme damit und denke, es liegt am SMB-Share, denn die Files werden generiert und abgelegt, aber nicht abgespielt...

So sieht es bei SONOS aus

targetSpeakDir /mnt/SonosSpeak
   targetSpeakFileTimestamp 1
   targetSpeakMP3FileDir /mnt/SonosSpeak
   targetSpeakURL \\fhem\SonosSpeak


Und so bei SMB

#
# Sample configuration file for the Samba suite for Debian GNU/Linux.
#
#
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options most of which
# are not shown in this example
#
# Some options that are often worth tuning have been included as
# commented-out examples in this file.
#  - When such options are commented with ";", the proposed setting
#    differs from the default Samba behaviour
#  - When commented with "#", the proposed setting is the default
#    behaviour of Samba but the option is considered important
#    enough to be mentioned here
#
# NOTE: Whenever you modify this file you should run the command
# "testparm" to check that you have not made any basic syntactic
# errors.

#======================= Global Settings =======================

[global]

## Browsing/Identification ###

# Change this to the workgroup/NT-domain name your Samba server will part of
   workgroup = WORKGROUP

# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable its WINS Server
;   wins support = no

# WINS Server - Tells the NMBD components of Samba to be a WINS Client
# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
#   wins server = w.x.y.z

# This will prevent nmbd to search for NetBIOS names through DNS.
   dns proxy = no

#### Networking ####

# The specific set of interfaces / networks to bind to
# This can be either the interface name or an IP address/netmask;
# interface names are normally preferred
;   interfaces = 127.0.0.0/8 eth0

# Only bind to the named interfaces and/or networks; you must use the
# 'interfaces' option above to use this.
# It is recommended that you enable this feature if your Samba machine is
# not protected by a firewall or is a firewall itself.  However, this
# option cannot handle dynamic or non-broadcast interfaces correctly.
;   bind interfaces only = yes



#### Debugging/Accounting ####

# This tells Samba to use a separate log file for each machine
# that connects
   log file = /var/log/samba/log.%m

# Cap the size of the individual log files (in KiB).
   max log size = 1000

# If you want Samba to only log through syslog then set the following
# parameter to 'yes'.
#   syslog only = no

# We want Samba to log a minimum amount of information to syslog. Everything
# should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log
# through syslog you should set the following parameter to something higher.
   syslog = 0

# Do something sensible when Samba crashes: mail the admin a backtrace
   panic action = /usr/share/samba/panic-action %d


####### Authentication #######

# Server role. Defines in which mode Samba will operate. Possible
# values are "standalone server", "member server", "classic primary
# domain controller", "classic backup domain controller", "active
# directory domain controller".
#
# Most people will want "standalone sever" or "member server".
# Running as "active directory domain controller" will require first
# running "samba-tool domain provision" to wipe databases and create a
# new domain.
   server role = standalone server

# If you are using encrypted passwords, Samba will need to know what
# password database type you are using. 
   passdb backend = tdbsam

   obey pam restrictions = yes

# This boolean parameter controls whether Samba attempts to sync the Unix
# password with the SMB password when the encrypted SMB password in the
# passdb is changed.
   unix password sync = yes

# For Unix password sync to work on a Debian GNU/Linux system, the following
# parameters must be set (thanks to Ian Kahan <<kahan@informatik.tu-muenchen.de> for
# sending the correct chat script for the passwd program in Debian Sarge).
   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .

# This boolean controls whether PAM will be used for password changes
# when requested by an SMB client instead of the program listed in
# 'passwd program'. The default is 'no'.
   pam password change = yes

# This option controls how unsuccessful authentication attempts are mapped
# to anonymous connections
   map to guest = bad user

########## Domains ###########

#
# The following settings only takes effect if 'server role = primary
# classic domain controller', 'server role = backup domain controller'
# or 'domain logons' is set
#

# It specifies the location of the user's
# profile directory from the client point of view) The following
# required a [profiles] share to be setup on the samba server (see
# below)
;   logon path = \\%N\profiles\%U
# Another common choice is storing the profile in the user's home directory
# (this is Samba's default)
#   logon path = \\%N\%U\profile

# The following setting only takes effect if 'domain logons' is set
# It specifies the location of a user's home directory (from the client
# point of view)
;   logon drive = H:
#   logon home = \\%N\%U

# The following setting only takes effect if 'domain logons' is set
# It specifies the script to run during logon. The script must be stored
# in the [netlogon] share
# NOTE: Must be store in 'DOS' file format convention
;   logon script = logon.cmd

# This allows Unix users to be created on the domain controller via the SAMR
# RPC pipe.  The example command creates a user account with a disabled Unix
# password; please adapt to your needs
; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u

# This allows machine accounts to be created on the domain controller via the
# SAMR RPC pipe. 
# The following assumes a "machines" group exists on the system
; add machine script  = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u

# This allows Unix groups to be created on the domain controller via the SAMR
# RPC pipe. 
; add group script = /usr/sbin/addgroup --force-badname %g

############ Misc ############

# Using the following line enables you to customise your configuration
# on a per machine basis. The %m gets replaced with the netbios name
# of the machine that is connecting
;   include = /home/samba/etc/smb.conf.%m

# Some defaults for winbind (make sure you're not using the ranges
# for something else.)
;   idmap uid = 10000-20000
;   idmap gid = 10000-20000
;   template shell = /bin/bash

# Setup usershare options to enable non-root users to share folders
# with the net usershare command.

# Maximum number of usershare. 0 (default) means that usershare is disabled.
;   usershare max shares = 100

# Allow users who've been granted usershare privileges to create
# public shares, not just authenticated ones
   usershare allow guests = yes

#======================= Share Definitions =======================

[SonosSpeak]
  read only = false
  path = /mnt/SonosSpeak
  guest ok = yes
  public = yes
  map to guest = bad user
  guest account = nobody
  force user = fhem
  force group = dialout

# By default, the home directories are exported read-only. Change the
# next parameter to 'no' if you want to be able to write to them.
   read only = yes

# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
   create mask = 0775

# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
   directory mask = 0700

# By default, \\server\username shares can be connected to by anyone
# with access to the samba server.
# The following parameter makes sure that only "username" can connect
# to \\server\username
# This might need tweaking when using external authentication schemes
   valid users = %S

# Un-comment the following and create the netlogon directory for Domain Logons
# (you need to configure Samba to act as a domain controller too.)
;[netlogon]
;   comment = Network Logon Service
;   path = /home/samba/netlogon
;   guest ok = yes
;   read only = yes

# Un-comment the following and create the profiles directory to store
# users profiles (see the "logon path" option above)
# (you need to configure Samba to act as a domain controller too.)
# The path below should be writable by all users so that their
# profile directory may be created the first time they log on
;[profiles]
;   comment = Users profiles
;   path = /home/samba/profiles
;   guest ok = no
;   browseable = no
;   create mask = 0600
;   directory mask = 0700

[printers]
   comment = All Printers
   browseable = no
   path = /var/spool/samba
   printable = yes
   guest ok = no
   read only = yes
   create mask = 0700

# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
   comment = Printer Drivers
   path = /var/lib/samba/printers
   browseable = yes
   read only = yes
   guest ok = no
# Uncomment to allow remote administration of Windows print drivers.
# You may need to replace 'lpadmin' with the name of the group your
# admin users are members of.
# Please note that you also need to set appropriate Unix permissions
# to the drivers directory for these users to have write rights in it
;   write list = root, @lpadmin



Ich habe schon einiges probiert, aber ich kriege auch beim Aufruf von anderen Geräten immer die Abfrage nach Nutzername und Passwort. Wenn ich den Paramter security = share bei global setze, startet Samba gar nicht mehr.

Pr3mut05

Ich bekomme Samba leider nicht zum laufen  :(
Erkennt man hier schon den Fehler?


pi@raspberrypi:~ $ sudo /etc/init.d/samba restart
[ ok ] Restarting nmbd (via systemctl): nmbd.service.
[....] Restarting smbd (via systemctl): smbd.serviceJob for smbd.service failed. See 'systemctl status smbd.service' and 'journalctl -xn' for details.
failed!



pi@raspberrypi:~ $ systemctl status smbd.service
● smbd.service - Samba SMB Daemon
   Loaded: loaded (/lib/systemd/system/smbd.service; enabled)
   Active: failed (Result: core-dump) since Tue 2017-07-18 18:38:48 CEST; 12min ago
     Docs: man:smbd(8)
           man:samba(7)
           man:smb.conf(5)
  Process: 620 ExecStart=/usr/sbin/smbd $SMBDOPTIONS (code=dumped, signal=SEGV)
Main PID: 620 (code=dumped, signal=SEGV)

Otto123

Zitat von: Pr3mut05 am 18 Juli 2017, 18:55:00
Ich bekomme Samba leider nicht zum laufen  :(
Erkennt man hier schon den Fehler?
Hi
leider nicht. Was hast Du denn bisher gemacht?

sudo apt-get install samba samba-common-bin
Der Samba Service muss noch konfiguriert werden, da ich Dateien für SonosSpeak bereitstellen will.
sudo mkdir /mnt/SonosSpeak
sudo chmod 777 /mnt/SonosSpeak/
sudo nano /etc/samba/smb.conf

Folgende Zeilen hinzufügen:
[SonosSpeak] comment = Audio-Files for SonosPlayer to Speak
read only = false
path = /mnt/SonosSpeak
guest ok = yes

Sicherstellen, dass in der Global-Sektion der Parameter Security auf Share steht (oder gar nicht erst definiert wurde):
[global]
security = share


Gruß Otto
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

Pr3mut05

#7
Ich habe diese Anleitung genutzt
http://www.meintechblog.de/2015/07/sonos-play1-und-fhem-sound-im-ganzen-haus/

Im Prinzig ja wohl das selbe, nur mit anderen Ordner




Otto123

Zitat von: Pr3mut05 am 19 Juli 2017, 00:13:46
Im Prinzig ja wohl das selbe, nur mit anderen Ordner
Moin,

Im Prinzip könnte man versuchen Dir zu helfen, wenn Du sagen würdest was nicht geht.  :-[
Meine Frage zielt nicht darauf ab zu lesen was irgendwo steht, sondern was Du gemacht hast und was dabei passiert ist.

Der samba Dienst lief sofort nach der Installation nicht?
Es gab Fehler bei der Installation?
Du könntest deine smb.conf posten...

Ohne Info wird Dir keiner helfen können und wollen.

Gruß Otto
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

Eifelman

Hallo Zusammen,

hier wurde zwar länger nichts mehr geschrieben, aber weil mein Problem in diesen Thread passt, hänge ich mich hier mal mit dran.

Bei der Einrichtung hatte ich den gleichen Effekt wie t1me2die. Viel ausprobiert und nichts ging und nach einem Neustart von FHEM konnte ich das Sonos-Gerät problemlos einbinden. Der Player ist eine SONOS Playbar.

Probleme habe ich aber immer noch mit der Sprachausgabe.

Test mit: set Sonos_Sonos Speak 20 Anruf von 1 2 3 4 5

Im fhem-log steht dann:
2019.11.30 14:51:26 3: SONOS1: Load Google generated MP3 (1. Element) from "http://translate.google.com/translate_tts?tl=anruf&client=tw-ob&q=%20von%201%202%203%204%205" to "/opt/fhem/SonosSpeak/RINCON_347E5C70D4DC01400_MR_Speak_20191130-145126.mp31"
2019.11.30 14:51:26 1: SONOS1: MP3 Download-Error: 404 Not Found


Ich habe dann wget http://translate.google.com/translate_tts?tl=anruf&client=tw-ob&q=%20von%201%202%203%204%205 in der Console ausgeführt und erhalte folgende Fehlermeldung:

root@raspberrypi4:/opt/fhem/SonosSpeak# cat wget-log.1
--2019-11-30 14:59:24--  http://translate.google.com/translate_tts?tl=anruf
Auflösen des Hostnamens translate.google.com (translate.google.com)... 2a00:1450:4001:820::200e, 216.58.205.238
Verbindungsaufbau zu translate.google.com (translate.google.com)|2a00:1450:4001:820::200e|:80 ... verbunden.
HTTP-Anforderung gesendet, auf Antwort wird gewartet ... 302 Found
Platz: http://www.google.com/sorry/index?continue=http://translate.google.com/translate_tts%3Ftl%3Danruf&q=EhAgAwDRLy-aAHlLpsfxFo0UGLzrie8FIhkA8aeDS9QS_JEmW0MS8EFY-YD5UNO2XlTpMgFy [folgend]
--2019-11-30 14:59:24--  http://www.google.com/sorry/index?continue=http://translate.google.com/translate_tts%3Ftl%3Danruf&q=EhAgAwDRLy-aAHlLpsfxFo0UGLzrie8FIhkA8aeDS9QS_JEmW0MS8EFY-YD5UNO2XlTpMgFy
Auflösen des Hostnamens www.google.com (www.google.com)... 2a00:1450:4001:815::2004, 216.58.206.4
Verbindungsaufbau zu www.google.com (www.google.com)|2a00:1450:4001:815::2004|:80 ... verbunden.
HTTP-Anforderung gesendet, auf Antwort wird gewartet ... 429 Too Many Requests
2019-11-30 14:59:24 FEHLER 429: Too Many Requests.


Den Ordner "SonosSpeak" habe ich von /mnt nach /opt/fhem verschoben, weil der Ordner kein mount-point sondern eine Freigabe ist. Das hat aber wie erwartet das Problem nicht gelöst. Hier darf zwar wie in /mnt/SonosSpeak jeder alles, aber die Datei "RINCON_347E5C70D4DC01400_MR_Speak_20191130-145126.mp31" landet nicht in diesem Ordner!?

Die Konfiguration der Ordner aus der fhem.cfg sieht aktuell so aus:
attr Sonos targetSpeakDir /opt/fhem/SonosSpeak
attr Sonos targetSpeakFileTimestamp 1
attr Sonos targetSpeakMP3FileDir /opt/fhem/SonosSpeak
attr Sonos targetSpeakURL \\192.168.0.18\SonosSpeak
 

Was ist falsch konfiguriert oder wo fehlt noch etwas?


Gruß
Manfred
Grüße aus der Eifel
--------------------------------------------------------------------------------------------------
FHEM auf Raspberry Pi 4 mit CUL868&433, RaspBee, ioBroker & Node-Red

juemuc

Hallo,

kann Sonos auf das Verzeichnis, in der die mp3-Datei steht, zugreifen? Die Datei muss aus meiner Sicht im Verzeichnis "SonosSpeak" landen, sonst wird es nicht funktionieren.
Kopiere einmal die mp3-Datei manuell in das "SonosSpeak-Verzeichnis".

Viele Grüße

Jürgen
3x Sonos Play 1, 1x Sonos Arc + Sub, 1 Sonos-One, 1x Sonos Playbar
FB6690 + FB7490 mit 4x Dect 200 und 3 Dect-ULE-Thermostate,  raspberry3B+, HM Funkmodul HM-MOD-RPI-PCB, HM Klingelsensor HM-Sen-DB-PCB, HM (IP) Fensterkontakte und  Amazon Echo Dot,  piVCCU, pi OS (bookworm).

Eifelman

Hallo Zusammen,

ich hatte mich an dieser Anleitung orientiert: https://www.meintechblog.de/2015/07/sonos-play1-und-fhem-sound-im-ganzen-haus/

... und leider nicht genau hingesehen beim Teststring: set Sonos_Bad Speak 20 de Waschmaschine ist fertig

Allgemein heist das: set <sonos player> Speak <volume> <sprache bzw. länderkennung> <text ...>

Weil das "de" fehlte bzw. "Anruf" als Länderkennung bei google nicht zugeordnet werden konnte, wurde die MP3-Datei gar nicht erzeugt.

Läuft jetzt. Coole Sache. TV Ton wird unterbrochen und Ansage mit Volume 20% ist gut zu hören.


Viele Grüße
Manfred
Grüße aus der Eifel
--------------------------------------------------------------------------------------------------
FHEM auf Raspberry Pi 4 mit CUL868&433, RaspBee, ioBroker & Node-Red

Otto123

#12
Zitat von: Eifelman am 30 November 2019, 15:41:16
Test mit: set Sonos_Sonos Speak 20 Anruf von 1 2 3 4 5
Hallo Manfred,

ich denke Google kennt die Sprache Anruf nicht :)
Zitat Doku
ZitatSpeak <Volume> <Language> <Text>
Uses the Google Text-To-Speech-Engine for generating MP3-Files of the given text and plays it on the SonosPlayer. Possible languages can be obtained from Google. e.g. "de", "en", "fr", "es"...

set Sonos_Sonos Speak 20 de Anruf von 1 2 3 4 5



Gruß Otto
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

Dreggwatz

Hi zusammen,
hatte auch die ganze Zeit Probleme, das meine Sprachausgabe urplötzlich nicht mehr funktionierte.
Es liegt an meiner UFW Firewall, da hab ich zwar den Port 4713 vom SONOS auf allowed, aber scheinbar geht translate.google nicht durch.

Kann mir jemand sagen welche Ports für Google Translate Freigabe notwendig sind? Bin da irgendwie überfordert. Wenn ich die UFW disable geht die Sprachausgabe wieder. Danke

Zitat[ 1] 22                         ALLOW IN    Anywhere
[ 2] 80                         ALLOW IN    Anywhere
[ 3] 443                        ALLOW IN    Anywhere
[ 4] 8088                       ALLOW IN    Anywhere
[ 5] 8083                       ALLOW IN    Anywhere
[ 6] 21                         ALLOW IN    Anywhere
[ 7] 80/tcp                     ALLOW IN    Anywhere
[ 8] 53/tcp                     ALLOW IN    Anywhere
[ 9] 53/udp                     ALLOW IN    Anywhere
[10] 67/tcp                     ALLOW IN    Anywhere
[11] 67/udp                     ALLOW IN    Anywhere
[12] 9900                       ALLOW IN    Anywhere
[13] 1400                       ALLOW IN    Anywhere
[14] 4712                       ALLOW IN    Anywhere
[15] 4713                       ALLOW IN    Anywhere