Sonos2mqtt - vielleicht hat jemand Lust mitzumachen

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

Vorheriges Thema - Nächstes Thema

Beta-User

Wegen "stummschalten": Rudi hat heute was nettes gepostet, um News von Geplapper zu trennen... (In dem true-Thread).
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

Otto123

Ich habs schon gelesen - aber nicht verstanden ;)
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

Otto123

#17
Mein Ergebnis vom Abend, ein bisschen Code für die Raw Def - als Einzeiler wäre es für die Kommandozeile etwas lang ;)
Lacht nicht, mir fiel nichts besseres ein. :)
Der Code erzeugt aus dem Device was sonos2mqtt anlegt (und in der ersten Zeile zunächst manuell eingegeben wird) alle Sonosplayer als MQTT Devices mit dem wichtigsten readingList und der setList.
{my $bridge='MQTT2_mqttjs_5d4378c3';;\
my @array=split("\n", AttrVal($bridge,'readingList',''));;\
my $server=AttrVal($bridge,'IODev','mqttserver');;\
foreach (@array) {\
   if ($_=~"sonos/RINCON_") {\
       my @line=split("/",$_);;\
   my $dev=(split(':',$line[1]))[0];;\
   fhem("define $dev MQTT2_DEVICE");;\
   fhem("attr $dev IODev $server");;\
   fhem("attr $dev readingList $_");;\
   fhem("attr $dev room SonosMQTT");;\
       fhem("attr $dev setList stop:noArg sonos/$dev/control { \"command\": \"stop\"}\
play:noArg sonos/$dev/control { \"command\": \"play\"}\
Volume:slider,0,1,100 sonos/$dev/control { \"command\": \"volume\",  \"input\": \$EVTPART1}");;\
  }\
}\
}


Die folgenden beiden Topics sind ziemlich statisch und werden eventuell nur einmalig beim Start von sonos2mqtt befüllt.
sonos/status/Playername/renderingcontrol
homeassistant/music_player/RINCON_PayerID/sonos/config


Man könnte jetzt wenn das Gerät fertig ist:

  • den namen auslesen und noch den Topic sonos/status/Playername/avtransport hinzufügen und
  • das Gerät umbenennen?

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

Beta-User

Zitat von: Otto123 am 01 Juni 2020, 18:59:38
Ich habs schon gelesen - aber nicht verstanden ;)
Das bewirkt in der einen Zeile dasselbe wie eventMap, event-on-change-reading .* und timestamp-on-change-reading .* zusammen. Man kann damit also (ohne das eventMap) einfach nur die Infos durchlassen, die unbekannt oder neu sind... Könnte helfen, das "Geplapper" von Sonos beim Eingang der Infos gleich soweit zu filtern, dass man nichts mehr an verbose rumschrauben muß (was ja auch nur den logging-Teil stummschaltet).

Im Gegenzug habe ich deinen Code nicht recht verstanden. Was hat der für Vorteile gg. einem attrTemplate-Setzen für jeden Player? (Außer, dass man es tun muß)?

Was ich meine verstanden zu haben: Der Autor des Java-Codes glaubt, es sei eine gute Idee, die Daten, die zu einem Endgerät gehören, sollten auf zwei oder drei (?) Topic-Pfade verteilt werden, bei dem einmal der "Klarname" verwendet wird, und an anderer Stelle ein "Technikname". Wir stehen also vor dem Problem feststellen zu müssen, was zu wem gehört...?
(MMn: Das ist keine optimale Entscheidung, und Umlaute im Topic-Pfad zu verwenden ist es auch nicht)

Wenn man also nicht das --discovery auf false setzen will, sollte man die Meldungen "as is" konservieren. Könnte (in dem Bridge-Gerät) so funktionieren:
attr DEVICE readingList\
  homeassistant/music_player/RINCON_([0-9A-Z]+):.* { $TOPIC =~ m,(RINCON_[0-9A-Z]+),; "config_$1") }
  sonos/connected:.* connected
(Generell wäre da ggf. mal der MQTT-"roh"-Verkehr beim Start des Dienstes interessant).

Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

87insane

#19
Zitat(MMn: Das ist keine optimale Entscheidung, und Umlaute im Topic-Pfad zu verwenden ist es auch nicht)
Stellt keine Probleme im 21. Jahrhundert da. Kann man bedenkenlos machen. Ich finde es auch nicht schön aber die Playernamen habe ich nicht ausgesucht. Es MUSS ein "ü" in Küche sein sonst bin ich mein SmartHome Amt los :-P

Ihr habt gestern ja noch richtig was geschafft. Ich hatte leider keine Zeit mehr. Wenn ich mir das so ansehe, sehe ich das Problem mit dem Technik und dem Gerätenamen als das nervigste. Soll ich den Kollegen mal anschreiben? (Programmierer des Moduls)

Was den Code des Devices angeht, würde ich das schonmal einfach umbauen in Richtung Template. Gucken ob ich das heute schaffe.

Anbei auch mal was beim start/stop so in FHEM passiert auf der Bridge:
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge connected: 2
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_13: seek
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_17: speak
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge availability_topic: sonos/connected
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_15: setavtransporturi
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_10: playmode
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_5: mute
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge json_attributes_topic: sonos/RINCON_7828CAF4289001400
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_19: switchtoline
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_26: volumeup
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_25: volumedown
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_16: sleep
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge device_manufacturer: Sonos
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge device_identifiers_1: RINCON_7828CAF4289001400
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_18: stop
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_4: leavegroup
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge name: Küche
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_9: play
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge payload_available: 2
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_12: queue
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_8: pause
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_22: toggle
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge icon: mdi:speaker
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_7: notify
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_21: switchtotv
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_24: volume
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge device_name: Küche
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_23: unmute
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge unique_id: sonos2mqtt_RINCON_7828CAF4289001400_speaker
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge json_attributes: true
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge state_topic: sonos/RINCON_7828CAF4289001400
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge command_topic: sonos/RINCON_7828CAF4289001400/control
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_3: joingroup
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_1: adv-command
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge device_class: speaker
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_2: command
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_6: next
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_14: selecttrack
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_20: switchtoqueue
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_11: previous
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_8: pause
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_22: toggle
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge payload_available: 2
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_12: queue
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge name: Badezimmer
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_9: play
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_4: leavegroup
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_24: volume
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_7: notify
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_21: switchtotv
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge icon: mdi:speaker
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge state_topic: sonos/RINCON_5CAAFD79D52801400
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge command_topic: sonos/RINCON_5CAAFD79D52801400/control
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge json_attributes: true
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge device_name: Badezimmer
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_23: unmute
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge unique_id: sonos2mqtt_RINCON_5CAAFD79D52801400_speaker
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_11: previous
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_6: next
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_2: command
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_14: selecttrack
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_20: switchtoqueue
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge device_class: speaker
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_3: joingroup
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_1: adv-command
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_17: speak
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_13: seek
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_5: mute
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_10: playmode
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge availability_topic: sonos/connected
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_15: setavtransporturi
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge device_manufacturer: Sonos
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_19: switchtoline
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_26: volumeup
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_25: volumedown
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_16: sleep
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge json_attributes_topic: sonos/RINCON_5CAAFD79D52801400
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge device_identifiers_1: RINCON_5CAAFD79D52801400
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_18: stop
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentTrackMetaData_UpnpClass: object.item
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge EnqueuedTransportURI: x-sonosapi-stream:s306651?sid=254&flags=8224&sn=0
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentTrackMetaData_ParentId: -1
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge SleepTimerGeneration: 0
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge AlarmRunning: false
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentPlayMode: NORMAL
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge SnoozeRunning: false
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge AVTransportURI: x-sonosapi-stream:s306651?sid=254&flags=8224&sn=0
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge NumberOfTracks: 1
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge PossibleRecordStorageMedia: NOT_IMPLEMENTED
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentTransportActions: Set, Stop, Play
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge RecordStorageMedium: NOT_IMPLEMENTED
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentTrackMetaData_Title: DJ Mag Germany Radio by iloveradio.de
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge AVTransportURIMetaData_Title: DJ Mag Germany Radio by iloveradio.de
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentTrackMetaData_ProtocolInfo: sonos.com-http:*:application/octet-stream:*
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentTrackMetaData_AlbumArtUri: http://192.168.20.71:1400/getaa?s=1&u=x-sonosapi-stream:s306651%3fsid%3d254%26flags%3d8224%26sn%3d0
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge PlaybackStorageMedium: NETWORK
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge AVTransportURIMetaData_ItemId: -1
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentRecordQualityMode: NOT_IMPLEMENTED
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge RestartPending: false
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge EnqueuedTransportURIMetaData_UpnpClass: object.item.audioItem.audioBroadcast
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge TransportStatus: OK
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentTrack: 1
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge EnqueuedTransportURIMetaData_ItemId: -1
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentTrackURI: x-sonosapi-stream:s306651?sid=254&flags=8224&sn=0
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge EnqueuedTransportURIMetaData_Title: DJ Mag Germany Radio by iloveradio.de
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentSection: 0
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentTrackDuration: 0:00:00
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge EnqueuedTransportURIMetaData_ParentId: -1
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentMediaDuration: NOT_IMPLEMENTED
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge AVTransportURIMetaData_ParentId: -1
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge TransportState: STOPPED
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge AVTransportURIMetaData_UpnpClass: object.item.audioItem.audioBroadcast
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentCrossfadeMode: false
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge PossiblePlaybackStorageMedia: NONE, NETWORK
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge PossibleRecordQualityModes: NOT_IMPLEMENTED
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge TransportPlaySpeed: NOT_IMPLEMENTED
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge RecordMediumWriteStatus: NOT_IMPLEMENTED
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentTrackMetaData_TrackUri: x-sonosapi-stream:s306651?sid=254&flags=8224&sn=0
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge DirectControlIsSuspended: false
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentTrackMetaData_ItemId: -1
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentTrackMetaData_UpnpClass: object.item
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentTrackMetaData_ParentId: -1
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge SleepTimerGeneration: 0
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge AlarmRunning: false
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentPlayMode: NORMAL
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge SnoozeRunning: false
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge NumberOfTracks: 1
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge AVTransportURIMetaData_ProtocolInfo: x-sonos-vli:*:audio:*
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge AVTransportURI: x-rincon-queue:RINCON_5CAAFD79D52801400#vli
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge PossibleRecordStorageMedia: NOT_IMPLEMENTED
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentTransportActions: Set, Stop, Play
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge RecordStorageMedium: NOT_IMPLEMENTED
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentTrackMetaData_Title:
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge AVTransportURIMetaData_Title: Spotify
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentTrackMetaData_ProtocolInfo: :*:application/octet-stream:*
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge PlaybackStorageMedium: NETWORK
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge AVTransportURIMetaData_ItemId: spotify
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge TransportStatus: OK
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge RestartPending: false
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentRecordQualityMode: NOT_IMPLEMENTED
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentTrack: 1
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentTrackURI: x-sonos-vli:RINCON_5CAAFD79D52801400:2,spotify:87aecd8b75b2c1e626eecedb93db3e67
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentSection: 0
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge AVTransportURIMetaData_TrackUri: x-sonos-vli:RINCON_5CAAFD79D52801400:2,spotify:87aecd8b75b2c1e626eecedb93db3e67
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge DirectControlClientID: spotify.connect.adapter
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentMediaDuration: NOT_IMPLEMENTED
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge AVTransportURIMetaData_ParentId: 0
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge TransportState: PAUSED_PLAYBACK
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge AVTransportURIMetaData_UpnpClass: object.item.audioItem.linein
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge PossiblePlaybackStorageMedia: NONE, NETWORK
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentCrossfadeMode: false
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge PossibleRecordQualityModes: NOT_IMPLEMENTED
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge RecordMediumWriteStatus: NOT_IMPLEMENTED
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge TransportPlaySpeed: NOT_IMPLEMENTED
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentTrackMetaData_TrackUri: x-rincon-queue:RINCON_5CAAFD79D52801400#vli
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentTrackMetaData_ItemId: -1
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge DirectControlIsSuspended: true
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge Mute_RF: false
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge Bass: 0
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge Mute_Master: false
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge Treble: 0
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge Loudness: true
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge SubEnabled: true
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge PresetNameList: FactoryDefaults
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge Volume_Master: 49
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge SubCrossover: 0
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge HeadphoneConnected: false
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge SubPolarity: 0
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge SubGain: 0
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge Volume_LF: 100
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge OutputFixed: false
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge SpeakerSize: 5
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge Mute_LF: false
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge Volume_RF: 100
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge SleepTimerGeneration: 0
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge AlarmRunning: false
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentPlayMode: SHUFFLE_NOREPEAT
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge NextTrackMetaData_Album: Zombie (Zombic & Felix Schorn Remix)
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge SnoozeRunning: false
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge AVTransportURI: x-rincon-queue:RINCON_7828CAF427B201400#0
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge NumberOfTracks: 50
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge PossibleRecordStorageMedia: NOT_IMPLEMENTED
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentTrackMetaData_UpnpClass: object.item.audioItem.musicTrack
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge EnqueuedTransportURI: x-rincon-cpcontainer:0006002cspotify%3aplaylist%3a37i9dQZF1DX7ZUug1ANKRP?sid=9&flags=44&sn=3
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentTrackMetaData_Artist: F4ST
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentTrackMetaData_ParentId: -1
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge NextTrackMetaData_AlbumArtUri: http://192.168.20.70:1400/getaa?s=1&u=x-sonos-spotify:spotify:track:3p07oZZpSNdVtN93M5yIY5%3fsid%3d9%26flags%3d8224%26sn%3d3
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge NextTrackMetaData_TrackUri: x-sonos-spotify:spotify:track:3p07oZZpSNdVtN93M5yIY5?sid=9&flags=8224&sn=3
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentTrackMetaData_ProtocolInfo: sonos.com-spotify:*:audio/x-spotify:*
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentTrackMetaData_AlbumArtUri: http://192.168.20.70:1400/getaa?s=1&u=x-sonos-spotify:spotify:track:7tNAeLkrsnOqKXWTmd8cQp%3fsid%3d9%26flags%3d8224%26sn%3d3
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge NextTrackMetaData_Duration: 0:02:40
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge NextTrackMetaData_ProtocolInfo: sonos.com-spotify:*:audio/x-spotify:*
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge PlaybackStorageMedium: NETWORK
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentTransportActions: Set, Stop, Pause, Play, X_DLNA_SeekTime, Next, X_DLNA_SeekTrackNr
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge RecordStorageMedium: NOT_IMPLEMENTED
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentTrackMetaData_Title: Sweet Dreams
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge RestartPending: false
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentRecordQualityMode: NOT_IMPLEMENTED
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge EnqueuedTransportURIMetaData_UpnpClass: object.container.playlistContainer#playlistItem
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge TransportStatus: OK
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge NextTrackMetaData_UpnpClass: object.item.audioItem.musicTrack
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentTrack: 1
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge EnqueuedTransportURIMetaData_ItemId: 0006002cspotify%3aplaylist%3a37i9dQZF1DX7ZUug1ANKRP
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge EnqueuedTransportURIMetaData_Artist: Spotify
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge NextTrackMetaData_Title: Zombie (Zombic & Felix Schorn Remix)
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentTrackMetaData_Duration: 0:02:08
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentTrackURI: x-sonos-spotify:spotify%3atrack%3a7tNAeLkrsnOqKXWTmd8cQp?sid=9&flags=8224&sn=3
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge EnqueuedTransportURIMetaData_Title: Main Stage
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentValidPlayModes: SHUFFLE,REPEAT,REPEATONE,CROSSFADE
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge NextTrackMetaData_Artist: Besomorph
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge TransportState: STOPPED
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge PossiblePlaybackStorageMedia: NONE, NETWORK
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentCrossfadeMode: false
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge TransportPlaySpeed: NOT_IMPLEMENTED
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge PossibleRecordQualityModes: NOT_IMPLEMENTED
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge RecordMediumWriteStatus: NOT_IMPLEMENTED
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentTrackMetaData_Album: Sweet Dreams
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentTrackMetaData_TrackUri: x-sonos-spotify:spotify:track:7tNAeLkrsnOqKXWTmd8cQp?sid=9&flags=8224&sn=3
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentTrackMetaData_ItemId: -1
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge DirectControlIsSuspended: false
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge NextTrackURI: x-sonos-spotify:spotify%3atrack%3a3p07oZZpSNdVtN93M5yIY5?sid=9&flags=8224&sn=3
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentSection: 0
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge EnqueuedTransportURIMetaData_AlbumArtUri: https://i.scdn.co/image/ab67706f00000002aa995282d5635f79a4384b4c
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge EnqueuedTransportURIMetaData_ParentId: spotify%3aview%3ayour-heavy-rotation%5b0%5d
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge NextTrackMetaData_ItemId: -1
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentTrackDuration: 0:02:08
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge NextTrackMetaData_ParentId: -1
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge CurrentMediaDuration: NOT_IMPLEMENTED
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge Treble: 0
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge SubEnabled: true
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge Loudness: true
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge Bass: 0
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge Mute_RF: false
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge Mute_Master: false
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge SubCrossover: 0
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge PresetNameList: FactoryDefaults
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge Volume_Master: 9
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge HeadphoneConnected: false
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge SubPolarity: 0
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge SubGain: 0
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge Volume_RF: 100
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge Mute_LF: false
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge Volume_LF: 100
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge OutputFixed: false
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge SpeakerSize: 5
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge currentTrack_UpnpClass: object.item
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge groupName: Küche
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge playmode: NORMAL
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge name: Küche
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge mute_RF: false
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge currentTrack_ItemId: -1
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge mute_Master: false
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge currentTrack_Title: DJ Mag Germany Radio by iloveradio.de
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge enqueuedMetadata_Title: DJ Mag Germany Radio by iloveradio.de
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge enqueuedMetadata_ItemId: -1
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge enqueuedMetadata_UpnpClass: object.item.audioItem.audioBroadcast
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge transportState: STOPPED
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge uuid: RINCON_7828CAF4289001400
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge mute_LF: false
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge volume_RF: 100
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge currentTrack_ParentId: -1
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge volume_LF: 100
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge volume_Master: 49
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge ts: 1591087299159
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge currentTrack_TrackUri: x-sonosapi-stream:s306651?sid=254&flags=8224&sn=0
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge coordinatorUuid: RINCON_7828CAF4289001400
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge enqueuedMetadata_ParentId: -1
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge currentTrack_ProtocolInfo: sonos.com-http:*:application/octet-stream:*
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge currentTrack_AlbumArtUri: http://192.168.20.71:1400/getaa?s=1&u=x-sonosapi-stream:s306651%3fsid%3d254%26flags%3d8224%26sn%3d0
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge ts: 1591087299186
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge currentTrack_TrackUri: x-rincon-queue:RINCON_5CAAFD79D52801400#vli
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge volume_Master: 9
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge volume_LF: 100
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge currentTrack_ParentId: -1
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge coordinatorUuid: RINCON_5CAAFD79D52801400
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge currentTrack_ProtocolInfo: :*:application/octet-stream:*
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge currentTrack_ItemId: -1
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge mute_RF: false
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge name: Badezimmer
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge playmode: NORMAL
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge groupName: Badezimmer
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge currentTrack_UpnpClass: object.item
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge currentTrack_Title:
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge mute_Master: false
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge mute_LF: false
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge uuid: RINCON_5CAAFD79D52801400
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge transportState: PAUSED_PLAYBACK
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge volume_RF: 100
2020-06-02 10:41:59 MQTT2_DEVICE MQTT_sonos_bridge connected: 1
2020-06-02 10:41:59 MQTT2_DEVICE MQTT_sonos_bridge connected: 0


Kannst du mir das noch ein wenig übersetzen?
ZitatWenn man also nicht das --discovery auf false setzen will, sollte man die Meldungen "as is" konservieren. Könnte (in dem Bridge-Gerät) so funktionieren:
Code: [Auswählen]
attr DEVICE readingList\
  homeassistant/music_player/RINCON_([0-9A-Z]+):.* { $TOPIC =~ m,(RINCON_[0-9A-Z]+),; "config_$1") }
  sonos/connected:.* connected

homeassistant/music_player/RINCON_5CAAFD79D52801400/sonos/config:.* { json2nameValue($EVENT) }
sonos/status/wohnzimmer/renderingcontrol:.* { json2nameValue($EVENT) }
sonos/status/wohnzimmer/avtransport:.* { json2nameValue($EVENT) }
sonos/RINCON_7828CAF427B201400:.* { json2nameValue($EVENT) }

Das wären ja alle Readings pro Gerät. Ich habe noch nicht ganz mit bekommen welche ihr nun für die interessanten haltet...

hoppel118

Zitat von: 87insane am 02 Juni 2020, 10:33:13
Es MUSS ein "ü" in Küche sein sonst bin ich mein SmartHome Amt los :-P

Beim Define eines Devices soll dies nicht sein. Dafür gibt es alias, siriName, alexaName, etc.

Mein Küchenplayer wurde vom Sonos Modul auch automatisch als ,,Sonos_Kueche" definiert und alias ,,Küche".

Gruß Hoppel
Server: Openmediavault, XEON E3-1240L-v5, Supermicro X11SSH-CTF, 64GB ECC RAM, SSD, RAID-Z2
Homebridge | Alexa | Yowsup
Homematic | HomeConnect | MQTT | Philips Hue | Sonos | Unifi Network & Protect | vbus | Xiaomi

87insane

Zitat von: hoppel118 am 02 Juni 2020, 10:48:12
Beim Define eines Devices soll dies nicht sein. Dafür gibt es alias, siriName, alexaName, etc.

Mein Küchenplayer wurde vom Sonos Modul auch automatisch als ,,Sonos_Kueche" definiert und alias ,,Küche".

Gruß Hoppel
Damit alle beruhigt sind... MQTT TOPIC Pfad ist was anderes als ein Geräte Name... Mein Sonos hat in echt den Fhem-Namen k_sonos. Ich hoffe nun können alle wieder beruhigt die Sonne genießen :-P

Beta-User

Dass man Umlaute verwendet, ist an sich ok. FHEM kommt damit aber als Name leider derzeit nicht klar, und es passieren leider auch manchmal beim Konvertieren zwischen verschiedenen Namensräumen komische Sachen.

Aber wieso "sprechende Namen" Teil des Topic-Trees sein sollen, verstehe ich schlicht nicht (das gilt für zigbee2mqtt ganz genauso). Technische Namen sind unveränderlich, also sollte man die nehmen, alles andere kann man woanders regeln (alias, z.B.). Nur eben scheinbar bei homeasistant nicht :P . Kannst das ja gerne weitergeben, aber ich glaube nicht, dass ein homeassistant-"gepolter" (englischsprachiger) Coder das nachvollziehen kann...
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

87insane

Zitat von: Beta-User am 02 Juni 2020, 11:04:10
Dass man Umlaute verwendet, ist an sich ok. FHEM kommt damit aber als Name leider derzeit nicht klar, und es passieren leider auch manchmal beim Konvertieren zwischen verschiedenen Namensräumen komische Sachen.

Aber wieso "sprechende Namen" Teil des Topic-Trees sein sollen, verstehe ich schlicht nicht (das gilt für zigbee2mqtt ganz genauso). Technische Namen sind unveränderlich, also sollte man die nehmen, alles andere kann man woanders regeln (alias, z.B.). Nur eben scheinbar bei homeasistant nicht :P . Kannst das ja gerne weitergeben, aber ich glaube nicht, dass ein homeassistant-"gepolter" (englischsprachiger) Coder das nachvollziehen kann...

Mal schauen.. hatte mal wegen was anderem Berührung mit denen und die waren ganz gut drauf :)
Die könnten ja eine Option oder mit einbauen um den Dienst in einem anderen Mode zu starten und dann hätten wir alles :)

Hast du meinen Beitrag weiter oben übersehen? Da hatte ich mal wieder viele Fragen an Dich :)

Beta-User

Zitat von: 87insane am 02 Juni 2020, 10:33:13
Anbei auch mal was beim start/stop so in FHEM passiert auf der Bridge:
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge connected: 2
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_13: seek
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_17: speak
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge availability_topic: sonos/connected
2020-06-02 10:41:41 MQTT2_DEVICE MQTT_sonos_bridge available_commands_15: setavtransporturi
[...]
Diese Events sind vorbearbeitet und nicht das, was mir vorschwebte - die JSON-Strukturen zu sehen. Das ginge z.B. mit raw-Events am Server, (mosquitto_sub&Co) oder eben mit "passenden" Reading-List-Einträgen
Zitat
Kannst du mir das noch ein wenig übersetzen?
homeassistant/music_player/RINCON_([0-9A-Z]+):.* { $TOPIC =~ m,(RINCON_[0-9A-Z]+),; "config_$1") }Das sollte bei der Bridge für jeden Player ein "Klartext-Reading" erzeugen, in dem dann der "autodiscovery-JSON" steht. Der erzeugt sonst irgendwelche Pseudo-Readings...
Zitathomeassistant/music_player/RINCON_5CAAFD79D52801400/sonos/config:.* { json2nameValue($EVENT) }
sonos/status/wohnzimmer/renderingcontrol:.* { json2nameValue($EVENT) }
sonos/status/wohnzimmer/avtransport:.* { json2nameValue($EVENT) }
sonos/RINCON_7828CAF427B201400:.* { json2nameValue($EVENT) }

Das wären ja alle Readings pro Gerät. Ich habe noch nicht ganz mit bekommen welche ihr nun für die interessanten haltet...
Nochmal: Das sind wegen diesem autodiscovery-Mist zu viele Readings...
Will man das auf Ebene des Einzelgeräts "filtern"/den "RAW-JSON", müßte das so in der rL klappen:
homeassistant/music_player/RINCON_5CAAFD79D52801400/sonos/config:.* HA_config
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

