I am not getting errors now with the updated function. I think it might be throwing a error when the player is on standby, as then there is no playback state.
This is a sample of the xml when the player is on standby
<?xml version="1.0" ?>
<command_result>
<param name="protocol_version" value="6"/>
<param name="phv_md5" value="D41D8CD98F00B204E9800998ECF8427E"/>
<param name="android_app_active" value="0"/>
<param name="android_md5" value="8607D73529871E25EB08F15E8B88BDF8"/>
<param name="player_state" value="navigator"/>
<param name="playback_volume" value="80"/>
<param name="playback_mute" value="0"/>
<param name="md5" value="F4BEE7914810BB1A60A53F349AFC8076"/>
<param name="product_id" value="tv188b"/>
<param name="serial_number" value="***"/>
<param name="firmware_version" value="250622_1149_r22"/>
<param name="commercial_serial_number" value="***"/>
<param name="app_version" value="1.0.1-13-250622_1149"/>
<param name="product_name" value="Pro 8K Plus"/>
</command_result>
This is one when playing
<param name="protocol_version" value="6"/>
<param name="phv_md5" value="D41D8CD98F00B204E9800998ECF8427E"/>
<param name="android_app_active" value="0"/>
<param name="android_md5" value="8607D73529871E25EB08F15E8B88BDF8"/>
<param name="player_state" value="file_playback"/>
<param name="playback_state" value="playing"/>
<param name="previous_playback_state" value="buffering"/>
<param name="last_playback_event" value="no_event"/>
<param name="playback_url" value="/tmp/mnt/smb/2/Videos/Unbroken (2014)/Unbroken-(2014)-1080p-Atmos-8bit.mkv"/>
<param name="playback_speed" value="256"/>
<param name="playback_duration" value="8248"/>
<param name="playback_position" value="497"/>
<param name="playback_position_version" value="134"/>
<param name="playback_repeat" value="0"/>
<param name="playback_shuffle" value="0"/>
<param name="playback_current_bitrate" value="28061000"/>
<param name="playback_is_buffering" value="0"/>
<param name="playback_volume" value="80"/>
<param name="playback_mute" value="0"/>
<param name="playback_video_width" value="1920"/>
<param name="playback_video_height" value="1080"/>
<param name="audio_track" value="0"/>
<param name="subtitles_track" value="-1"/>
<param name="playback_window_fullscreen" value="0"/>
<param name="playback_window_rect_x" value="0"/>
<param name="playback_window_rect_y" value="0"/>
<param name="playback_window_rect_width" value="0"/>
<param name="playback_window_rect_height" value="0"/>
<param name="playback_clip_rect_x" value="0"/>
<param name="playback_clip_rect_y" value="0"/>
<param name="playback_clip_rect_width" value="0"/>
<param name="playback_clip_rect_height" value="0"/>
<param name="playback_video_source_rect_x" value="0"/>
<param name="playback_video_source_rect_y" value="0"/>
<param name="playback_video_source_rect_width" value="0"/>
<param name="playback_video_source_rect_height" value="0"/>
<param name="osd_width" value="0"/>
<param name="osd_height" value="0"/>
<param name="video_enabled" value="0"/>
<param name="video_on_top" value="0"/>
<param name="video_zoom" value="normal"/>
<param name="is_video" value="1"/>
<param name="pause_is_available" value="0"/>
<param name="teletext_available" value="0"/>
<param name="teletext_enabled" value="0"/>
<param name="teletext_mix_mode" value="0"/>
<param name="teletext_page_number" value="0"/>
<param name="scrambling_detected" value="0"/>
<param name="hangup_watchdog_activations" value="0"/>
<param name="hls_first_sequence" value="0"/>
<param name="segment_length" value="0"/>
<param name="item_id" value="0"/>
<param name="audio_track.0.lang" value="eng"/>
<param name="audio_track.0.pid" value="1"/>
<param name="audio_track.0.codec" value="TrueHD"/>
<param name="audio_track.0.type" value="normal"/>
<param name="subtitles_track.0.lang" value="eng"/>
<param name="subtitles_track.0.pid" value="2"/>
<param name="subtitles_track.0.codec" value="PGS"/>
<param name="subtitles_track.0.type" value="normal"/>
<param name="subtitles_track.0.offset_ms" value="0"/>
<param name="subtitles_track.1.lang" value="fre"/>
<param name="subtitles_track.1.pid" value="3"/>
<param name="subtitles_track.1.codec" value="PGS"/>
<param name="subtitles_track.1.type" value="normal"/>
<param name="subtitles_track.1.offset_ms" value="0"/>
<param name="pltv_enabled" value="0"/>
<param name="playback_caption" value="Unbroken (1 of 20)"/>
<param name="playback_extra_caption" value="Chapter 01"/>
<param name="md5" value="9E41BD80B32849C6E536C5A3A65D4A8F"/>
<param name="product_id" value="tv188b"/>
<param name="serial_number" value="***"/>
<param name="firmware_version" value="250622_1149_r22"/>
<param name="commercial_serial_number" value="***"/>
<param name="app_version" value="1.0.1-13-250622_1149"/>
<param name="product_name" value="Pro 8K Plus"/>
This is my current flow. The change node for the player state and following nodes should really be processed in the function node too, but not sure yet of how to do that
[
{
"id": "0ef1f12f95a3d503",
"type": "http request",
"z": "51ebdd733328bee0",
"name": "",
"method": "GET",
"ret": "txt",
"paytoqs": "ignore",
"url": "http://192.168.0.177/cgi-bin/do?cmd=status",
"tls": "",
"persist": false,
"proxy": "",
"insecureHTTPParser": false,
"authType": "",
"senderr": false,
"headers": [],
"x": 270,
"y": 4000,
"wires": [
[
"e873c1cbc9d093f5"
]
]
},
{
"id": "8a1213070c83837a",
"type": "inject",
"z": "51ebdd733328bee0",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 100,
"y": 4000,
"wires": [
[
"0ef1f12f95a3d503"
]
]
},
{
"id": "63813081fdd613b9",
"type": "debug",
"z": "51ebdd733328bee0",
"name": "debug 180",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 890,
"y": 4000,
"wires": []
},
{
"id": "e873c1cbc9d093f5",
"type": "xml",
"z": "51ebdd733328bee0",
"name": "",
"property": "payload",
"attr": "",
"chr": "",
"x": 430,
"y": 4000,
"wires": [
[
"d4e24881c6f41e4a"
]
]
},
{
"id": "d4e24881c6f41e4a",
"type": "function",
"z": "51ebdd733328bee0",
"name": "function 33",
"func": "let params = msg.payload.command_result.param;\n\n// Find player_state and playback_state objects safely\nlet playerStateObj = params.find(p => p.$ && p.$.name === \"player_state\");\nlet playbackStateObj = params.find(p => p.$ && p.$.name === \"playback_state\");\n\n// Extract values safely\nlet playerState = playerStateObj?.$?.value || \"unknown\";\nlet playbackState = playbackStateObj?.$?.value || \"unknown\";\n\nvar msg1 = { payload: { status: playerState } };\nvar msg2 = { payload: { status: playbackState } };\n\nreturn [msg1, msg2];\n",
"outputs": 2,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 190,
"y": 4200,
"wires": [
[
"63813081fdd613b9",
"9e084cb49ada6936",
"af5cc1acf96817f0"
],
[
"701b0538133c89d3"
]
]
},
{
"id": "9e084cb49ada6936",
"type": "change",
"z": "51ebdd733328bee0",
"name": "update Dune Player State",
"rules": [
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "update",
"tot": "str"
},
{
"t": "set",
"p": "payload.value",
"pt": "msg",
"to": "payload.value",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 230,
"y": 4100,
"wires": [
[]
]
},
{
"id": "4596367cf960dbef",
"type": "hs-device",
"z": "51ebdd733328bee0",
"name": "AV Lounge Dune Player State",
"device": "4461",
"server": "e2626888dadf1c4f",
"feature": 0,
"reportonstartup": false,
"x": 850,
"y": 4200,
"wires": [
[]
]
},
{
"id": "701b0538133c89d3",
"type": "change",
"z": "51ebdd733328bee0",
"name": "update Dune Playback State",
"rules": [
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "update",
"tot": "str"
},
{
"t": "set",
"p": "payload.value",
"pt": "msg",
"to": "payload.value",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 240,
"y": 4320,
"wires": [
[
"cef5da6143b81564"
]
]
},
{
"id": "cef5da6143b81564",
"type": "hs-device",
"z": "51ebdd733328bee0",
"name": "AV Lounge Dune Playback State",
"device": "4459",
"server": "e2626888dadf1c4f",
"feature": 0,
"reportonstartup": false,
"x": 550,
"y": 4320,
"wires": [
[]
]
},
{
"id": "c069fe5f0c2da476",
"type": "debug",
"z": "51ebdd733328bee0",
"name": "debug 182",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 890,
"y": 4040,
"wires": []
},
{
"id": "af5cc1acf96817f0",
"type": "switch",
"z": "51ebdd733328bee0",
"name": "",
"property": "payload.status",
"propertyType": "msg",
"rules": [
{
"t": "cont",
"v": "standby",
"vt": "str"
},
{
"t": "cont",
"v": "navigator",
"vt": "str"
},
{
"t": "cont",
"v": "file_playback",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 3,
"x": 430,
"y": 4180,
"wires": [
[
"1d9791817b0b3d3a"
],
[
"e8cac50b776cbef1"
],
[
"c34cb02cf6c4a18f"
]
]
},
{
"id": "1d9791817b0b3d3a",
"type": "change",
"z": "51ebdd733328bee0",
"name": "Standby",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "{\"value\":\"0\"}",
"tot": "json"
},
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "control",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 600,
"y": 4160,
"wires": [
[
"4596367cf960dbef",
"c069fe5f0c2da476"
]
]
},
{
"id": "e8cac50b776cbef1",
"type": "change",
"z": "51ebdd733328bee0",
"name": "Navigator",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "{\"value\":\"1\"}",
"tot": "json"
},
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "control",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 600,
"y": 4200,
"wires": [
[
"4596367cf960dbef"
]
]
},
{
"id": "c34cb02cf6c4a18f",
"type": "change",
"z": "51ebdd733328bee0",
"name": "File playback",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "{\"value\":\"2\"}",
"tot": "json"
},
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "control",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 610,
"y": 4240,
"wires": [
[
"4596367cf960dbef"
]
]
},
{
"id": "e2626888dadf1c4f",
"type": "hs-server",
"name": "new HS4",
"host": "192.168.0.7",
"port": "81"
}
]