FHEM Forum

FHEM - Anwendungen => Multimedia => Thema gestartet von: pcjogi am 27 Oktober 2020, 06:52:40

Titel: Volumio Steuerung mit HTTPMOD [gelöst]
Beitrag von: pcjogi am 27 Oktober 2020, 06:52:40
Hallo zusammen,

ich habe ein Volumio (volumio.org) auf einem Raspberry laufen. von einer fhem Instanz kann ich per HTTPMOD die Lautstärke regeln. Soweit gut, aber ich möchte auch ein Radiostream starten. Das funktioniert von der Commandozeile mit curl -i --header "Content-Type: application/json" volumio_arbeitszimmer:3000/api/v1/replaceAndPlay --data '{
  "service": "webradio",  "type": "webradio",  "title": "WDR2",
  "uri": "http://wdr-wdr2-rheinland.icecast.wdr.de/wdr/wdr2/rheinland/mp3/128/stream.mp3",
  "albumart": "https://www1.wdr.de/radio/wdr2/wdrzwei-app-logo-102~_v-gseagaleriexl.jpg"
}'


auch mit einem
{qx (curl -i --header "Content-Type: application/json" volumio_arbeitszimmer:3000/api/v1/replaceAndPlay --data '{
  "service": "webradio",  "type": "webradio",  "title": "WDR2",
  "uri": "http://wdr-wdr2-rheinland.icecast.wdr.de/wdr/wdr2/rheinland/mp3/128/stream.mp3",
  "albumart": "https://www1.wdr.de/radio/wdr2/wdrzwei-app-logo-102~_v-gseagaleriexl.jpg"
}')}


aus fhem heraus funktioniert der Radiostream.

Das muss doch auch mit HTTPMOD zu realisieren sein. Mein Versuch mit
attr ARBZ.VOLUMIO.STATUS set02Data '{   "service": "webradio",  "type": "webradio",  "title": "WDR2",   "uri": "http://wdr-wdr2-rheinland.icecast.wdr.de/wdr/wdr2/rheinland/mp3/128/stream.mp3",   "albumart": "https://www1.wdr.de/radio/wdr2/wdrzwei-app-logo-102~_v-gseagaleriexl.jpg" }'
attr ARBZ.VOLUMIO.STATUS set02Header Content-Type: application/json
attr ARBZ.VOLUMIO.STATUS set02Name playurl
attr ARBZ.VOLUMIO.STATUS set02TextArg 1
attr ARBZ.VOLUMIO.STATUS set02URL volumio_arbeitszimmer:3000/api/v1/replaceAndPlay


oder

attr ARBZ.VOLUMIO.STATUS set02Header Content-Type: application/json
attr ARBZ.VOLUMIO.STATUS set02Name playurl
attr ARBZ.VOLUMIO.STATUS set02TextArg 1
attr ARBZ.VOLUMIO.STATUS set02URL volumio_arbeitszimmer:3000/api/v1/replaceAndPlay --data '{   "service": "webradio",  "type": "webradio",  "title": "WDR2",   "uri": "http://wdr-wdr2-rheinland.icecast.wdr.de/wdr/wdr2/rheinland/mp3/128/stream.mp3",   "albumart": "https://www1.wdr.de/radio/wdr2/wdrzwei-app-logo-102~_v-gseagaleriexl.jpg" }'


waren leider nicht erfolgreich. Kann mir jemand auf die Sprünge helfen?

Danke
Titel: Antw:Volumio Steuerung mit HTTPMOD [gelöst]
Beitrag von: pcjogi am 27 Oktober 2020, 07:17:56
Antwort selber gefunden!!

attr ARBZ.VOLUMIO.STATUS set02Data {"service": "webradio",  "type": "webradio",  "title": "WDR2","uri": "http://wdr-wdr2-rheinland.icecast.wdr.de/wdr/wdr2/rheinland/mp3/128/stream.mp3","albumart": "https://www1.wdr.de/radio/wdr2/wdrzwei-app-logo-102~_v-gseagaleriexl.jpg"}
attr ARBZ.VOLUMIO.STATUS set02Header Content-Type: application/json
attr ARBZ.VOLUMIO.STATUS set02Name playurl
attr ARBZ.VOLUMIO.STATUS set02TextArg 1
attr ARBZ.VOLUMIO.STATUS set02URL http://volumio_arbeitszimmer.local:3000/api/v1/replaceAndPlay


funktioniert!!