87insane

Also ich würde dir die RAWs ja gerne liefern aber bin dazu wohl nicht im Stande. Das sonos2mqtt Gerät hat kein rawEvents-Attribut.... wie könnte ich das noch erledigen?

homeassistant/music_player/RINCON_([0-9A-Z]+):.* { $TOPIC =~ m,(RINCON_[0-9A-Z]+),; "config_$1" }
erzeugt bei mir nichts... Du hattest auch ein ")"drin, was weg musste.... (homeassistant/music_player/RINCON_([0-9A-Z]+):.* { $TOPIC =~ m,(RINCON_[0-9A-Z]+),; "config_$1") })

homeassistant/music_player/RINCON_7828CAF4289001400/sonos/config:.* HA_config
erzeugt bei mir wie gewünscht HA_config mit folgendem Inhalt:
{"available_commands":["adv-command","command","joingroup","leavegroup","mute","next","notify","pause","play","playmode","previous","queue","seek","selecttrack","setavtransporturi","sleep","speak","stop","switchtoline","switchtoqueue","switchtotv","toggle","unmute","volume","volumedown","volumeup"],"command_topic":"sonos/RINCON_7828CAF4289001400/control","device":{"identifiers":["RINCON_7828CAF4289001400"],"manufacturer":"Sonos","name":"Küche"},"device_class":"speaker","icon":"mdi:speaker","json_attributes":true,"json_attributes_topic":"sonos/RINCON_7828CAF4289001400","name":"Küche","state_topic":"sonos/RINCON_7828CAF4289001400","unique_id":"sonos2mqtt_RINCON_7828CAF4289001400_speaker","availability_topic":"sonos/connected","payload_available":"2"}

Wohin die Reise gerade geht weiß ich nicht. Also was wollt ihr gerade genau machen, damit ich auch wieder helfen kann. Mail an Stephan van Rooij (sonos2mqtt) ist rauß. Bin mal gespannt was er sagt.

rudolfkoenig

ZitatAlso ich würde dir die RAWs ja gerne liefern aber bin dazu wohl nicht im Stande. Das sonos2mqtt Gerät hat kein rawEvents-Attribut.... wie könnte ich das noch erledigen?
attr MQTT2_SERVER verbose 5
oder
attr MQTT2_CLIENT verbose 5

Beta-User

Sorry wg. des Tpyo, und das mit dem config_$1 war auch "zu wenig" und konnte nicht funktionieren... Müßte eher so aussehen:
homeassistant/music_player/RINCON_([0-9A-Z]+):.* { $TOPIC =~ m,(RINCON_[0-9A-Z]+),; { "config_$1"=>$EVENT }}

Was man an dem Reading "HA_config" jetzt erkennen kann: Außer dass da mit "identifiers" und "name" die zwei Angaben "zusammen" drin stehen, die uns interessieren, steht da nichts wirklich neues, was man nicht auch via attrTemplate aus der API-Beschriebung erreichen/ablesen könnte.

Ansonsten ist das mit "rawEvents" was, das man am _IO_ einstellt (aus der cref zu SERVER):
Zitat
rawEvents <topic-regexp>
Send all messages as events attributed to this MQTT2_SERVER instance. Should only be used, if there is no MQTT2_DEVICE to process the topic.
Zitat von: 87insane am 02 Juni 2020, 12:09:35
Wohin die Reise gerade geht weiß ich nicht. Also was wollt ihr gerade genau machen, damit ich auch wieder helfen kann.
Ich will nur supporten, weil jemand an der Lampe gerieben hat ;) . Wenn dabei ein Satz attrTemplate rauskommt, wäre das für mich "völlig ok".

Wenn ich Otto richtig verstanden habe, will er a) MQTT weiter an einem praktischen Beispiel vertiefen und b) wissen, ob der MQTT-Weg ggf. eine Variante sein kann, wie man Sonos-Geräte gut in FHEM einbinden kann.

(@Otto: ggf. solltest du auch mal einen ESP32 mit OpenMQTTGateway ausstatten und dort das "autodiscovery"-feature _aktivieren_. Dann bekommst du ggf. ein besseres Gefühl dafür, warum ich es gut finde, dass man den Topic-Teil direkt am IO ins digitale Aufnimmerwiedersehen schicken kann...)
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

87insane

