Sonos2mqtt - vielleicht hat jemand Lust mitzumachen

Begonnen von Otto123, 31 Mai 2020, 18:30:55

Vorheriges Thema - Nächstes Thema

Otto123

Moin,

nochmal durchgespielt:
neuestes RaspiOS (Warum muss man ein Image am 2.12. herausbringen was heute so lange wie kein Image davor zum Update braucht?)
Dann OS aktualisiert
Dann nodejs installiert:
#!/bin/bash
# look for Releases https://nodejs.org/de/about/releases/
curl -sL https://deb.nodesource.com/setup_14.x | bash -
apt-get install -y nodejs
apt-get install -y libjson-pp-perl
npm install pm2 -g

Dann weiter im kompletten Screenshot:
sudo npm install -g sonos2mqtt
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
/usr/bin/sonos2mqtt -> /usr/lib/node_modules/sonos2mqtt/lib/index.js

> fast-xml-parser@3.17.5 postinstall /usr/lib/node_modules/sonos2mqtt/node_modules/fast-xml-parser
> node tasks/postinstall.js || exit 0

Love fast-xml-parser? Check https://amitkumargupta.work for more projects and contribution.

+ sonos2mqtt@3.1.0
added 117 packages from 75 contributors in 25.568s
pi@raspib31:~ $ pm2 start sonos2mqtt -- --mqtt mqtt://user:password@192.168.56.80:1883

                        -------------

__/\\\\\\\\\\\\\____/\\\\____________/\\\\____/\\\\\\\\\_____
_\/\\\/////////\\\_\/\\\\\\________/\\\\\\__/\\\///////\\\___
  _\/\\\_______\/\\\_\/\\\//\\\____/\\\//\\\_\///______\//\\\__
   _\/\\\\\\\\\\\\\/__\/\\\\///\\\/\\\/_\/\\\___________/\\\/___
    _\/\\\/////////____\/\\\__\///\\\/___\/\\\________/\\\//_____
     _\/\\\_____________\/\\\____\///_____\/\\\_____/\\\//________
      _\/\\\_____________\/\\\_____________\/\\\___/\\\/___________
       _\/\\\_____________\/\\\_____________\/\\\__/\\\\\\\\\\\\\\\_
        _\///______________\///______________\///__\///////////////__


                          Runtime Edition

        PM2 is a Production Process Manager for Node.js applications
                     with a built-in Load Balancer.

                Start and Daemonize any application:
                $ pm2 start app.js

                Load Balance 4 instances of api.js:
                $ pm2 start api.js -i 4

                Monitor in production:
                $ pm2 monitor

                Make pm2 auto-boot at server restart:
                $ pm2 startup

                To go further checkout:
                http://pm2.io/


                        -------------

[PM2] Spawning PM2 daemon with pm2_home=/home/pi/.pm2
[PM2] PM2 Successfully daemonized
[PM2] Starting /usr/bin/sonos2mqtt in fork_mode (1 instance)
[PM2] Done.
┌─────┬───────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id  │ name          │ namespace   │ version │ mode    │ pid      │ uptime │ ↺    │ status    │ cpu      │ mem      │ user     │ watching │
├─────┼───────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 0   │ sonos2mqtt    │ default     │ N/A     │ fork    │ 1706     │ 0s     │ 0    │ online    │ 0%       │ 22.4mb   │ pi       │ disabled │
└─────┴───────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
pi@raspib31:~ $
keine Fehlermeldung!
pm2 startup einegrichtet
pm2 startup
[PM2] Init System found: systemd
[PM2] To setup the Startup Script, copy/paste the following command:
sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u pi --hp /home/pi
pi@raspib31:~ $ sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u pi --hp /home/pi

                        -------------

