I now managed to build a reproducible setup for this problem.
I created a completely blank Home Assistant install with basically nothing but the MQTT and Tasmota integration. I then published the same messages the Tasmota device published to the MQTT broker and the last_changed
field keeps changing when I publish to the tasmota/tele/hallway_door_phone/SENSOR
topic.
If anyone wants to try this, here is the K8s manifest of this setup (somewhat specific to my cluster, but you can see all the settings I used):
Messages
tasmota/discovery/AAAAAAAAAAAA/config [retained]
{"ip":"192.0.2.1","dn":"Door Phone","fn":["Door Phone Opener",null,null,null,null,null,null,null],"hn":"hallway-door-phone-5383","mac":"AAAAAAAAAAAA","md":"Generic","ty":0,"if":0,"ofln":"Offline","onln":"Online","state":["OFF","ON","TOGGLE","HOLD"],"sw":"11.1.0","t":"hallway_door_phone","ft":"tasmota/%prefix%/%topic%/","tp":["cmnd","stat","tele"],"rl":[1,0,0,0,0,0,0,0],"swc":[-1,2,-1,-1,-1,-1,-1,-1],"swn":[null,"Switch2",null,null,null,null,null,null],"btn":[0,0,0,0,0,0,0,0],"so":{"4":0,"11":0,"13":0,"17":1,"20":0,"30":0,"68":0,"73":0,"82":0,"114":1,"117":0},"lk":0,"lt_st":0,"sho":[0,0,0,0],"ver":1}
tasmota/discovery/AAAAAAAAAAAA/sensors [retained]
{"sn":{"Time":"1970-01-01T00:00:23.614","Switch2":"OFF"},"ver":1}
tasmota/tele/hallway_door_phone/LWT [retained]
Online
tasmota/tele/hallway_door_phone/STATE
{"Time":"1970-01-01T13:36:06.915","Uptime":"0T13:35:18","UptimeSec":48918,"Heap":26,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"POWER":"OFF","Wifi":{"AP":1,"SSId":"IoT","BSSId":"BB:BB:BB:BB:BB:BB","Channel":1,"Mode":"11n","RSSI":100,"Signal":-50,"LinkCount":1,"Downtime":"0T00:00:09"}}
tasmota/tele/hallway_door_phone/SENSOR
{"Time":"1970-01-01T13:36:06.927","Switch2":"OFF"}