Plex webhook mqtt (data keys not allowed)

Hi there,

I have an automation which has been running fine for a few years now. Until recently. The logs say so as well.

This is my automation:

alias: Plex Webhook
description: ""
mode: single
triggers:
  - webhook_id: plex_webhook
    trigger: webhook
    allowed_methods:
      - POST
      - PUT
    local_only: true
conditions: []
actions:
  - data_template:
      topic: plex/update
      payload_template: >-
        {{ (trigger.data['payload'] | string)[12:][:-2] | replace ("\\\\", "\\")
        | replace ("\\\'", "'") | replace ("\\x","?") }}
    action: mqtt.publish

This is what the logs are telling me:

Logger: homeassistant.components.automation.plex_webhook
Source: components/automation/__init__.py:738
integration: Automation (documentation, issues)
First occurred: 17 February 2025 at 19:30:28 (31 occurrences)
Last logged: 10:33:21

Error while executing automation automation.plex_webhook: extra keys not allowed @ data['payload_template']

Any ideas?

Thanks in advance.

Since in 2025.2.0. payload_template parameter of MQTT publish is depreciated. You must replace it with payload

modify actions: part this way:

actions:
  - data_template:
      topic: plex/update
      payload: >-
        {{ (trigger.data['payload'] | string)[12:][:-2] | replace ("\\\\", "\\")
        | replace ("\\\'", "'") | replace ("\\x","?") }}
    action: mqtt.publish

Cheers! It’s working again.