Message not being retained in Mosquito

I have a pool control that controls the pump timer and heat. This is done with tasmota. I can set the target temperature from my HA dashboard. I have 3 temp settings, one is the desired temperature, one is a max temperature and one is setback temp. The idea of the max temperature is that so if someone (renters) sets the target too high, it will simply override the input and set it to the max. The setback temp sets the target back do a lower temp at 2am (turns the heat down so it isnt running full blast all night.
Each of these are stored in mem1, mem2 and mem3 respectively.
I have rules set using
ON mem1#state DO publish2 poolcontrol/mem1 %mem1% ENDON
ON mem2#state DO publish2 poolcontrol/mem2 %mem2% ENDON
On mem3#state DO publish2 poolcontrol/mem3 %mem3% ENDON

For some reason, mem1 is not being retained.

See info from mqtt below

I am aware that using mem instead of var has its issues but im still confused why it will not retain mem1. Also, the console in tasmota publishes the message and then says (retained). If i reboot the tasmota, i was under the impression that any thing stored in mem1, mem2, mem3 would reamin there after a reboot. This is not happeneing for mem1, only mem2 and mem3.

Message 7 received on poolcontrol/mem3 at 3:44 PM:

80

QoS: 0 - Retain: true

Message 6 received on poolcontrol/mem2 at 3:44 PM:

88

QoS: 0 - Retain: true

Message 5 received on poolcontrol/mem1 at 3:43 PM:

85

QoS: 0 - Retain: false

Retain means it tells the MQTT broker to retain the value. Mem is memory and always volatile. You probably have to get the MQTT value from the broker if you need it in the tasmota 'script'.

It is the mosquito broker that needs to see the retain but, so check the broker values with MQTT explorer.

Asking these questions as you probably wrote these down when you planned your project, before you even touched any code, after you had read the relevant documentation for MQTT, Tasmota and HomeAssistant.

Are you setting the target values in Tasmota or HomeAssistant?
Where is this being stored? What variable name?
Is the data flow for the settings one way or two way? Using MQTT?
Are you using different entities for the targets and actual values being reported (ie: one is not overwriting the other)? What is the variable name for the measured temperature, the actual temperature sensor output?
As Wally suggested, MQTT Explorer should show you what is happening behind the scenes.

Alarmed if your renters have access to either Tasmota or HomeAssistant for changing the settings, especially if they get bored and wish to explore changing other settings in your setup, just for the lulz. I strongly recommend you regularly make backups of all your settings, both Tasmota and HomeAssistant, so you can revert to a known working state in the future should somebody ‘accidentally’ trash your settings. You may also wish to restore the config after every rental is over, on the basis it may have been tampered with in ways you may not notice immediately.