__/\\\\\\\\\\\\\____/\\\\____________/\\\\____/\\\\\\\\\_____
_\/\\\/////////\\\_\/\\\\\\________/\\\\\\__/\\\///////\\\___
  _\/\\\_______\/\\\_\/\\\//\\\____/\\\//\\\_\///______\//\\\__
   _\/\\\\\\\\\\\\\/__\/\\\\///\\\/\\\/_\/\\\___________/\\\/___
    _\/\\\/////////____\/\\\__\///\\\/___\/\\\________/\\\//_____
     _\/\\\_____________\/\\\____\///_____\/\\\_____/\\\//________
      _\/\\\_____________\/\\\_____________\/\\\___/\\\/___________
       _\/\\\_____________\/\\\_____________\/\\\__/\\\\\\\\\\\\\\\_
        _\///______________\///______________\///__\///////////////__


                          Runtime Edition

        PM2 is a Production Process Manager for Node.js applications
                     with a built-in Load Balancer.

                Start and Daemonize any application:
                $ pm2 start app.js

                Load Balance 4 instances of api.js:
                $ pm2 start api.js -i 4

                Monitor in production:
                $ pm2 monitor

                Make pm2 auto-boot at server restart:
                $ pm2 startup

                To go further checkout:
                http://pm2.io/


                        -------------

[PM2] Init System found: systemd
Platform systemd
Template
[Unit]
Description=PM2 process manager
Documentation=https://pm2.keymetrics.io/
After=network.target

[Service]
Type=forking
User=pi
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
Environment=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games:/usr/bin:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
Environment=PM2_HOME=/home/pi/.pm2
PIDFile=/home/pi/.pm2/pm2.pid
Restart=on-failure

ExecStart=/usr/lib/node_modules/pm2/bin/pm2 resurrect
ExecReload=/usr/lib/node_modules/pm2/bin/pm2 reload all
ExecStop=/usr/lib/node_modules/pm2/bin/pm2 kill

[Install]
WantedBy=multi-user.target

Target path
/etc/systemd/system/pm2-pi.service
Command list
[ 'systemctl enable pm2-pi' ]
[PM2] Writing init configuration in /etc/systemd/system/pm2-pi.service
[PM2] Making script booting at startup...
[PM2] [-] Executing: systemctl enable pm2-pi...
Created symlink /etc/systemd/system/multi-user.target.wants/pm2-pi.service → /etc/systemd/system/pm2-pi.service.
[PM2] [v] Command successfully executed.
+---------------------------------------+
[PM2] Freeze a process list on reboot via:
$ pm2 save

[PM2] Remove init script via:
$ pm2 unstartup systemd
pi@raspib31:~ $ pm2 save
[PM2] Saving current process list...
[PM2] Successfully saved in /home/pi/.pm2/dump.pm2
pi@raspib31:~ $
Fehlerfrei - also Doku ist ok :)

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

TomLee

Sag ja auch nicht das an der Doku was nicht OK ist.

Hab doch auch nix falsch gemacht ?
Hab den Dienst gestern Abend gestoppt und einfach nochmal den pm2 startup eingerichtet.
Merkwürdigerweise ohne Meldungen, hab zuvor keine Änderungen vorgenommen.

pi@FHEMPIOS:~ $ pm2 stop sonos2mqtt
[PM2] Applying action stopProcessId on app [sonos2mqtt](ids: [ 0 ])
[PM2] [sonos2mqtt](0) ✓
┌─────┬───────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id  │ name          │ namespace   │ version │ mode    │ pid      │ uptime │ ↺    │ status    │ cpu      │ mem      │ user     │ watching │
├─────┼───────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 0   │ sonos2mqtt    │ default     │ N/A     │ fork    │ 0        │ 0      │ 0    │ stopped   │ 0%       │ 0b       │ pi       │ disabled │
└─────┴───────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
pi@FHEMPIOS:~ $ pm2 start sonos2mqtt -- --mqtt mqtt://user:passwd@192.168.188.26:1883
[PM2] Applying action restartProcessId on app [sonos2mqtt](ids: [ 0 ])
[PM2] [sonos2mqtt](0) ✓
[PM2] Process successfully started
┌─────┬───────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id  │ name          │ namespace   │ version │ mode    │ pid      │ uptime │ ↺    │ status    │ cpu      │ mem      │ user     │ watching │
├─────┼───────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 0   │ sonos2mqtt    │ default     │ N/A     │ fork    │ 4044     │ 0s     │ 0    │ online    │ 0%       │ 20.1mb   │ pi       │ disabled │
└─────┴───────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
pi@FHEMPIOS:~ $ pm2 startup
[PM2] Init System found: systemd
[PM2] To setup the Startup Script, copy/paste the following command:
sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u pi --hp /home/pi
pi@FHEMPIOS:~ $ sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u pi --hp /home/pi
[PM2] Init System found: systemd
Platform systemd
Template
[Unit]
Description=PM2 process manager
Documentation=https://pm2.keymetrics.io/
After=network.target

