@skokarl
Hallo.
Ich habe mir dazu zunächst im IoBroker ein Objekt angelegt in meinem Fall 0_userdata.0.MusikAutomation.NächsterTitel.
Die Daten kommen aus der Web Api von Sonos.
Ich nutze dazu Node Red mit folgenden Script, du musst noch Deine IP gegen die IP deines Web API Servers tauschen, dann sollte es funktionieren
[
{
"id": "19d01c6e.0b36e4",
"type": "http request",
"z": "3e000d0a.d4ce52",
"name": "Status",
"method": "GET",
"ret": "obj",
"paytoqs": "ignore",
"url": "http://*DeineIP*:5005/Move/state",
"tls": "",
"persist": false,
"proxy": "",
"authType": "",
"x": 330,
"y": 540,
"wires": [
[
"853737ae.8efd68"
]
]
},
{
"id": "4bed189b.f29b98",
"type": "ioBroker in",
"z": "3e000d0a.d4ce52",
"name": "Titel",
"topic": "0_userdata.0.MusikAutomation.Titel",
"payloadType": "value",
"onlyack": "",
"func": "rbe",
"gap": "",
"fireOnStart": "false",
"x": 70,
"y": 540,
"wires": [
[
"19d01c6e.0b36e4"
]
]
},
{
"id": "853737ae.8efd68",
"type": "function",
"z": "3e000d0a.d4ce52",
"name": "Nächster Titel Suchen",
"func": "var D1 = {payload: msg.payload.nextTrack.title};\nreturn [D1];",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 620,
"y": 540,
"wires": [
[
"a520aed8.50aca"
]
]
},
{
"id": "a520aed8.50aca",
"type": "ioBroker out",
"z": "3e000d0a.d4ce52",
"name": "",
"topic": "0_userdata.0.MusikAutomation.NächsterTitel",
"ack": "true",
"autoCreate": "false",
"stateName": "",
"role": "",
"payloadType": "",
"readonly": "",
"stateUnit": "",
"stateMin": "",
"stateMax": "",
"x": 950,
"y": 540,
"wires": []
}
]
Gruß
Mario