Automation Help

I need some help with creating my automation scheme. Below is the Automation section of my configuration.yaml file I use. Automation 1 works just fine; when kodi is paused/stopped the table light comes on. Automation 2 does not work, when kodi resumes from a paused state the light does not go off and a notification is not sent (notification was built in just to see if the turn light off service was the issue), I also commented out other conditions to eliminate possible error locations. I have played with this couple lines of code for multiple hours and can’t get it to work…what am I missing?

[code]automation:

  • alias: “Kodi Pause @ Night”
    trigger:
    platform: state
    entity_id: media_player.kodi_sheild
    from: ‘playing’
    condition:
    #- platform: state

    entity_id: sun.sun

    state: ‘below_horizon’

    • platform: state
      entity_id: light.table_light
      state: ‘off’
    • platform: state
      entity_id: light.Kitchen_Light
      state: ‘off’
      action:
      service: light.turn_on
      entity_id: light.table_light

automation 2:

  • alias: “Kodi Resume @ Night”
    trigger:
    platform: state
    entity_id: media_player.kodi_sheild
    from: paused
    condition:
    • platform: state
      entity_id: light.table_light
      state: on
      #- platform: state

    entity_id: light.Kitchen_Light

    #state: 'off'
    
    #- platform: state

    entity_id: light.art_light

    #state: 'on'
    
    #- platform: state

    entity_id: light.bobo_light

    state: ‘on’

    action:
    • service: light.turn_off
      entity_id: light.table_light
    • service: notify.Pushover
      data:
      message: “lights turned on.”[/code]

new at this but dont you need to put “paused” in single quotes?

I deleted the whole automation block and started over. When I re-wrote it and tested it it worked!!! Her is the link to the working automation block.

–> http://hastebin.com/norejokojo.sm

I think the biggest diffenece in the two is that for the trigger I moved away from

entity_id: media_player.kodi_sheild from: 'paused'

to

entity_id: media_player.kodi_sheild state: 'playing'

Not sure if this is why but is working now.