XBMC Mediatype

Begonnen von Wolfgang Hochweller, 13 Juli 2016, 10:25:59

Vorheriges Thema - Nächstes Thema

Wolfgang Hochweller

Die XBMC-Steuerung ueber FHEM funktioniert, aber :

Den Mediatyp 'Movie' scheint es nicht zu geben.
Mit Musik und Bilder ist alles korrekt, nur nicht mit Videos.

Logfile :  016.07.13 08:44:52 1: Error: Wohnmedia has no TYPE.
Wie kriege ich raus, was fuer ein Typ von XBMC geliefert wird ( wenn ueberhaupt ) ?

Wolfgang Hochweller

Ich verstehe es nicht.

Unten  ist das Notify fuer den Status meines XBMC-Players ( WohnMedia )
Dieses Notify wird  bei jeder Betaetigung der Play- oder Pause-Taste zweimal ( warum zweimal ? ) aufgerufen.
Ergebnisse :
Der 'playStatus'  ist immer korrekt, entweder 'playing'  oder 'paused' .
Nach 'Play' ist der Wert fuer 'type' einmal  'unknown', einmal 'movie', in verschiedener Reihenfolge,
nach 'Pause' ist der Wert von 'type' immer 'unknown'.

mit dem Erfolg, das die Beleuchtung ( WohnAll )   nach 'Play' zwar ausgeht,
aber nach 'Pause' nie wieder an.

Was passiert hier ?


WohnMedia:playStatus:.* {
if (ReadingsVal("WohnMedia", "type", "") eq "movie"){
    if (ReadingsVal("WohnMedia", "playStatus", "") eq "playing"){
       fhem("set WohnAll off");;
    }
    if (ReadingsVal("WohnMedia", "playStatus", "") eq "paused"){
       fhem("set WohnAll on");;
    }
   }
}

vbs

Zitat von: howi42 am 14 Juli 2016, 08:58:11
Dieses Notify wird  bei jeder Betaetigung der Play- oder Pause-Taste zweimal ( warum zweimal ? ) aufgerufen.
Nutzt du evtl. die Kodi-Funktion zum Verzögern des Films, während die Bildwiederholfrequenz angepasst wird? Das ist ein Grund, warum das passiern kann.

Ansonsten zu dem mediaType wären Logfiles (verbose mindestens 4) hilfreich und zu wissen, was du überhaupt abspielst. Bei Streams zB hat Kodi Probleme, den richtigen Typen zu liefern.

Wolfgang Hochweller

Hier ein Beispiellog  fuer 'Pause' :

Was ich daran erkennen kann :
Status : 'paused' und Type :Movie  werden durchaus richtig erkannt; wenn ich mir allerdings die Readings von WohnMedia ansehe, ist 'type' immer 'unknown', 'status'  immer korrekt.
Das Notify wird getriggert, aber der Zweig fuer 'paused' wird nie ausgefuehrt.

- Wolfgang

2016.07.14 08:32:25 5: XBMC_Read: Incoming data: {"jsonrpc":"2.0","method":"Player.OnPause","params":{"data":{"item":{"title":"2016-07-07_20-15-46_3sat HD (deu)_Janus (6 7) - Krimiserie, Österreich 2013.ts","type":"movie"},"player":{"playerid":1,"speed":0}},"sender":"xbmc"}}
2016.07.14 08:32:25 5: XBMC_Read: Current processing buffer (PARTIAL + incoming data): {"jsonrpc":"2.0","method":"Player.OnPause","params":{"data":{"item":{"title":"2016-07-07_20-15-46_3sat HD (deu)_Janus (6 7) - Krimiserie, Österreich 2013.ts","type":"movie"},"player":{"playerid":1,"speed":0}},"sender":"xbmc"}}
2016.07.14 08:32:25 4: XBMC_Read: Decoding JSON message. Length: 227 Content: {"jsonrpc":"2.0","method":"Player.OnPause","params":{"data":{"item":{"title":"2016-07-07_20-15-46_3sat HD (deu)_Janus (6 7) - Krimiserie, Österreich 2013.ts","type":"movie"},"player":{"playerid":1,"speed":0}},"sender":"xbmc"}}
2016.07.14 08:32:25 5: Triggering WohnMedia (1 changes)
2016.07.14 08:32:25 5: Starting notify loop for WohnMedia, first event playStatus: paused
2016.07.14 08:32:25 5: Triggering notify_WohnMedia_status
2016.07.14 08:32:25 4: notify_WohnMedia_status exec { if (ReadingsVal("WohnMedia", "type", "") eq "movie"){
    if (ReadingsVal("WohnMedia", "playStatus", "") eq "playing"){
       fhem("set WohnAll off");;;;
    }
    if (ReadingsVal("WohnMedia", "playStatus", "") eq "paused"){
       fhem("set WohnAll on");;;;
    }
   }
}
2016.07.14 08:32:25 5: Cmd: >{ if (ReadingsVal("WohnMedia", "type", "") eq "movie"){
    if (ReadingsVal("WohnMedia", "playStatus", "") eq "playing"){
       fhem("set WohnAll off");;
    }
    if (ReadingsVal("WohnMedia", "playStatus", "") eq "paused"){
       fhem("set WohnAll on");;
    }
   }
}<
2016.07.14 08:32:25 5: XBMC_Read: Tail:
2016.07.14 08:32:25 5: XBMC_Read: PARTIAL:

vbs

Und nach dieser Pause-Nachricht war 'type' dann 'unknown'? Das was in FHEM im Reading zu sehen, kommt immer von XBMC selbst. Siehst du ja in deinem Log, dass XBMC als type "movie" schickt. Das wird so übernommen.
Wenn also nach der Nachricht von XBMC wirklich unknown drin steht, dann wäre das mindestens seltsam.

Wolfgang Hochweller

#5
Ich habe das Log mal um eine eigene Anweiseung erweitert.
Eine Play/Pause Sequenz ergibt dann :

Das erste , Play :
2016.07.14 23:09:34 5: XBMC_Read: Incoming data: {"jsonrpc":"2.0","method":"Playlist.OnClear","params":{"data":{"playlistid":1},"sender":"xbmc"}}
2016.07.14 23:09:34 5: XBMC_Read: Current processing buffer (PARTIAL + incoming data): {"jsonrpc":"2.0","method":"Playlist.OnClear","params":{"data":{"playlistid":1},"sender":"xbmc"}}
2016.07.14 23:09:34 4: XBMC_Read: Decoding JSON message. Length: 96 Content: {"jsonrpc":"2.0","method":"Playlist.OnClear","params":{"data":{"playlistid":1},"sender":"xbmc"}}
2016.07.14 23:09:34 5: Triggering WohnMedia (1 changes)
2016.07.14 23:09:34 5: Starting notify loop for WohnMedia, first event playlist: clear
2016.07.14 23:09:34 5: ZE.Batterie: not on any display, ignoring notify
2016.07.14 23:09:34 5: XBMC_Read: Tail:
2016.07.14 23:09:34 5: XBMC_Read: PARTIAL:
2016.07.14 23:09:34 5: XBMC_ProcessRead
2016.07.14 23:09:34 5: No PARTIAL buffer
2016.07.14 23:09:34 5: XBMC_Read: Incoming data: {"jsonrpc":"2.0","method":"Playlist.OnAdd","params":{"data":{"item":{"title":"2016-07-06_20-56-00_3sat HD (deu)_Janus (5 7) - Krimiserie, Österreich 2013.ts","type":"movie"},"playlistid":1,"position":0},"sender":"xbmc"}}
2016.07.14 23:09:34 5: XBMC_Read: Current processing buffer (PARTIAL + incoming data): {"jsonrpc":"2.0","method":"Playlist.OnAdd","params":{"data":{"item":{"title":"2016-07-06_20-56-00_3sat HD (deu)_Janus (5 7) - Krimiserie, Österreich 2013.ts","type":"movie"},"playlistid":1,"position":0},"sender":"xbmc"}}
2016.07.14 23:09:34 4: XBMC_Read: Decoding JSON message. Length: 221 Content: {"jsonrpc":"2.0","method":"Playlist.OnAdd","params":{"data":{"item":{"title":"2016-07-06_20-56-00_3sat HD (deu)_Janus (5 7) - Krimiserie, Österreich 2013.ts","type":"movie"},"playlistid":1,"position":0},"sender":"xbmc"}}
2016.07.14 23:09:34 5: Triggering WohnMedia (1 changes)
2016.07.14 23:09:34 5: Starting notify loop for WohnMedia, first event playlist: add
2016.07.14 23:09:34 5: ZE.Batterie: not on any display, ignoring notify
2016.07.14 23:09:34 5: XBMC_Read: Tail:
2016.07.14 23:09:34 5: XBMC_Read: PARTIAL:
2016.07.14 23:09:35 5: XBMC_ProcessRead
2016.07.14 23:09:35 5: No PARTIAL buffer
2016.07.14 23:09:35 5: XBMC_Read: Incoming data: {"jsonrpc":"2.0","method":"Player.OnPlay","params":{"data":{"item":{"title":"2016-07-06_20-56-00_3sat HD (deu)_Janus (5 7) - Krimiserie, Österreich 2013.ts","type":"movie"},"player":{"playerid":1,"speed":1}},"sender":"xbmc"}}
2016.07.14 23:09:35 5: XBMC_Read: Current processing buffer (PARTIAL + incoming data): {"jsonrpc":"2.0","method":"Player.OnPlay","params":{"data":{"item":{"title":"2016-07-06_20-56-00_3sat HD (deu)_Janus (5 7) - Krimiserie, Österreich 2013.ts","type":"movie"},"player":{"playerid":1,"speed":1}},"sender":"xbmc"}}
2016.07.14 23:09:35 4: XBMC_Read: Decoding JSON message. Length: 226 Content: {"jsonrpc":"2.0","method":"Player.OnPlay","params":{"data":{"item":{"title":"2016-07-06_20-56-00_3sat HD (deu)_Janus (5 7) - Krimiserie, Österreich 2013.ts","type":"movie"},"player":{"playerid":1,"speed":1}},"sender":"xbmc"}}
2016.07.14 23:09:35 5: Triggering WohnMedia (17 changes)
2016.07.14 23:09:35 5: Starting notify loop for WohnMedia, first event currentMedia:
2016.07.14 23:09:35 5: ZE.Batterie: not on any display, ignoring notify
2016.07.14 23:09:35 5: Cmd: >deletereading WohnMedia sd_.*<
2016.07.14 23:09:35 5: Triggering WohnMedia (4 changes)
2016.07.14 23:09:35 5: Starting notify loop for WohnMedia, first event playStatus: playing
2016.07.14 23:09:35 5: ZE.Batterie: not on any display, ignoring notify
2016.07.14 23:09:35 5: Triggering notify_WohnMedia_status
2016.07.14 23:09:35 4: notify_WohnMedia_status exec {
Log 1, "ReadingsVal ist".ReadingsVal("WohnMedia","type","");;;;
if (ReadingsVal("WohnMedia", "type", "") eq "movie"){
    if (ReadingsVal("WohnMedia", "playStatus", "") eq "playing"){
       fhem("set WohnAll off");;;;
    }
    if (ReadingsVal("WohnMedia", "playStatus", "") eq "paused"){
       fhem("set WohnAll on");;;;
    }
   }
}
2016.07.14 23:09:35 5: Cmd: >{
Log 1, "ReadingsVal ist".ReadingsVal("WohnMedia","type","");;
if (ReadingsVal("WohnMedia", "type", "") eq "movie"){
    if (ReadingsVal("WohnMedia", "playStatus", "") eq "playing"){
       fhem("set WohnAll off");;
    }
    if (ReadingsVal("WohnMedia", "playStatus", "") eq "paused"){
       fhem("set WohnAll on");;
    }
   }
}<
2016.07.14 23:09:35 1: ReadingsVal istmovie
2016.07.14 23:09:35 5: Cmd: >set WohnAll off<

Sieht gut aus, 'type' ist 'movie' , Licht geht aus.

Alle anderen sehen in etwa so aus :


2016.07.14 23:11:20 4: XBMC_Call: Sending: {"params":{"properties":["volume","muted","name","version"]},"method":"Application.GetProperties","id":4472,"jsonrpc":"2.0"}
2016.07.14 23:11:20 5: SW: 7b22706172616d73223a7b2270726f70657274696573223a5b22766f6c756d65222c226d75746564222c226e616d65222c2276657273696f6e225d7d2c226d6574686f64223a224170706c69636174696f6e2e47657450726f70657274696573222c226964223a343437322c226a736f6e727063223a22322e30227d
2016.07.14 23:11:20 4: XBMC_Call: Sending: {"params":{"properties":["skin","fullscreen","stereoscopicmode"]},"jsonrpc":"2.0","method":"GUI.GetProperties","id":4473}
2016.07.14 23:11:20 5: SW: 7b22706172616d73223a7b2270726f70657274696573223a5b22736b696e222c2266756c6c73637265656e222c2273746572656f73636f7069636d6f6465225d7d2c226a736f6e727063223a22322e30222c226d6574686f64223a224755492e47657450726f70657274696573222c226964223a343437337d
2016.07.14 23:11:20 4: XBMC_Call: Sending: {"jsonrpc":"2.0","id":"4474","method":"Player.GetActivePlayers"}
2016.07.14 23:11:20 5: SW: 7b226a736f6e727063223a22322e30222c226964223a2234343734222c226d6574686f64223a22506c617965722e476574416374697665506c6179657273227d
2016.07.14 23:11:20 4: XBMC_UpdatePlayerItem
2016.07.14 23:11:20 4: XBMC_Call: Sending: {"jsonrpc":"2.0","method":"Player.GetActivePlayers","id":"4475"}
2016.07.14 23:11:20 5: SW: 7b226a736f6e727063223a22322e30222c226d6574686f64223a22506c617965722e476574416374697665506c6179657273222c226964223a2234343735227d
2016.07.14 23:11:20 5: XBMC_ProcessRead
2016.07.14 23:11:20 5: No PARTIAL buffer
2016.07.14 23:11:20 5: XBMC_Read: Incoming data: {"id":4472,"jsonrpc":"2.0","result":{"muted":false,"name":"Kodi","version":{"major":16,"minor":0,"revision":"76f7098","tag":"alpha","tagversion":"1"},"volume":100}}{"id":4473,"jsonrpc":"2.0","result":{"fullscreen":true,"skin":{"id":"skin.confluence","name":"Confluence"},"stereoscopicmode":{"label":"Deaktiviert","mode":"off"}}}{"id":"4474","jsonrpc":"2.0","result":[{"playerid":1,"type":"video"}]}{"id":"4475","jsonrpc":"2.0","result":[{"playerid":1,"type":"video"}]}
2016.07.14 23:11:20 5: XBMC_Read: Current processing buffer (PARTIAL + incoming data): {"id":4472,"jsonrpc":"2.0","result":{"muted":false,"name":"Kodi","version":{"major":16,"minor":0,"revision":"76f7098","tag":"alpha","tagversion":"1"},"volume":100}}{"id":4473,"jsonrpc":"2.0","result":{"fullscreen":true,"skin":{"id":"skin.confluence","name":"Confluence"},"stereoscopicmode":{"label":"Deaktiviert","mode":"off"}}}{"id":"4474","jsonrpc":"2.0","result":[{"playerid":1,"type":"video"}]}{"id":"4475","jsonrpc":"2.0","result":[{"playerid":1,"type":"video"}]}
2016.07.14 23:11:20 4: XBMC_Read: Decoding JSON message. Length: 164 Content: {"id":4472,"jsonrpc":"2.0","result":{"muted":false,"name":"Kodi","version":{"major":16,"minor":0,"revision":"76f7098","tag":"alpha","tagversion":"1"},"volume":100}}
2016.07.14 23:11:20 5: Triggering WohnMedia (4 changes)
2016.07.14 23:11:20 5: Starting notify loop for WohnMedia, first event version: 16.0-76f7098 alpha
2016.07.14 23:11:20 4: XBMC_Read: Decoding JSON message. Length: 164 Content: {"id":4473,"jsonrpc":"2.0","result":{"fullscreen":true,"skin":{"id":"skin.confluence","name":"Confluence"},"stereoscopicmode":{"label":"Deaktiviert","mode":"off"}}}
2016.07.14 23:11:20 5: Triggering WohnMedia (3 changes)
2016.07.14 23:11:20 5: Starting notify loop for WohnMedia, first event stereoscopicmode: off
2016.07.14 23:11:20 5: ZE.Batterie: not on any display, ignoring notify
2016.07.14 23:11:20 4: XBMC_Read: Decoding JSON message. Length: 70 Content: {"id":"4474","jsonrpc":"2.0","result":[{"playerid":1,"type":"video"}]}
2016.07.14 23:11:20 4: XBMC_Call: Sending: {"jsonrpc":"2.0","method":"Player.GetProperties","id":4476,"params":{"playerid":1,"properties":["time","totaltime","repeat","shuffled","speed","partymode"]}}
2016.07.14 23:11:20 5: SW: 7b226a736f6e727063223a22322e30222c226d6574686f64223a22506c617965722e47657450726f70657274696573222c226964223a343437362c22706172616d73223a7b22706c617965726964223a312c2270726f70657274696573223a5b2274696d65222c22746f74616c74696d65222c22726570656174222c2273687566666c6564222c227370656564222c2270617274796d6f6465225d7d7d
2016.07.14 23:11:20 4: XBMC_Read: Decoding JSON message. Length: 70 Content: {"id":"4475","jsonrpc":"2.0","result":[{"playerid":1,"type":"video"}]}
2016.07.14 23:11:20 4: XBMC_Call: Sending: {"params":{"properties":["artist","album","thumbnail","file","title","track","year","streamdetails","tvshowid"],"playerid":1},"jsonrpc":"2.0","method":"Player.GetItem","id":4477}
2016.07.14 23:11:20 5: SW: 7b22706172616d73223a7b2270726f70657274696573223a5b22617274697374222c22616c62756d222c227468756d626e61696c222c2266696c65222c227469746c65222c22747261636b222c2279656172222c2273747265616d64657461696c73222c22747673686f776964225d2c22706c617965726964223a317d2c226a736f6e727063223a22322e30222c226d6574686f64223a22506c617965722e4765744974656d222c226964223a343437377d
2016.07.14 23:11:20 5: XBMC_Read: Tail:
2016.07.14 23:11:20 5: XBMC_Read: PARTIAL:
2016.07.14 23:11:20 5: XBMC_ProcessRead
2016.07.14 23:11:20 5: No PARTIAL buffer
2016.07.14 23:11:20 5: XBMC_Read: Incoming data: {"id":4476,"jsonrpc":"2.0","result":{"partymode":false,"repeat":"off","shuffled":false,"speed":1,"time":{"hours":0,"milliseconds":39,"minutes":1,"seconds":40},"totaltime":{"hours":1,"milliseconds":530,"minutes":0,"seconds":59}}}
2016.07.14 23:11:20 5: XBMC_Read: Current processing buffer (PARTIAL + incoming data): {"id":4476,"jsonrpc":"2.0","result":{"partymode":false,"repeat":"off","shuffled":false,"speed":1,"time":{"hours":0,"milliseconds":39,"minutes":1,"seconds":40},"totaltime":{"hours":1,"milliseconds":530,"minutes":0,"seconds":59}}}
2016.07.14 23:11:20 4: XBMC_Read: Decoding JSON message. Length: 228 Content: {"id":4476,"jsonrpc":"2.0","result":{"partymode":false,"repeat":"off","shuffled":false,"speed":1,"time":{"hours":0,"milliseconds":39,"minutes":1,"seconds":40},"totaltime":{"hours":1,"milliseconds":530,"minutes":0,"seconds":59}}}
2016.07.14 23:11:20 5: Triggering WohnMedia (7 changes)
2016.07.14 23:11:20 5: Starting notify loop for WohnMedia, first event partymode: off
2016.07.14 23:11:20 5: ZE.Batterie: not on any display, ignoring notify
2016.07.14 23:11:20 5: Triggering notify_WohnMedia_status
2016.07.14 23:11:20 4: notify_WohnMedia_status exec {
Log 1, "ReadingsVal ist".ReadingsVal("WohnMedia","type","");;;;
if (ReadingsVal("WohnMedia", "type", "") eq "movie"){
    if (ReadingsVal("WohnMedia", "playStatus", "") eq "playing"){
       fhem("set WohnAll off");;;;
    }
    if (ReadingsVal("WohnMedia", "playStatus", "") eq "paused"){
       fhem("set WohnAll on");;;;
    }
   }
}
2016.07.14 23:11:20 5: Cmd: >{
Log 1, "ReadingsVal ist".ReadingsVal("WohnMedia","type","");;
if (ReadingsVal("WohnMedia", "type", "") eq "movie"){
    if (ReadingsVal("WohnMedia", "playStatus", "") eq "playing"){
       fhem("set WohnAll off");;
    }
    if (ReadingsVal("WohnMedia", "playStatus", "") eq "paused"){
       fhem("set WohnAll on");;
    }
   }
}<
2016.07.14 23:11:20 1: ReadingsVal istunknown
2016.07.14 23:11:20 5: XBMC_Read: Tail:
2016.07.14 23:11:20 5: XBMC_Read: PARTIAL:
2016.07.14 23:11:20 5: XBMC_ProcessRead
2016.07.14 23:11:20 5: No PARTIAL buffer
2016.07.14 23:11:20 5: XBMC_Read: Incoming data: {"id":4477,"jsonrpc":"2.0","result":{"item":{"album":"","artist":[],"file":"smb://10.0.0.93/f/Recordings/2016-07-06_20-56-00_3sat HD (deu)_Janus (5 7) - Krimiserie, Österreich 2013.ts","label":"2016-07-06_20-56-00_3sat HD (deu)_Janus (5 7) - Krimiserie, Österreich 2013.ts","streamdetails":{"audio":[{"channels":2,"codec":"mp2","language":"deu"},{"channels":2,"codec":"mp2","language":"mis"},{"channels":2,"codec":"ac3","language":"deu"},{"channels":2,"codec":"mp2","language":"mul"}],"subtitle":[{"language":""}],"video":[{"aspect":1.7777780294418334961,"codec":"h264","duration":3659,"height":720,"stereomode":"","width":1280}]},"thumbnail":"","title":"","track":-1,"tvshowid":-1,"type":"unknown","year":0}}}
2016.07.14 23:11:20 5: XBMC_Read: Current processing buffer (PARTIAL + incoming data): {"id":4477,"jsonrpc":"2.0","result":{"item":{"album":"","artist":[],"file":"smb://10.0.0.93/f/Recordings/2016-07-06_20-56-00_3sat HD (deu)_Janus (5 7) - Krimiserie, Österreich 2013.ts","label":"2016-07-06_20-56-00_3sat HD (deu)_Janus (5 7) - Krimiserie, Österreich 2013.ts","streamdetails":{"audio":[{"channels":2,"codec":"mp2","language":"deu"},{"channels":2,"codec":"mp2","language":"mis"},{"channels":2,"codec":"ac3","language":"deu"},{"channels":2,"codec":"mp2","language":"mul"}],"subtitle":[{"language":""}],"video":[{"aspect":1.7777780294418334961,"codec":"h264","duration":3659,"height":720,"stereomode":"","width":1280}]},"thumbnail":"","title":"","track":-1,"tvshowid":-1,"type":"unknown","year":0}}}
2016.07.14 23:11:20 4: XBMC_Read: Decoding JSON message. Length: 712 Content: {"id":4477,"jsonrpc":"2.0","result":{"item":{"album":"","artist":[],"file":"smb://10.0.0.93/f/Recordings/2016-07-06_20-56-00_3sat HD (deu)_Janus (5 7) - Krimiserie, Österreich 2013.ts","label":"2016-07-06_20-56-00_3sat HD (deu)_Janus (5 7) - Krimiserie, Österreich 2013.ts","streamdetails":{"audio":[{"channels":2,"codec":"mp2","language":"deu"},{"channels":2,"codec":"mp2","language":"mis"},{"channels":2,"codec":"ac3","language":"deu"},{"channels":2,"codec":"mp2","language":"mul"}],"subtitle":[{"language":""}],"video":[{"aspect":1.7777780294418334961,"codec":"h264","duration":3659,"height":720,"stereomode":"","width":1280}]},"thumbnail":"","title":"","track":-1,"tvshowid":-1,"type":"unknown","year":0}}}
2016.07.14 23:11:20 5: Triggering WohnMedia (30 changes)
2016.07.14 23:11:20 5: Starting notify loop for WohnMedia, first event currentArtist:
2016.07.14 23:11:20 5: XBMC_Read: Tail:
2016.07.14 23:11:20 5: XBMC_Read: PARTIAL:



Das ist offenbar ziemlicher Schrott :
- Lauter SW: Eintraege, die wohl bedeuten, dass da etwas schiefgegangen ist .
- Triggering Wohnmedia zeigt mal  3 Changes, mal 30. Und zwar gelogen, ausser Play und Pause habe ich nichts angefasst.

Ich werde morgen das System mit einer neueren OpenElec-Version aufsetzen, mal sehen, ob das was bringt.

vbs

Hast du evtl. "event-on-change-reading" nicht gesetzt für das XBMC-Device? Das würde zumindest die Blind-Trigger erklären, auch wenn sich an den Readings gar nichts geändert hat. Im Event-Monitor von FHEM kannst du alle Events sehen, die gefeuert werden.

Wolfgang Hochweller

Damit konnte ich zumindest die Eventanzahl reduzieren, allerdings nicht die Qualitaet.
Beim Uebergang von Pause auf Play funktioniert es  ( type ist movie, status ist playing)
Beim Uebergang von Play auf Pause geht wenig ( type ist unknown, status ist paused ) und die Messages werden nicht immer sauber verarbeitet.
Die neueste OpenELEC Version aendert daran nichts.

Schluss : Die Auswertung der Events macht wenig Sinn, aber das Senden von Kommandos und die FHEM-Remote
funktionieren.