verbose 5 habe ich in der Bridge mal angemacht und gehe dann davon aus, es müsste im FHEM LOG sein? Wenn, ja:
2020.06.02 12:38:28 4:  MQTT2_DEVICE_Parse: MQTT_sonos_bridge sonos/connected => connected
2020.06.02 12:38:28 4:  MQTT2_DEVICE_Parse: MQTT_sonos_bridge sonos/connected => connected
2020.06.02 12:38:36 4:  MQTT2_DEVICE_Parse: MQTT_sonos_bridge sonos/connected => connected
2020.06.02 12:38:36 4:  MQTT2_DEVICE_Parse: MQTT_sonos_bridge homeassistant/music_player/RINCON_5CAAFD79D52801400/sonos/config => { json2nameValue($EVENT) }
2020.06.02 12:38:36 4:  MQTT2_DEVICE_Parse: MQTT_sonos_bridge homeassistant/music_player/RINCON_5CAAFD79D52801400/sonos/config => { $TOPIC =~ m,(RINCON_[0-9A-Z]+),; { "config_$1"=>$EVENT }}
2020.06.02 12:38:36 4:  MQTT2_DEVICE_Parse: MQTT_sonos_bridge homeassistant/music_player/RINCON_7828CAF427B201400/sonos/config => { $TOPIC =~ m,(RINCON_[0-9A-Z]+),; { "config_$1"=>$EVENT }}
2020.06.02 12:38:36 4:  MQTT2_DEVICE_Parse: MQTT_sonos_bridge homeassistant/music_player/RINCON_7828CAF4289001400/sonos/config => { json2nameValue($EVENT) }
2020.06.02 12:38:36 4:  MQTT2_DEVICE_Parse: MQTT_sonos_bridge homeassistant/music_player/RINCON_7828CAF4289001400/sonos/config => { $TOPIC =~ m,(RINCON_[0-9A-Z]+),; { "config_$1"=>$EVENT }}
2020.06.02 12:38:36 4:  MQTT2_DEVICE_Parse: MQTT_sonos_bridge sonos/status/küche/renderingcontrol => { json2nameValue($EVENT) }
2020.06.02 12:38:36 4:  MQTT2_DEVICE_Parse: MQTT_sonos_bridge sonos/status/badezimmer/renderingcontrol => { json2nameValue($EVENT) }
2020.06.02 12:38:36 4:  MQTT2_DEVICE_Parse: MQTT_sonos_bridge sonos/RINCON_7828CAF4289001400 => { json2nameValue($EVENT) }
2020.06.02 12:38:37 4:  MQTT2_DEVICE_Parse: MQTT_sonos_bridge sonos/RINCON_5CAAFD79D52801400 => { json2nameValue($EVENT) }
2020.06.02 12:38:41 4:  MQTT2_DEVICE_Parse: MQTT_sonos_bridge sonos/status/wohnzimmer/avtransport => { json2nameValue($EVENT) }
2020.06.02 12:38:41 4:  MQTT2_DEVICE_Parse: MQTT_sonos_bridge sonos/status/küche/avtransport => { json2nameValue($EVENT) }
2020.06.02 12:38:41 4:  MQTT2_DEVICE_Parse: MQTT_sonos_bridge sonos/status/badezimmer/avtransport => { json2nameValue($EVENT) }
2020.06.02 12:38:42 4:  MQTT2_DEVICE_Parse: MQTT_sonos_bridge sonos/RINCON_7828CAF4289001400 => { json2nameValue($EVENT) }
2020.06.02 12:38:42 4:  MQTT2_DEVICE_Parse: MQTT_sonos_bridge sonos/RINCON_5CAAFD79D52801400 => { json2nameValue($EVENT) }


ZitatSorry wg. des Tpyo, und das mit dem config_$1 war auch "zu wenig" und konnte nicht funktionieren... Müßte eher so aussehen:
Code: [Auswählen]
homeassistant/music_player/RINCON_([0-9A-Z]+):.* { $TOPIC =~ m,(RINCON_[0-9A-Z]+),; { "config_$1"=>$EVENT }}
geht so auch nicht. Der Zweig ist länger. Hab es mal angepasst und dann geht es wie du das wolltest :) (es fehlt /sonos/config hinter dem RINCON_...)

Jo das weiter entwickeln hatte ich mitbekommen und unterstütze ich auch gerne. Hab heute auch noch zig andere xxxx2mqtt´s gefunden. Echt heftig wie viele es gibt ^^

TomLee

#29
Bei mir siehts mit rawEvents .* (.*weils nur das Device gibt bei dem Server) so aus:


2020-06-02 12:39:09 MQTT2_SERVER MQTT2_Server homeassistant/music_player/RINCON_000E58F7F67C01400/sonos/config:{"available_commands":["adv-command","command","joingroup","leavegroup","mute","next","notify","pause","play","playmode","previous","queue","seek","selecttrack","setavtransporturi","sleep","speak","stop","switchtoline","switchtoqueue","switchtotv","toggle","unmute","volume","volumedown","volumeup"],"command_topic":"sonos/RINCON_000E58F7F67C01400/control","device":{"identifiers":["RINCON_000E58F7F67C01400"],"manufacturer":"Sonos","name":"Wohnzimmer"},"device_class":"speaker","icon":"mdi:speaker","json_attributes":true,"json_attributes_topic":"sonos/RINCON_000E58F7F67C01400","name":"Wohnzimmer","state_topic":"sonos/RINCON_000E58F7F67C01400","unique_id":"sonos2mqtt_RINCON_000E58F7F67C01400_speaker","availability_topic":"sonos/connected","payload_available":"2"}

