Mqtt binary sensor with more than one off payload

I’m monitoring a second pi mqtt client that has a bunch of alarm GPIO sensors with this binary sensor:

- platform: mqtt
  state_topic: "hassio_slave/status"
  name: "Hassio MQTT Slave Status"
  payload_on: 'online'
  payload_off: 'dead'
  qos: 0
  device_class: connectivity

Trouble is that the payload_off could also be offline. Is there a way to check for either of the off payloads?

One idea is to setup an mqtt sensor (not binary sensor) that would be in the three possible states you mentioned. Then create a binary sensor with a value_template: