Need some help using Plex Webhooks in HA automations

I'm having some trouble understanding how to get my webhooks in Plex to trigger certain automations that affect my media lighting. I have already gotten the web hooks urls created as seen in here: https://i.imgur.com/emlJq6L.png

These seem to work as whenever I play, pause, or stop any media, my lights blip on for a second then immediately shut off again despite what my YAML tells it to do. I must be missing something or misunderstanding an integral part to getting this all set up correctly.

Here's the YAML for my media lights:

# Lights back to full over 7 seconds after media stops
  - alias: 'Media player stopped'
    trigger:
      - platform: webhook
        webhook_id: plex-idle
    condition:
      - condition: time
        after: '17:00:00'
        before: '03:00:00'
    action:
      service: light.turn_on
      data:
        entity_id: group.livingroom
        brightness_pct: '100'
        transition: '7'

# Lights turn off while media is playing
  - alias: 'Media player playing'
    trigger:
      - platform: webhook
        webhook_id: plex-playing
    action:
      service: light.turn_off
      data:
        entity_id: group.livingroom

# Lights dim when media is paused
  - alias: 'Media player paused'
    trigger:
      - platform: webhook
        webhook_id: plex-paused
    condition:
      - condition: time
        after: '17:00:00'
        before: '03:00:00'
    action:
      service: light.turn_on
      data:
        entity_id: group.livingroom
        brightness_pct: '25'
        transition: '4'

# Lights turn off when media is unpaused
  - alias: 'Media player unpaused'
    trigger:
      - platform: webhook
        webhook_id: plex-unpaused
    condition:
      - condition: time
        after: '17:00:00'
        before: '03:00:00'
    action:
      service: light.turn_off
      data:
        entity_id: group.livingroom

# Lights dim to full going from paused to idle
  - alias: 'Media player pause to idle'
    trigger:
      - platform: webhook
        webhook_id: plex-pause-idle
    condition:
      - condition: time
        after: '17:00:00'
        before: '03:00:00'
    action:
      service: light.turn_on
      data:
        entity_id: group.livingroom
        brightness_pct: '100'
        transition: '5'

Posted Dec 16, 2018, 11:08 PM UTC · edited

87
Loading comments…