Sure . it may not be the prettiest or most effetive but i got it to work.
[{"id":"a99aca48.636358","type":"switch","z":"4d980637.848cf8","name":"","property":"ps4_media_image.media_content_type","propertyType":"msg","rules":[{"t":"eq","v":"game","vt":"str"},{"t":"eq","v":"app","vt":"str"}],"checkall":"false","repair":false,"outputs":2,"x":690,"y":460,"wires":[["e01ccecc.cd89"],["1197faa3.befed5"]]},{"id":"882d08da.7cd658","type":"ha-entity","z":"4d980637.848cf8","name":"ps4 game 1","server":"9b88cb19.5c8db8","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":""},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":""}],"state":"data_app_game.attributes.media_title","stateType":"msg","attributes":[{"property":"entity_picture","value":"ps4_media_image.media_image_url","valueType":"msg"},{"property":"media_content_id","value":"data_app_game.attributes.media_content_id","valueType":"msg"},{"property":"media_content_type","value":"ps4_media_image.media_content_type","valueType":"msg"},{"property":"media_title","value":"data_app_game.attributes.media_title","valueType":"msg"}],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":1530,"y":80,"wires":[[]]},{"id":"93809f99.8a0b2","type":"ha-entity","z":"4d980637.848cf8","name":"ps4 game 2","server":"9b88cb19.5c8db8","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":""},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":""}],"state":"data_ps4game1.attributes.media_title","stateType":"msg","attributes":[{"property":"entity_picture","value":"data_ps4game1.attributes.entity_picture","valueType":"msg"},{"property":"media_content_id","value":"data_ps4game1.attributes.media_content_id","valueType":"msg"},{"property":"media_content_type","value":"ps4_media_image.media_content_type","valueType":"str"},{"property":"media_title","value":"data_ps4game1.attributes.media_title","valueType":"msg"}],"resend":true,"outputLocation":"data","outputLocationType":"msg","inputOverride":"allow","x":1530,"y":160,"wires":[[]]},{"id":"70b397b9.67f2e8","type":"ha-entity","z":"4d980637.848cf8","name":"ps4 game 3","server":"9b88cb19.5c8db8","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":""},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":""}],"state":"data_ps4game2.attributes.media_title","stateType":"msg","attributes":[{"property":"entity_picture","value":"data_ps4game2.attributes.entity_picture","valueType":"msg"},{"property":"media_content_id","value":"data_ps4game2.attributes.media_content_id","valueType":"msg"},{"property":"media_content_type","value":"ps4_media_image.media_content_type","valueType":"str"},{"property":"media_title","value":"data_ps4game2.attributes.media_title","valueType":"msg"}],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":1530,"y":220,"wires":[[]]},{"id":"939cb4e1.cbfdc8","type":"ha-entity","z":"4d980637.848cf8","name":"ps4 game 4","server":"9b88cb19.5c8db8","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":""},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":""}],"state":"data_ps4game3.attributes.media_title","stateType":"msg","attributes":[{"property":"entity_picture","value":"data_ps4game3.attributes.entity_picture","valueType":"msg"},{"property":"media_content_id","value":"data_ps4game3.attributes.media_content_id","valueType":"msg"},{"property":"media_content_type","value":"ps4_media_image.media_content_type","valueType":"str"},{"property":"media_title","value":"data_ps4game3.attributes.media_title","valueType":"msg"}],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":1530,"y":280,"wires":[[]]},{"id":"b6c3d143.ca2b4","type":"ha-entity","z":"4d980637.848cf8","name":"ps4 app 1","server":"9b88cb19.5c8db8","version":1,"debugenabled":true,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":""},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":""}],"state":"data_app_game.attributes.media_title","stateType":"msg","attributes":[{"property":"entity_picture","value":"ps4_media_image.media_image_url","valueType":"msg"},{"property":"media_content_id","value":"data_app_game.attributes.media_content_id","valueType":"msg"},{"property":"media_content_type","value":"ps4_media_image.media_content_type","valueType":"msg"},{"property":"media_title","value":"data_app_game.attributes.media_title","valueType":"msg"}],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":1540,"y":400,"wires":[[]]},{"id":"6317a610.3948d8","type":"ha-entity","z":"4d980637.848cf8","name":"ps4 app 2","server":"9b88cb19.5c8db8","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":""},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":""}],"state":"data_ps4app1.attributes.media_title","stateType":"msg","attributes":[{"property":"entity_picture","value":"data_ps4app1.attributes.entity_picture","valueType":"msg"},{"property":"media_content_id","value":"data_ps4app1.attributes.media_content_id","valueType":"msg"},{"property":"media_content_type","value":"data_ps4app1.attributes.media_content_type","valueType":"msg"},{"property":"media_title","value":"data_ps4app1.attributes.media_title","valueType":"msg"}],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":1540,"y":480,"wires":[[]]},{"id":"5512c102.38a6b","type":"ha-entity","z":"4d980637.848cf8","name":"ps4 app 3","server":"9b88cb19.5c8db8","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":""},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":""}],"state":"data_ps4app2.attributes.media_title","stateType":"msg","attributes":[{"property":"entity_picture","value":"data_ps4app2.attributes.entity_picture","valueType":"msg"},{"property":"media_content_id","value":"data_ps4app2.attributes.media_content_id","valueType":"msg"},{"property":"media_content_type","value":"data_ps4app2.attributes.media_content_type","valueType":"msg"},{"property":"media_title","value":"data_ps4app2.attributes.media_title","valueType":"msg"}],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":1540,"y":560,"wires":[[]]},{"id":"68848ebd.9b60b","type":"ha-entity","z":"4d980637.848cf8","name":"ps4 app 4","server":"9b88cb19.5c8db8","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":""},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":""}],"state":"data_ps4app3.attributes.media_title","stateType":"msg","attributes":[{"property":"entity_picture","value":"data_ps4app3.attributes.entity_picture","valueType":"msg"},{"property":"media_content_id","value":"data_ps4app3.attributes.media_content_id","valueType":"msg"},{"property":"media_content_type","value":"app","valueType":"str"},{"property":"media_title","value":"data_ps4app3.attributes.media_title","valueType":"msg"}],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":1540,"y":660,"wires":[[]]},{"id":"189368be.a0bc5f","type":"inject","z":"4d980637.848cf8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":100,"y":100,"wires":[["9b9d987.bbddb68"]]},{"id":"1197faa3.befed5","type":"api-current-state","z":"4d980637.848cf8","name":"","server":"9b88cb19.5c8db8","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"sensor.ps4_app_1","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data_ps4app1","override_data":"msg","blockInputOverrides":false,"x":1040,"y":400,"wires":[["98105449.793058"]]},{"id":"98105449.793058","type":"switch","z":"4d980637.848cf8","name":"","property":"data_app_game.attributes.media_content_id","propertyType":"msg","rules":[{"t":"eq","v":"data_ps4app1.attributes.media_content_id","vt":"msg"},{"t":"neq","v":"data_ps4app1.attributes.media_content_id","vt":"msg"}],"checkall":"false","repair":false,"outputs":2,"x":1370,"y":400,"wires":[["b6c3d143.ca2b4"],["b58d7d43.18dd6","b6c3d143.ca2b4"]]},{"id":"b58d7d43.18dd6","type":"api-current-state","z":"4d980637.848cf8","name":"","server":"9b88cb19.5c8db8","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"sensor.ps4_app_2","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data_ps4app2","override_data":"msg","blockInputOverrides":false,"x":1040,"y":480,"wires":[["435fce72.18fe4"]]},{"id":"435fce72.18fe4","type":"switch","z":"4d980637.848cf8","name":"","property":"data_ps4app1.attributes.media_content_id","propertyType":"msg","rules":[{"t":"eq","v":"data_ps4app2.attributes.media_content_id","vt":"msg"},{"t":"neq","v":"data_ps4app2.attributes.media_content_id","vt":"msg"}],"checkall":"false","repair":false,"outputs":2,"x":1370,"y":480,"wires":[[],["6317a610.3948d8","5b86750a.3c984c"]]},{"id":"5b86750a.3c984c","type":"api-current-state","z":"4d980637.848cf8","name":"","server":"9b88cb19.5c8db8","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"sensor.ps4_app_3","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data_ps4app3","override_data":"msg","blockInputOverrides":false,"x":1040,"y":560,"wires":[["4ceb1b16.ced0e4"]]},{"id":"4ceb1b16.ced0e4","type":"switch","z":"4d980637.848cf8","name":"","property":"data_ps4app2.attributes.media_content_id","propertyType":"msg","rules":[{"t":"eq","v":"data_app_game.attributes.media_content_id","vt":"msg"},{"t":"eq","v":"data_ps4app3.attributes.media_content_id","vt":"msg"},{"t":"neq","v":"data_ps4app3.attributes.media_content_id","vt":"msg"}],"checkall":"false","repair":false,"outputs":3,"x":1370,"y":560,"wires":[[],[],["5512c102.38a6b","5152fec1.05591"]]},{"id":"5152fec1.05591","type":"api-current-state","z":"4d980637.848cf8","name":"","server":"9b88cb19.5c8db8","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"sensor.ps4_app_4","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data_ps4app4","override_data":"msg","blockInputOverrides":false,"x":1040,"y":640,"wires":[["31a4caf1.459206"]]},{"id":"31a4caf1.459206","type":"switch","z":"4d980637.848cf8","name":"","property":"data_ps4app3.attributes.media_content_id","propertyType":"msg","rules":[{"t":"eq","v":"data_app_game.attributes.media_content_id","vt":"msg"},{"t":"eq","v":"data_ps4app1.attributes.media_content_id","vt":"msg"},{"t":"eq","v":"data_ps4app4.attributes.media_content_id","vt":"msg"},{"t":"neq","v":"data_ps4app4.attributes.media_content_id","vt":"msg"}],"checkall":"false","repair":false,"outputs":4,"x":1370,"y":640,"wires":[[],[],[],["68848ebd.9b60b"]]},{"id":"e01ccecc.cd89","type":"api-current-state","z":"4d980637.848cf8","name":"","server":"9b88cb19.5c8db8","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"sensor.ps4_game_1","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data_ps4game1","override_data":"msg","blockInputOverrides":false,"x":1100,"y":80,"wires":[["9ea0be65.d70a3"]]},{"id":"9ea0be65.d70a3","type":"switch","z":"4d980637.848cf8","name":"","property":"data_app_game.attributes.media_content_id","propertyType":"msg","rules":[{"t":"eq","v":"data_ps4game1.attributes.media_content_id","vt":"msg"},{"t":"neq","v":"data_ps4game1.attributes.media_content_id","vt":"msg"}],"checkall":"false","repair":false,"outputs":2,"x":1350,"y":80,"wires":[["882d08da.7cd658"],["500f5cfa.1f2f84","882d08da.7cd658"]]},{"id":"500f5cfa.1f2f84","type":"api-current-state","z":"4d980637.848cf8","name":"","server":"9b88cb19.5c8db8","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"sensor.ps4_game_2","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data_ps4game2","override_data":"msg","blockInputOverrides":false,"x":1100,"y":160,"wires":[["7ce4c93e.6a39b8"]]},{"id":"7ce4c93e.6a39b8","type":"switch","z":"4d980637.848cf8","name":"","property":"data_ps4game1.attributes.media_content_id","propertyType":"msg","rules":[{"t":"neq","v":"data_ps4game2.attributes.media_content_id","vt":"msg"},{"t":"eq","v":"data_ps4game2.attributes.media_content_id","vt":"msg"}],"checkall":"false","repair":false,"outputs":2,"x":1350,"y":160,"wires":[["93809f99.8a0b2","c8203612.aedd18"],[]]},{"id":"c8203612.aedd18","type":"api-current-state","z":"4d980637.848cf8","name":"","server":"9b88cb19.5c8db8","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"sensor.ps4_game_3","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data_ps4game3","override_data":"msg","blockInputOverrides":false,"x":1100,"y":220,"wires":[["47adcc65.9c9544"]]},{"id":"47adcc65.9c9544","type":"switch","z":"4d980637.848cf8","name":"","property":"data_ps4game2.attributes.media_content_id","propertyType":"msg","rules":[{"t":"eq","v":"data_app_game.attributes.media_content_id","vt":"msg"},{"t":"eq","v":"data_ps4game3.attributes.media_content_id","vt":"msg"},{"t":"neq","v":"data_ps4game3.attributes.media_content_id","vt":"msg"}],"checkall":"false","repair":false,"outputs":3,"x":1350,"y":220,"wires":[[],[],["70b397b9.67f2e8","dd191948.cb1ca8"]]},{"id":"dd191948.cb1ca8","type":"api-current-state","z":"4d980637.848cf8","name":"","server":"9b88cb19.5c8db8","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"sensor.ps4_game_4","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data_ps4game4","override_data":"msg","blockInputOverrides":false,"x":1100,"y":280,"wires":[["aac51492.ce59c8"]]},{"id":"aac51492.ce59c8","type":"switch","z":"4d980637.848cf8","name":"","property":"data_ps4game3.attributes.media_content_id","propertyType":"msg","rules":[{"t":"eq","v":"data_app_game.attributes.media_content_id","vt":"msg"},{"t":"eq","v":"data_ps4game1.attributes.media_content_id","vt":"msg"},{"t":"eq","v":"data_ps4game4.attributes.media_content_id","vt":"msg"},{"t":"neq","v":"data_ps4game4.attributes.media_content_id","vt":"msg"}],"checkall":"false","repair":false,"outputs":4,"x":1350,"y":300,"wires":[[],[],[],["939cb4e1.cbfdc8"]]},{"id":"24c561b1.25dc3e","type":"poll-state","z":"4d980637.848cf8","name":"","server":"9b88cb19.5c8db8","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"60","updateIntervalUnits":"seconds","outputinitially":false,"outputonchanged":false,"entity_id":"media_player.pandoras_box","state_type":"str","halt_if":"playing","halt_if_type":"str","halt_if_compare":"is","outputs":2,"x":170,"y":40,"wires":[["9b9d987.bbddb68"],[]]},{"id":"9b9d987.bbddb68","type":"bigfile reader","z":"4d980637.848cf8","name":"","filename":"/config/.ps4-games.709E290032B2_9077.json","nopayload":true,"flow":"blocks","highWaterMark":16,"encoding":"utf8","format":"utf8","keepEmptyLines":false,"x":420,"y":120,"wires":[["e7f0d62d.9601b8"],[]]},{"id":"4f37366e.ff97f8","type":"split","z":"4d980637.848cf8","name":"","splt":",*","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":690,"y":200,"wires":[["8e6b764d.cb1928"]]},{"id":"e7f0d62d.9601b8","type":"change","z":"4d980637.848cf8","name":"file custom","rules":[{"t":"change","p":"payload","pt":"msg","from":"},","fromt":"str","to":"}},*{","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":530,"y":200,"wires":[["4f37366e.ff97f8"]]},{"id":"8e6b764d.cb1928","type":"json","z":"4d980637.848cf8","name":"","property":"payload","action":"","pretty":false,"x":410,"y":280,"wires":[["a2522c8.73476d"]]},{"id":"a2522c8.73476d","type":"change","z":"4d980637.848cf8","name":"ps4_media_image","rules":[{"t":"move","p":"payload","pt":"msg","to":"ps4_media_image","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":280,"wires":[["7e4eeaba.ec9e84"]]},{"id":"7e4eeaba.ec9e84","type":"change","z":"4d980637.848cf8","name":"","rules":[{"t":"move","p":"ps4_media_image","pt":"msg","to":"ps4_media_image.orig","tot":"msg"},{"t":"set","p":"ps4_media_image.media_image_id","pt":"msg","to":"(ps4_media_image.orig.($keys()))","tot":"jsonata"},{"t":"set","p":"ps4_media_image.media_image_url","pt":"msg","to":"(ps4_media_image.orig.*.media_image_url)","tot":"jsonata"},{"t":"set","p":"ps4_media_image.media_content_type","pt":"msg","to":"(ps4_media_image.orig.*.media_content_type)","tot":"jsonata"},{"t":"delete","p":"ps4_media_image.orig","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":380,"wires":[["11d2c7bd.8c0b68"]]},{"id":"11d2c7bd.8c0b68","type":"api-current-state","z":"4d980637.848cf8","name":"","server":"9b88cb19.5c8db8","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"media_player.pandoras_box","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data_app_game","override_data":"msg","blockInputOverrides":false,"x":270,"y":460,"wires":[["79c34b4c.954b34"]]},{"id":"79c34b4c.954b34","type":"switch","z":"4d980637.848cf8","name":"","property":"data_app_game.attributes.media_content_id","propertyType":"msg","rules":[{"t":"eq","v":"ps4_media_image.media_image_id","vt":"msg"}],"checkall":"false","repair":false,"outputs":1,"x":550,"y":460,"wires":[["a99aca48.636358"]]},{"id":"9b88cb19.5c8db8","type":"server","z":"","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]
in short it checks the state of the ps4 (here named pandoras_box) every minute or so, then it picks up the info in the ps4 integration data file .ps4-games.json i dom some formatting and moving the payload around then i pick up the state again from the ps4 (you dont get all the info in the scheduled one as you get in the triggered one) then i clean it again, and then splt it based on app or game and start sending the data to populate the first sensor. in this I always update the firts sensor (ex. ps4_app_1), but if the payload and the ps4_app_1 does not match based on media content id it also sends it to the second sensor to trigger an update to copy the old ps4_app_1 data into ps4_app_2. and so on until it it comes to a ps4_app_x that have the same values as the one before (ps4_app_x-1) used to have.
so thats how it works in semi-short.
if you have any improvements let me know.
sincearly
Fredrik