Set a default mqtt message on unavailable?

Hi

I have a Nedis Smoke Detector Smoke Sensor (WIFIDS10WT) that I flashed with Tasmota using this configuration:

It works well when triggered, but it will always stay in last state until next fire/test, which again will write states that will stay until next time…
What I would like to happen is to have it return to a default value when the device goes offline (becomes unavailable)

I tried using expire_after in the rule like:

  ON system#boot do publish2 homeassistant/binary_sensor/%macaddr%_test/config {"name":"Fire Alarm Test","expire_after":10,"state_topic":"stat/%topic%/TEST","icon":"mdi:bell-alert","unique_id":"%macaddr%_test","device":{"connections":[["mac","%macaddr%"]]}} ENDON

Which will make the topic reset to “unavailable” after 10 seconds.
How can I change this “unavailable” to a default state like “off”?

I’ve tried to play around with payload_not_available like this, but we no success.

  ON system#boot do publish2 homeassistant/binary_sensor/%macaddr%_test/config {"name":"Fire Alarm Test","expire_after":10,"payload_not_available":"OFF","state_topic":"stat/%topic%/TEST","icon":"mdi:bell-alert","unique_id":"%macaddr%_test","device":{"connections":[["mac","%macaddr%"]]}} ENDON

If I would have looked at the correct page, I would have seen that this is the command I was looking for:

off_delay

Final configuration

Rule2
  ON system#boot do publish2 homeassistant/binary_sensor/%macaddr%_fire/config {"name":"Fire Alarm","off_delay":"300","state_topic":"stat/%topic%/FIRE","device_class":"smoke","unique_id":"%macaddr%_fire","device":{"connections":[["mac","%macaddr%"]]}} ENDON
  ON system#boot do publish2 homeassistant/binary_sensor/%macaddr%_test/config {"name":"Fire Alarm Test","off_delay":"300","state_topic":"stat/%topic%/TEST","icon":"mdi:bell-alert","unique_id":"%macaddr%_test","device":{"connections":[["mac","%macaddr%"]]}} ENDON
  ON system#boot do publish2 homeassistant/binary_sensor/%macaddr%_mute/config {"name":"Fire Alarm Mute","off_delay":"300","state_topic":"stat/%topic%/MUTE","icon":"mdi:bell-sleep","unique_id":"%macaddr%_mute","device":{"connections":[["mac","%macaddr%"]]}} ENDON
  ON system#boot do publish2 homeassistant/binary_sensor/%macaddr%_battery/config {"name":"Fire Alarm Battery","state_topic":"stat/%topic%/BATTERY","device_class":"battery","unique_id":"%macaddr%_battery","device":{"connections":[["mac","%macaddr%"]]}} ENDON