Automation keeps resetting input_select

I have an automation that for some reason keeps resetting an input_select to a certain selection instead of retaining the old value. I have the recorder component enabled and there is no initial value.

Would someone mind looking at it to see if anything looks off?

https://www.hastebin.com/dejidadefi.bash

After restarting HA or the automation, it always returns to ‘88’ instead of what was there before.

What’s funny though is if I delete this —> {%- elif trigger.payload == “11” -%} 88…if works perfectly.

I’ve looked over the logs and nothing jumps out at me…

Found my problem…the MQTT topic was set to retain=false…