[Service]
Type=forking
User=pi
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
Environment=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games:/usr/bin:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
Environment=PM2_HOME=/home/pi/.pm2
PIDFile=/home/pi/.pm2/pm2.pid
Restart=on-failure

ExecStart=/usr/lib/node_modules/pm2/bin/pm2 resurrect
ExecReload=/usr/lib/node_modules/pm2/bin/pm2 reload all
ExecStop=/usr/lib/node_modules/pm2/bin/pm2 kill

[Install]
WantedBy=multi-user.target

Target path
/etc/systemd/system/pm2-pi.service
Command list
[ 'systemctl enable pm2-pi' ]
[PM2] Writing init configuration in /etc/systemd/system/pm2-pi.service
[PM2] Making script booting at startup...
[PM2] [-] Executing: systemctl enable pm2-pi...
[PM2] [v] Command successfully executed.
+---------------------------------------+
[PM2] Freeze a process list on reboot via:
$ pm2 save

[PM2] Remove init script via:
$ pm2 unstartup systemd
pi@FHEMPIOS:~ $ pm2 save
[PM2] Saving current process list...
[PM2] Successfully saved in /home/pi/.pm2/dump.pm2

TomLee

Aber gut zu wissen das es bei dir bei einem aktuellen System auch zu dieser Meldung während der Installation von s2m kommt:

npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
/usr/bin/sonos2mqtt -> /usr/lib/node_modules/sonos2mqtt/lib/index.js


Otto123

Nee - ich sehe auch nicht das Du was falsch gemacht hast - insofern war ich etwas unsicher ob ich bei der Variante pm2 start mit extra Parameter was übersehen / nicht komplett getestet hatte.

BTW: Ich glaube ich hatte noch nie ein npm setup wo nicht irgendwelche WARN Meldungen kamen. Beim ersten mal war ich unruhig, mittlerweile denke ich: das muss so ;)
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

TomLee

ZitatNee - ich sehe auch nicht das Du was falsch gemacht hast

Ich jetzt schon, schau mal wie ich in #756 und #760 starte.




Es erfolgt schon wieder keine Ausgabe der speak-mp3  ::)

Erstellt wird das mp3-File, im Log steht 2020.12.10 17:58:48 3: MQTT2_DEVICE set Sonos_Wohnzimmer speak 20 Hallo
2020.12.10 17:58:48 3: MQTT2_DEVICE set Sonos_Wohnzimmer notify 20 http://192.168.188.26:8083/fhem/cache/71ce4185214eb43202358604a63cdcab.mp3

wenn gerade bspw. Radio spielt wird unterbrochen, es erfolgt keine Sprach-Ausgabe und nach kurzer Zeit wird Radio weiter gespielt.

Es ging doch sowas wie ein Live-Log wie mit journalctl ?

Mit debug starten wars nicht:

node /usr/lib/node_modules/sonos2mqtt/lib/index.js --mqtt mqtt://Thomas:3983@192.168.188.26:1883 --debug




Hab das auch schon länger auf dem Testsystem nicht mehr am laufen, das mit dem playFav ist richtig cool, wer hatte denn dazu die Idee  ;D

Hab jetzt noch nicht nachgeschaut, war das nicht schon soweit das die setList im Player nach einem get Favorites aktualisiert werden sollte ?

Otto123

ein set notify 20 https://cdn.smartersoft-group.com/various/pull-bell-short.mp3 funktioniert?

Du meinst? pm2 list

Das mit den Favoriten steht alles im Wiki :)
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

TomLee

20 https://cdn.smartersoft-group.com/various/pull-bell-short.mp3

ja klappt, jetzt weißt warum die speak-mp3 nicht abgespielt wird ?

pm2 list mein ich nicht, es gab doch zumindest eine Log-Datei, steh gerade auf dem Schlauch, find nix in /usr/lib/node_modules/sonos2mqtt

Otto123

:) ich fische im Trüben
Du kannst http://192.168.188.26:8083/fhem/cache/71ce4185214eb43202358604a63cdcab.mp3 von irgendwo im Browser aufrufen? Bei mir spielt er die Datei einfach ab.
Du hast allowed auf der 8083 ?

Es gibt noch ps2 monit

