Trying to turn lights off when something is true but not working

Hello everyone

I have a backyard deko light that is nice to look at but to bright in the bedroom when we try to sleep.
So the best way to actually teigger that we are in bed is when the kodi machine is turned off and it is also past 8 pm.
Now i tried to script that into an automation and it does not work at all.
Wod be nice if someone could look and help me to understand my mistake.

id: ‘1679487388123’
alias: Switch_BackyardOffForSleeping
description: ‘’

  • platform: device
    device_id: 499bb940686da3864d834e9c28a3dd54
    domain: media_player
    entity_id: e34927000d0356fef4b3898d27a1944d
    type: turned_off
    hours: 0
    minutes: 5
    seconds: 0
  • condition: and
    • condition: time
      after: ‘20:00:00’
  • type: turn_off
    device_id: 44e8ab1a4c1a83ef2e33972e654d2f67
    entity_id: d5856b78cc532db888867262601cdd52
    domain: switch
    mode: single

Use backticks ``` not quotes ‘’’ to format your post.

Sorry, my fault, but i did not check since it normally reminds when wrong to fix code. Which it did not this time.
Trying to better myself