Hallo in die Runde,
ich will das Reading Speak von dem Device Speak_Sonos1_md mit SONOSPLAYER Speak ausgeben.
Das Notify reagiert auch auf das Reading, gibt mir dann aber den Text: "Speak Das ist ein Text"
Wo bitte kommt das "Speak" her bzw. wie bekomme ich das weg?
Hier das Notify:
Internals:
CFGFN
DEF Speak_Sonos1_md:Speak:.* { fhem "set Sonos_Kueche Speak 10 de $EVENT"}
FUUID 5e18e598-f33f-a7bb-0709-4ac3e40119b6010b
NAME Speak_Sonos1_ntf
NOTIFYDEV Speak_Sonos1_md
NR 63
NTFY_ORDER 50-Speeak_Sonoff1_ntf
REGEXP Speak_Sonos1_md:Speak:.*
STATE 2020-01-10 22:31:48
TRIGGERTIME 1578695508.15484
TYPE notify
READINGS:
2020-01-10 22:23:07 state active
Attributes:
room Logik
Ein "Speak_Sonos1_md:Speak:.* set Sonos_Kueche Speak 10 de $EVENT" liefert das gleiche Ergebnis.
Und hier das MQTT Device:
Internals:
CFGFN
FUUID 5e18d93e-f33f-a7bb-f8bc-dad6fb27c358a583
IODev mosquitto
NAME Speak_Sonos1_md
NR 36
STATE Das ist ein Test
TYPE MQTT_DEVICE
READINGS:
2020-01-10 22:31:48 Speak Das ist ein Test
2020-01-10 22:31:48 transmission-state incoming publish received
message_ids:
sets:
subscribe:
/Home/lmgmt2/speak/sonos1
/Home/lmgmt2/speak/sonos1/
subscribeExpr:
^\/Home\/lmgmt2\/speak\/sonos1$
^\/Home\/lmgmt2\/speak\/sonos1\/$
subscribeQos:
/Home/lmgmt2/speak/sonos1 0
/Home/lmgmt2/speak/sonos1/ 0
subscribeReadings:
/Home/lmgmt2/speak/sonos1:
cmd
name Speak
/Home/lmgmt2/speak/sonos1/:
cmd
name Speak
Attributes:
IODev mosquitto
alias Sonos1 Küche
room Mqtt
stateFormat Speak
subscribeReading_Speak /Home/lmgmt2/speak/sonos1/
Und so sieht das beim SONSOPLAYER aus:
2020-01-10 22:31:49 SONOSPLAYER Sonos_Kueche currentTitle: Speak: Das ist ein Test
2020-01-10 22:31:49 SONOSPLAYER Sonos_Kueche currentArtist: FHEM ~ Sonos
2020-01-10 22:31:49 SONOSPLAYER Sonos_Kueche currentAlbum: Sprachdurchsagen
2020-01-10 22:31:49 SONOSPLAYER Sonos_Kueche currentAlbumArtist: FHEM ~ Sonos
2020-01-10 22:31:49 SONOSPLAYER Sonos_Kueche currentAlbumArtURL: http://192.168.50.43:1400/getaa?u=x-file-cifs%3a%2f%2flmgmt2.li.local%2fSonosSpeak%2fRINCON_48A6B886CB0601400_MR_Speak_20200110-223148.mp3&v=0
2020-01-10 22:31:49 SONOSPLAYER Sonos_Kueche infoSummarize1: (FHEM ~ Sonos) 'Speak: Das ist ein Test' vom Album 'Sprachdurchsagen'
Grüße aus Leipzig
Hallo,
nimm mal den Doppelpunkt nach dem Readingnamen raus
ZitatSpeak_Sonos1_md:Speak:.*
Gruß
Thomas
Das hatte ich auch schon probiert, gleiches Problem:
Internals:
CFGFN
DEF Speak_Sonos1_md:Speak.* { fhem "set Sonos_Kueche Speak 10 de $EVENT"}
FUUID 5e18e598-f33f-a7bb-0709-4ac3e40119b6010b
NAME Speak_Sonos1_ntf
NOTIFYDEV Speak_Sonos1_md
NR 63
NTFY_ORDER 50-Speeak_Sonoff1_ntf
REGEXP Speak_Sonos1_md:Speak.*
STATE 2020-01-11 00:09:30
TRIGGERTIME 1578701370.82731
TYPE notify
READINGS:
2020-01-10 23:07:37 state active
Attributes:
room Logik
Und hier das Log mit dem MQTT_Device
2020-01-11 00:08:30 MQTT_DEVICE Speak_Sonos1_md transmission-state: incoming publish received
2020-01-11 00:08:30 MQTT_DEVICE Speak_Sonos1_md Speak: Hallo Ballo
2020-01-11 00:08:30 SONOSPLAYER Sonos_Kueche LastActionResult: PlayURITemp: Success!
2020-01-11 00:08:30 SONOS Sonos LastProcessAnswer: 1578701310
2020-01-11 00:08:30 SONOS Sonos LastProcessAnswer: 1578701310
2020-01-11 00:08:30 SONOSPLAYER Sonos_Kueche numberOfTracks: 1
2020-01-11 00:08:30 SONOSPLAYER Sonos_Kueche currentTrack: 1
2020-01-11 00:08:30 SONOSPLAYER Sonos_Kueche currentTrackURI: //lmgmt2.li.local/SonosSpeak/RINCON_48A6B886CB0601400_MR_Speak_20200111-000830.mp3
2020-01-11 00:08:30 SONOSPLAYER Sonos_Kueche currentTrackHandle: //lmgmt2.li.local/SonosSpeak/RINCON_48A6B886CB0601400_MR_Speak_20200111-000830.mp3|<DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:r="urn:schemas-rinconnetworks-com:metadata-1-0/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"><item id="-1" parentID="-1" restricted="true"><res protocolInfo="x-file-cifs:*:audio/mpeg:*" duration="0:00:01">x-file-cifs://lmgmt2.li.local/SonosSpeak/RINCON_48A6B886CB0601400_MR_Speak_20200111-000830.mp3</res><r:streamContent></r:streamContent><r:radioShowMd></r:radioShowMd><upnp:albumArtURI>/getaa?u=x-file-cifs%3a%2f%2flmgmt2.li.local%2fSonosSpeak%2fRINCON_48A6B886CB0601400_MR_Speak_20200111-000830.mp3&v=0</upnp:albumArtURI><dc:title>Speak: Hallo Ballo</dc:title><upnp:class>object.item.audioItem.musicTrack</upnp:class><dc:creator>FHEM ~ Sonos</dc:creator><upnp:album>Sprachdurchsagen</upnp:album><r:albumArtist>FHEM ~ Sonos</r:albumArtist></item></DIDL-Lite>
2020-01-11 00:08:30 SONOSPLAYER Sonos_Kueche currentEnqueuedTransportURI: x-file-cifs://lmgmt2.li.local/SonosSpeak/RINCON_48A6B886CB0601400_MR_Speak_20200111-000830.mp3
2020-01-11 00:08:30 SONOSPLAYER Sonos_Kueche currentEnqueuedTransportHandle: x-file-cifs://lmgmt2.li.local/SonosSpeak/RINCON_48A6B886CB0601400_MR_Speak_20200111-000830.mp3|<DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:r="urn:schemas-rinconnetworks-com:metadata-1-0/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"><item id="" parentID="" restricted="true"><dc:title></dc:title><upnp:class>object.item.audioItem.musicTrack</upnp:class><desc id="cdudn" nameSpace="urn:schemas-rinconnetworks-com:metadata-1-0/">RINCON_AssociatedZPUDN</desc></item></DIDL-Lite>
2020-01-11 00:08:30 SONOSPLAYER Sonos_Kueche currentTrackDuration: 0:00:01
2020-01-11 00:08:30 SONOSPLAYER Sonos_Kueche currentTrackDurationSec: 1
2020-01-11 00:08:30 SONOSPLAYER Sonos_Kueche currentTrackPosition: 0:00:00
2020-01-11 00:08:30 SONOSPLAYER Sonos_Kueche currentTrackPositionSec: 0
2020-01-11 00:08:30 SONOSPLAYER Sonos_Kueche currentTrackProvider: Bibliothek
2020-01-11 00:08:30 SONOSPLAYER Sonos_Kueche currentTrackProviderIconQuadraticURL: /fhem/sonos/cover/bibliothek_quadratic.jpg
2020-01-11 00:08:30 SONOSPLAYER Sonos_Kueche currentTrackProviderIconRoundURL: /fhem/sonos/cover/bibliothek_round.png
2020-01-11 00:08:30 SONOSPLAYER Sonos_Kueche currentTitle: Speak: Hallo Ballo
2020-01-11 00:08:30 SONOSPLAYER Sonos_Kueche currentArtist: FHEM ~ Sonos
2020-01-11 00:08:30 SONOSPLAYER Sonos_Kueche currentAlbum: Sprachdurchsagen
2020-01-11 00:08:30 SONOSPLAYER Sonos_Kueche currentAlbumArtist: FHEM ~ Sonos
2020-01-11 00:08:30 SONOSPLAYER Sonos_Kueche currentAlbumArtURL: http://192.168.50.43:1400/getaa?u=x-file-cifs%3a%2f%2flmgmt2.li.local%2fSonosSpeak%2fRINCON_48A6B886CB0601400_MR_Speak_20200111-000830.mp3&v=0
2020-01-11 00:08:30 SONOSPLAYER Sonos_Kueche infoSummarize1: (FHEM ~ Sonos) 'Speak: Hallo Ballo' vom Album 'Sprachdurchsagen'
2020-01-11 00:08:30 SONOSPLAYER Sonos_Kueche infoSummarize2: STOPPED => (FHEM ~ Sonos) 'Speak: Hallo Ballo' vom Album 'Sprachdurchsagen'
Sry,
so sollte es klappen:
ZitatSpeak_Sonos1_md:Speak:..*
Nimm ReadingsVal(), der Readingname ist im $EVENT drin....
@TomLee: der weitere Punkt ist hier unnötig.
Wunderwelt der Klammern!
Mit eckigen Klammern klappts:
defmod Speak_Sonos1_ntf notify Speak_Sonos1_md:Speak:.* set Sonos_Kueche Speak 10 de [Speak_Sonos1_md:Speak]
Danke für die Hinweise.
Deine erste Lösung war schon im. Statt $EVENT welches in der Tat den gesamten Event beinhaltet hättest Du $EVTPART1 nehmen müssen.
@CoolTux:
$EVTPART1 = "Hallo" (ohne "Ballo")...
Genau. EVENTPART1 hatte ich auch schon probiert. Dann kommt halt nur das erste Wort. Aber nun ist alles Schick.
Mist stimmt ja. Es wird ja alles " " getrennt.
Dann muss man $EVENT selbst verarbeiten mit split()
Aber schon das es nun geht.
Wo ist das denn beschrieben mit den eckigen Klammern, in der commandref (die Deutsche unter dem Gerät, in die englische hab ich nicht geschaut) nicht und im Wiki (dort fänd ich dieses Beispiel super) auch nicht .
Habt ihr zwei das gewusst ? ihr habt doch auch erstmal die zwei üblichen (im Vergleich umständlicheren) Wege gennannt.
Gruß
Thomas
Das nennt sich Set Magic. Wo genau das in der Commandref steht weiß ich gerade nicht. Vielleicht Perl Spezial oder so