vbs

Ich muss nochmal fragen: Das Ergebnis von der Nachricht weiter oben (in der eigentlich type "movie") drin steht ist dann, dass in FHEM "unknown" steht tatsächlich?

Und was meinst du damit, dass die Messages nicht sauber verarbeitet werden?

PS.
In deinem letzten (längeren) Log kann ich gar keine Pause entdecken.

Wolfgang Hochweller

Hier nochmal ein Beispiel :
Player laeuft, ich druecke Pause :
2016.07.15 18:34:02 5: XBMC_Read: Incoming data: {"jsonrpc":"2.0","method":"Player.OnPause","params":{"data":{"item":{"title":"2016-07-06_20-56-00_3sat HD (deu)_Janus (5 7) - Krimiserie, Österreich 2013.ts","type":"movie"},"player":{"playerid":1,"speed":0}},"sender":"xbmc"}}
2016.07.15 18:34:02 5: XBMC_Read: Current processing buffer (PARTIAL + incoming data): {"jsonrpc":"2.0","method":"Player.OnPause","params":{"data":{"item":{"title":"2016-07-06_20-56-00_3sat HD (deu)_Janus (5 7) - Krimiserie, Österreich 2013.ts","type":"movie"},"player":{"playerid":1,"speed":0}},"sender":"xbmc"}}
2016.07.15 18:34:02 4: XBMC_Read: Decoding JSON message. Length: 227 Content: {"jsonrpc":"2.0","method":"Player.OnPause","params":{"data":{"item":{"title":"2016-07-06_20-56-00_3sat HD (deu)_Janus (5 7) - Krimiserie, Österreich 2013.ts","type":"movie"},"player":{"playerid":1,"speed":0}},"sender":"xbmc"}}
2016.07.15 18:34:02 5: Triggering WohnMedia (1 changes)
2016.07.15 18:34:02 5: Starting notify loop for WohnMedia, first event playStatus: paused
2016.07.15 18:34:02 5: ZE.Batterie: not on any display, ignoring notify
2016.07.15 18:34:02 5: Triggering notify_WohnMedia_status
2016.07.15 18:34:02 4: notify_WohnMedia_status exec {
Log 1, "ReadingsVal ist " . ReadingsVal("WohnMedia","type","") . " " . ReadingsVal("WohnMedia","playStatus","");;;;
if (ReadingsVal("WohnMedia", "type", "") eq "movie"){
    if (ReadingsVal("WohnMedia", "playStatus", "") eq "playing"){
       fhem("set WohnAll off");;;;
    }
    if (ReadingsVal("WohnMedia", "playStatus", "") eq "paused"){
       fhem("set WohnAll on");;;;
    }
   }
}
2016.07.15 18:34:02 5: Cmd: >{
Log 1, "ReadingsVal ist " . ReadingsVal("WohnMedia","type","") . " " . ReadingsVal("WohnMedia","playStatus","");;
if (ReadingsVal("WohnMedia", "type", "") eq "movie"){
    if (ReadingsVal("WohnMedia", "playStatus", "") eq "playing"){
       fhem("set WohnAll off");;
    }
    if (ReadingsVal("WohnMedia", "playStatus", "") eq "paused"){
       fhem("set WohnAll on");;
    }
   }
}<
2016.07.15 18:34:02 1: ReadingsVal ist unknown paused


