PLEX - Save the Values of a Sensor in a new Sensor based of a value in the first sensor?


i have the GitHub - custom-components/sensor.plex_recently_added: ▶️ Plex component to feed Upcoming Media Card. installed, that shows me my movies from plex.

the problem is the script shows all Movies that where added, the watched too, but i want only the unwatched Movies. (it makes no sense, to show the watched movies in HA)

in the sensor it gives a value calles “flag” this is the watched/unwatched status of the movie or episode.

for example here the values of the sensor (flag:true == unwatched)

  - title_default: $title
    line1_default: $episode
    line2_default: $release
    line3_default: $number - $rating - $runtime
    line4_default: $genres
    icon: mdi:eye-off
  - airdate: '2022-05-17T18:56:22Z'
    aired: '2022-02-04'
    release: $day, $date $time
    flag: true
    title: Moonfall
    episode: ''
    runtime: 130
    studio: Centropolis Entertainment
    genres: Action, Adventure
    rating: ★ 3.7
    poster: >-
    fanart: >-

and the next entry block (flag:false == watched)

- airdate: '2022-05-13T06:20:10Z'
    aired: '2022-04-22'
    release: $day, $date $time
    flag: false
    title: Die Gangster Gang
    episode: ''
    runtime: 100
    studio: DreamWorks Animation
    genres: Animation, Adventure
    rating: ★ 8.7
    poster: >-
    fanart: >-

is it now possible that i check the sensor value blocks and save all the blocks that have flag:true to a new sensor ?

that i only have than unwatched movies in the new sensor?

its complicated but the author is not anymore active and i try to find a way to get only the unwatched movies.