Es gibt in .pm2 ein log, also bei Dir /home/pi/.pm2
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

TomLee

Ja, klar die MP3s sind abspielbar egal über welchen Weg, ausser s2m.

Du meinst in WEB Port 8083 ? ja hab ich

Wenn ich ein notify speak 20 http://192.168.188.26:8083/opt/fhem/cache/06de3dbc7d0546bba712becac337a12c.mp3 absetze und die App geöffnet ist erscheint dort die Meldung "Wiedergabe von "06de3dbc7d0546bba712becac337a12c.mp3" nicht möglich -Zugriff verweigert.

Wie man sieht hab ich zuvor die Rechte dieser Datei zum Test extra noch angepasst:

pi@FHEMPIOS:/opt/fhem/cache $ ls -l
insgesamt 112
-rwxrwxrwx 1 fhem dialout  4320 Dez 10 22:21 06de3dbc7d0546bba712becac337a12c.mp3
-rw-r--r-- 1 fhem dialout  6720 Dez 10 23:47 397d496dbbdaba27b505fb9dd98ea0bc.mp3
-rw-r--r-- 1 fhem dialout  3072 Dez 10 01:41 4ee34d8b9472a513fc8eed96cb3ab001.mp3
-rw-r--r-- 1 fhem dialout  7584 Dez 10 02:21 61108f934dcaf085356aaaa6653feed8.mp3
-rw-r--r-- 1 fhem dialout  2784 Dez 10 01:39 6e8ac0b77c5f41b956364c4a092c6a13.mp3
-rw-r--r-- 1 fhem dialout  3072 Dez 10 17:58 71ce4185214eb43202358604a63cdcab.mp3
-rw-r--r-- 1 fhem dialout  3360 Dez 10 02:16 71f783ed67e131a66e252ec9b458daaf.mp3
-rw-r--r-- 1 fhem dialout 58464 Dez 11 00:17 abdfb95492825f06de1c0f19e75287c2.mp3
drwxr-xr-x 3 fhem dialout  4096 Dez 10 22:32 alexa-cookie
-rw-r--r-- 1 fhem dialout  4704 Dez 10 14:34 cf540f116c361ca6ce6cbb92578d20a4.mp3

Otto123

Aber mit allowed am Port 8083 müsstest Du das dem Sonos natürlich beibringen - ob das geht? Glaub ich nicht.
Dann mach doch ein separates Web ohne allowed.
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

TomLee

Danke, klappt.

Bin aber der Meinung in Erinnerung zu haben das ich am Testserver WEB auch mit allowed abgesichert hatte, kann mich aber auch täuschen, hätt ichs besser mal aufgeschrieben.

TomLee

Nächste Frage.

Wie löst du/ihr das mit der steigenden Anzahl von Dateien in cache ?

In der Doku zu Text2Speech findet man zu TTS_CacheFileDir

TTS_CacheFileDir
Optional: Die per Google geladenen Sprachbausteine werden in diesem Verzeichnis zur Wiedeverwendung abgelegt. Es findet zurZeit keine automatisierte Löschung statt.


War das automatische löschen mal vorgesehen, kommts noch oder gehts vlt. schon und ich übersehe was ?

Otto123

Ich habe TTS seit Jahren am Laufen, da wird den ganzen Tag geplappert: Temperatur, Mülltonne - ok eingeschränkt in der Vielfalt :)
809 Dateien und 17 MB /opt/fhem/cache

ich weiß nicht nach welchem Schema man da löschen sollte, wenn dann irgendwie einmal im Jahr alles, Zeit, Anzahl, Menge?
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

TomLee

Nochmal dazu

Spielerei aber ich mags so das die Dateiendung optional ist, also auch weggelassen werden kann

Für die Befehlszeile:

{ my $EVTPART2= "bla.mp3";;my $file = "http://".ReadingsVal("SonosTTS","host","")."/fhem/cache/Toene/".$EVTPART2;;my $lf=substr($EVTPART2,length($EVTPART2)-4,4);;$lf eq ".mp3" ? $file : $file.'.mp3';;}


Klappt schon mal so wie ich mir das vorstelle.

Wenn ich im setter dann den Topic und die payload anhänge :