Oben sieht es noch gut aus ( type movie, status paused )
Weiter unten ist type dann unknown  ( ich lasse  die Werte extra loggen )

Danach druecke ich Play und das ist das Ergebnis :

2016.07.15 18:34:02 5: XBMC_Read: Tail:
2016.07.15 18:34:02 5: XBMC_Read: PARTIAL:
2016.07.15 18:34:04 5: XBMC_ProcessRead
2016.07.15 18:34:04 5: No PARTIAL buffer
2016.07.15 18:34:04 5: XBMC_Read: Incoming data: {"jsonrpc":"2.0","method":"Player.OnStop","params":{"data":{"end":false,"item":{"title":"2016-07-06_20-56-00_3sat HD (deu)_Janus (5 7) - Krimiserie, Österreich 2013.ts","type":"movie"}},"sender":"xbmc"}}
2016.07.15 18:34:04 5: XBMC_Read: Current processing buffer (PARTIAL + incoming data): {"jsonrpc":"2.0","method":"Player.OnStop","params":{"data":{"end":false,"item":{"title":"2016-07-06_20-56-00_3sat HD (deu)_Janus (5 7) - Krimiserie, Österreich 2013.ts","type":"movie"}},"sender":"xbmc"}}
2016.07.15 18:34:04 4: XBMC_Read: Decoding JSON message. Length: 204 Content: {"jsonrpc":"2.0","method":"Player.OnStop","params":{"data":{"end":false,"item":{"title":"2016-07-06_20-56-00_3sat HD (deu)_Janus (5 7) - Krimiserie, Österreich 2013.ts","type":"movie"}},"sender":"xbmc"}}
2016.07.15 18:34:04 5: Triggering WohnMedia (1 changes)
2016.07.15 18:34:04 5: Starting notify loop for WohnMedia, first event playStatus: stopped
2016.07.15 18:34:04 5: ZE.Batterie: not on any display, ignoring notify
2016.07.15 18:34:04 5: Triggering notify_WohnMedia_status
2016.07.15 18:34:04 4: notify_WohnMedia_status exec {
Log 1, "ReadingsVal ist " . ReadingsVal("WohnMedia","type","") . " " . ReadingsVal("WohnMedia","playStatus","");;;;
if (ReadingsVal("WohnMedia", "type", "") eq "movie"){
    if (ReadingsVal("WohnMedia", "playStatus", "") eq "playing"){
       fhem("set WohnAll off");;;;
    }
    if (ReadingsVal("WohnMedia", "playStatus", "") eq "paused"){
       fhem("set WohnAll on");;;;
    }
   }
}
2016.07.15 18:34:04 5: Cmd: >{
Log 1, "ReadingsVal ist " . ReadingsVal("WohnMedia","type","") . " " . ReadingsVal("WohnMedia","playStatus","");;
if (ReadingsVal("WohnMedia", "type", "") eq "movie"){
    if (ReadingsVal("WohnMedia", "playStatus", "") eq "playing"){
       fhem("set WohnAll off");;
    }
    if (ReadingsVal("WohnMedia", "playStatus", "") eq "paused"){
       fhem("set WohnAll on");;
    }
   }
}<
2016.07.15 18:34:04 1: ReadingsVal ist unknown stopped