2020-06-02 12:39:15 MQTT2_SERVER MQTT2_Server sonos/status/wohnzimmer/avtransport:{"AVTransportURI":"x-rincon-mp3radio://http://opml.radiotime.com/Tune.ashx?id=e88185605&sid=s2485&formats=aac,mp3,hls&partnerId=rjyYMwEH&serial=AHFLNOA3T2XT6VWH2BAPMLPWOGLA","AVTransportURIMetaData":{"AlbumArtUri":"https://cdn-radiotime-logos.tunein.com/s2485q.png","Title":"102.8 Radio Regenbogen Heidelberg","UpnpClass":"object.item.audioItem.audioBroadcast","ItemId":"-1","ParentId":"-1"},"AlarmRunning":false,"CurrentCrossfadeMode":false,"CurrentMediaDuration":"NOT_IMPLEMENTED","CurrentPlayMode":"NORMAL","CurrentRecordQualityMode":"NOT_IMPLEMENTED","CurrentSection":0,"CurrentTrack":1,"CurrentTrackDuration":"0:00:00","CurrentTrackMetaData":{"AlbumArtUri":"http://192.168.188.38:1400/getaa?u=x-rincon-mp3radio:%2f%2fhttp:%2f%2fopml.radiotime.com%2fTune.ashx%3fid%3de88185605%26sid%3ds2485%26formats%3daac,mp3,hls%26partnerId%3drjyYMwEH%26serial%3dAHFLNOA3T2XT6VWH2BAPMLPWOGLA&v=81","Title":"102.8 Radio Regenbogen Heidelberg","UpnpClass":"object.item","ItemId":"-1","ParentId":"-1","TrackUri":"x-rincon-mp3radio://http://opml.radiotime.com/Tune.ashx?id=e88185605&sid=s2485&formats=aac,mp3,hls&partnerId=rjyYMwEH&serial=AHFLNOA3T2XT6VWH2BAPMLPWOGLA","ProtocolInfo":"x-rincon-mp3radio:*:*:*"},"CurrentTrackURI":"x-rincon-mp3radio://http://opml.radiotime.com/Tune.ashx?id=e88185605&sid=s2485&formats=aac,mp3,hls&partnerId=rjyYMwEH&serial=AHFLNOA3T2XT6VWH2BAPMLPWOGLA","CurrentTransportActions":"Set, Stop, Play","DirectControlIsSuspended":false,"EnqueuedTransportURI":"x-rincon-mp3radio://http://opml.radiotime.com/Tune.ashx?id=e88185605&sid=s2485&formats=aac,mp3,hls&partnerId=rjyYMwEH&serial=AHFLNOA3T2XT6VWH2BAPMLPWOGLA","EnqueuedTransportURIMetaData":{"AlbumArtUri":"https://cdn-radiotime-logos.tunein.com/s2485q.png","Title":"102.8 Radio Regenbogen Heidelberg","UpnpClass":"object.item.audioItem.audioBroadcast","ItemId":"-1","ParentId":"-1"},"NumberOfTracks":1,"PlaybackStorageMedium":"NETWORK","PossiblePlaybackStorageMedia":"NONE, NETWORK","PossibleRecordQualityModes":"NOT_IMPLEMENTED","PossibleRecordStorageMedia":"NOT_IMPLEMENTED","RecordMediumWriteStatus":"NOT_IMPLEMENTED","RecordStorageMedium":"NOT_IMPLEMENTED","RestartPending":false,"SleepTimerGeneration":0,"SnoozeRunning":false,"TransportPlaySpeed":"NOT_IMPLEMENTED","TransportState":"STOPPED","TransportStatus":"OK"}

2020-06-02 12:39:15 MQTT2_SERVER MQTT2_Server sonos/status/wohnzimmer/renderingcontrol:{"Bass":3,"HeadphoneConnected":false,"Loudness":true,"Mute":{"Master":false,"LF":false,"RF":false},"OutputFixed":false,"PresetNameList":"FactoryDefaults","SpeakerSize":4,"SubCrossover":"0","SubEnabled":true,"SubGain":"0","SubPolarity":"0","Treble":-5,"Volume":{"Master":18,"LF":100,"RF":100}}

2020-06-02 12:39:15 MQTT2_SERVER MQTT2_Server sonos/RINCON_000E58F7F67C01400:{"uuid":"RINCON_000E58F7F67C01400","name":"Wohnzimmer","groupName":"Wohnzimmer","coordinatorUuid":"RINCON_000E58F7F67C01400","currentTrack":{"AlbumArtUri":"http://192.168.188.38:1400/getaa?u=x-rincon-mp3radio:%2f%2fhttp:%2f%2fopml.radiotime.com%2fTune.ashx%3fid%3de88185605%26sid%3ds2485%26formats%3daac,mp3,hls%26partnerId%3drjyYMwEH%26serial%3dAHFLNOA3T2XT6VWH2BAPMLPWOGLA&v=81","Title":"102.8 Radio Regenbogen Heidelberg","UpnpClass":"object.item","ItemId":"-1","ParentId":"-1","TrackUri":"x-rincon-mp3radio://http://opml.radiotime.com/Tune.ashx?id=e88185605&sid=s2485&formats=aac,mp3,hls&partnerId=rjyYMwEH&serial=AHFLNOA3T2XT6VWH2BAPMLPWOGLA","ProtocolInfo":"x-rincon-mp3radio:*:*:*"},"enqueuedMetadata":{"AlbumArtUri":"https://cdn-radiotime-logos.tunein.com/s2485q.png","Title":"102.8 Radio Regenbogen Heidelberg","UpnpClass":"object.item.audioItem.audioBroadcast","ItemId":"-1","ParentId":"-1"},"transportState":"STOPPED","playmode":"NORMAL","ts":1591094355330,"volume":{"Master":18,"LF":100,"RF":100},"mute":{"Master":false,"LF":false,"RF":false}}


Gruß

Thomas