MQTT doorsensor with equal code for open and close

Hi guys,

I have some doorsensors that only send out one code for open as also for close.
is there a way i can toggle it but within the mqtt code

- platform: mqtt
  name: "zolderraam"
  state_topic: "tele/rfbridge/RESULT"
  value_template: '{{value_json.RfReceived.Data}}'
  payload_on: "0FCDF6"
  device_class: door

Maybe something like payload_off i.e.?