Type oben ist noch richtig, movie,    playstatus ist verkehrt.
Weiter unten ist dann type unknown,    playstatus immer noch verkehrt ( der Player laeuft da schon wieder )

Danach stimmt garnichts mehr  :
Beispiel : Druecke wieder Pause , PLayer haelt an .
Ergebnis :

2016.07.15 18:34:04 5: XBMC_Read: Tail:
2016.07.15 18:34:04 5: XBMC_Read: PARTIAL:
2016.07.15 18:34:06 4: XBMC_Check
2016.07.15 18:34:06 4: XBMC_CheckConnection: Connection still alive. Last data from Kodi received 2 s ago
2016.07.15 18:34:06 4: XBMC_Call: Sending: {"id":88,"method":"Application.GetProperties","jsonrpc":"2.0","params":{"properties":["volume","muted","name","version"]}}
2016.07.15 18:34:06 5: SW: 7b226964223a38382c226d6574686f64223a224170706c69636174696f6e2e47657450726f70657274696573222c226a736f6e727063223a22322e30222c22706172616d73223a7b2270726f70657274696573223a5b22766f6c756d65222c226d75746564222c226e616d65222c2276657273696f6e225d7d7d
2016.07.15 18:34:06 4: XBMC_Call: Sending: {"params":{"properties":["skin","fullscreen","stereoscopicmode"]},"jsonrpc":"2.0","id":89,"method":"GUI.GetProperties"}
2016.07.15 18:34:06 5: SW: 7b22706172616d73223a7b2270726f70657274696573223a5b22736b696e222c2266756c6c73637265656e222c2273746572656f73636f7069636d6f6465225d7d2c226a736f6e727063223a22322e30222c226964223a38392c226d6574686f64223a224755492e47657450726f70657274696573227d
2016.07.15 18:34:06 4: XBMC_Call: Sending: {"id":"90","method":"Player.GetActivePlayers","jsonrpc":"2.0"}
2016.07.15 18:34:06 5: SW: 7b226964223a223930222c226d6574686f64223a22506c617965722e476574416374697665506c6179657273222c226a736f6e727063223a22322e30227d
2016.07.15 18:34:06 4: XBMC_UpdatePlayerItem
2016.07.15 18:34:06 4: XBMC_UpdatePlayerItem - cancelled (disconnected or not playing)
2016.07.15 18:34:06 5: XBMC_ProcessRead
2016.07.15 18:34:06 5: No PARTIAL buffer
2016.07.15 18:34:06 5: XBMC_Read: Incoming data: {"id":88,"jsonrpc":"2.0","result":{"muted":false,"name":"Kodi","version":{"major":15,"minor":2,"revision":"02e7013","tag":"stable"},"volume":100}}{"id":89,"jsonrpc":"2.0","result":{"fullscreen":false,"skin":{"id":"skin.confluence","name":"Confluence"},"stereoscopicmode":{"label":"Deaktiviert","mode":"off"}}}{"id":"90","jsonrpc":"2.0","result":[]}
2016.07.15 18:34:06 5: XBMC_Read: Current processing buffer (PARTIAL + incoming data): {"id":88,"jsonrpc":"2.0","result":{"muted":false,"name":"Kodi","version":{"major":15,"minor":2,"revision":"02e7013","tag":"stable"},"volume":100}}{"id":89,"jsonrpc":"2.0","result":{"fullscreen":false,"skin":{"id":"skin.confluence","name":"Confluence"},"stereoscopicmode":{"label":"Deaktiviert","mode":"off"}}}{"id":"90","jsonrpc":"2.0","result":[]}
2016.07.15 18:34:06 4: XBMC_Read: Decoding JSON message. Length: 146 Content: {"id":88,"jsonrpc":"2.0","result":{"muted":false,"name":"Kodi","version":{"major":15,"minor":2,"revision":"02e7013","tag":"stable"},"volume":100}}
2016.07.15 18:34:06 4: XBMC_Read: Decoding JSON message. Length: 163 Content: {"id":89,"jsonrpc":"2.0","result":{"fullscreen":false,"skin":{"id":"skin.confluence","name":"Confluence"},"stereoscopicmode":{"label":"Deaktiviert","mode":"off"}}}
2016.07.15 18:34:06 4: XBMC_Read: Decoding JSON message. Length: 39 Content: {"id":"90","jsonrpc":"2.0","result":[]}
2016.07.15 18:34:06 5: XBMC_Read: Tail:
2016.07.15 18:34:06 5: XBMC_Read: PARTIAL:

Die SW-Eintraege sagen mir nichts, ich finde keine Informationen darueber.
Ich meine aber, sie bedeuten nichts Gutes .....



vbs

Ich weiß jetzt zumindest woher das "unknown" kommt. Das liefert XBMC bei dir auf eine GetActivePlayers-Anfrage (FHEM fragt das 1mal pro Minute an).

2016.07.14 23:11:20 5: XBMC_Read: Current processing buffer (PARTIAL + incoming data): {"id":4477,"jsonrpc":"2.0","result":{"item":{"album":"","artist":[],"file":"smb://10.0.0.93/f/Recordings/2016-07-06_20-56-00_3sat HD (deu)_Janus (5 7) - Krimiserie, Österreich 2013.ts","label":"2016-07-06_20-56-00_3sat HD (deu)_Janus (5 7) - Krimiserie, Österreich 2013.ts","streamdetails":{"audio":[{"channels":2,"codec":"mp2","language":"deu"},{"channels":2,"codec":"mp2","language":"mis"},{"channels":2,"codec":"ac3","language":"deu"},{"channels":2,"codec":"mp2","language":"mul"}],"subtitle":[{"language":""}],"video":[{"aspect":1.7777780294418334961,"codec":"h264","duration":3659,"height":720,"stereomode":"","width":1280}]},"thumbnail":"","title":"","track":-1,"tvshowid":-1,"type":"unknown","year":0}}}

Das 'type' in der OnPause-Nachricht wird meines Wissens nicht ausgewertet, so dass dann der type aus der letzten Nachricht davor gilt. Ist nur die Frage, warum Kodi bei dir unknown liefert. Evtl. wegen der Datei-Endung 'ts'? Hast du noch ein anderes Videoformat, das du mal testen könntest.

Um es besser zu verstehen, müsste ich aber wirklich mal einen kompletten Durchlauf sehen. Ungefähr so: Film starten, 3 Minuten laufen lassen, dann Pause. Am liebsten den XBMC auf verbose 4.

Wolfgang Hochweller

#11
Ok, kein Problem, kann ich morgen machen.
Hier noch eine Beobachtung ( ich habe mir noch keinen Code ansehen koennen ) :
WohnMedia:type in den Readings ist immer 'unknown', andere Readings wie z. B. playStatus aendern sich sofort nach einer Aktivitaet.
Was bei mir den Verdacht weckt, dass zwar die json-Message korrekt ausgewertet wird ( also type = movie ),
aber WohnMedia:type nicht immer konsequent gesetzt wird oder gesetzt bleibt.

Ich kann das noch praezisieren :
Nach 'Play' wird 'movie' erkannt und bleibt erhalten ( daher geht nach 'Play' das Licht aus wie beabsichtigt ),
nach 'Pause' wird 'movie' erkannt , bleibt aber nicht erhalten ( daher geht halt das Licht nicht wieder an )

In diesem Fall waren dazwischen keine anderen Calls von oder nach XBMC.

Vielleicht gut zu wissen : Das ist nur bei type=movie der Fall, bei  type=picture funktioniert es prima.