playSoundTest:textField {my $file = "http://".ReadingsVal("SonosTTS","host","")."/fhem/cache/Toene/".$EVTPART2;my $lf=substr($$EVTPART2,length($EVTPART2)-4,4);$lf eq ".mp3" ? $file : $file.'.mp3';'sonos/RINCON_000E58F7F67C01400/control {"command":"notify","input":{"trackUri":"'.$file.'","onlyWhenPlaying":false,"timeout":10,"volume":"'.$EVTPART1.'","delayMs":700}}'}

hab ich das im Log:

2020.12.11 16:24:36 3: MQTT2_DEVICE set Sonos_Wohnzimmer playSoundTest 20 Vibrating
2020.12.11 16:24:36 1: PERL WARNING: Useless use of private variable in void context at (eval 28206) line 1.
2020.12.11 16:24:36 3: eval: my $DEVICETOPIC=   $evalSpecials->{'%DEVICETOPIC'};my $EVENT=   $evalSpecials->{'%EVENT'};my $EVTPART0=   $evalSpecials->{'%EVTPART0'};my $EVTPART1=   $evalSpecials->{'%EVTPART1'};my $EVTPART2=   $evalSpecials->{'%EVTPART2'};my $NAME=   $evalSpecials->{'%NAME'};{my $file = "http://".ReadingsVal("SonosTTS","host","")."/fhem/cache/Toene/".$EVTPART2;my $lf=substr($$EVTPART2,length($EVTPART2)-4,4);$lf eq ".mp3" ? $file : $file.'.mp3';'sonos/RINCON_000E58F7F67C01400/control {"command":"notify","input":{"trackUri":"'.$file.'","onlyWhenPlaying":false,"timeout":10,"volume":"'.$EVTPART1.'","delayMs":700}}'}
2020.12.11 16:24:36 1: PERL WARNING: Useless use of concatenation (.) or string in void context at (eval 28206) line 1.
2020.12.11 16:24:36 3: eval: my $DEVICETOPIC=   $evalSpecials->{'%DEVICETOPIC'};my $EVENT=   $evalSpecials->{'%EVENT'};my $EVTPART0=   $evalSpecials->{'%EVTPART0'};my $EVTPART1=   $evalSpecials->{'%EVTPART1'};my $EVTPART2=   $evalSpecials->{'%EVTPART2'};my $NAME=   $evalSpecials->{'%NAME'};{my $file = "http://".ReadingsVal("SonosTTS","host","")."/fhem/cache/Toene/".$EVTPART2;my $lf=substr($$EVTPART2,length($EVTPART2)-4,4);$lf eq ".mp3" ? $file : $file.'.mp3';'sonos/RINCON_000E58F7F67C01400/control {"command":"notify","input":{"trackUri":"'.$file.'","onlyWhenPlaying":false,"timeout":10,"volume":"'.$EVTPART1.'","delayMs":700}}'}
2020.12.11 16:24:36 1: ERROR evaluating my $DEVICETOPIC=   $evalSpecials->{'%DEVICETOPIC'};my $EVENT=   $evalSpecials->{'%EVENT'};my $EVTPART0=   $evalSpecials->{'%EVTPART0'};my $EVTPART1=   $evalSpecials->{'%EVTPART1'};my $EVTPART2=   $evalSpecials->{'%EVTPART2'};my $NAME=   $evalSpecials->{'%NAME'};{my $file = "http://".ReadingsVal("SonosTTS","host","")."/fhem/cache/Toene/".$EVTPART2;my $lf=substr($$EVTPART2,length($EVTPART2)-4,4);$lf eq ".mp3" ? $file : $file.'.mp3';'sonos/RINCON_000E58F7F67C01400/control {"command":"notify","input":{"trackUri":"'.$file.'","onlyWhenPlaying":false,"timeout":10,"volume":"'.$EVTPART1.'","delayMs":700}}'}: Can't use string ("Vibrating") as a SCALAR ref while "strict refs" in use at (eval 28206) line 1.



Das ist der bisherige funktionierende setter :
playSound:textField {my $file = "http://".ReadingsVal("SonosTTS","host","")."/fhem/cache/Toene/".$EVTPART2.".mp3"; 'sonos/RINCON_000E58F7F67C01400/control {"command":"notify","input":{"trackUri":"'.$file.'","onlyWhenPlaying":false,"timeout":10,"volume":"'.$EVTPART1.'","delayMs":700}}'}

Jemand einen Tipp ?

Otto123

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