Temperature measurement is not a problem. It doesn't need optimistic mode.
I have my DIY nodes that control heating in rooms (radiators). They are battery devices. Every 5 minutes they wake up to check if the switch (S_BINARY) is turned on or not. This switch requires optimistic mode.
I did as you advised. I deleted Mysensors in gui. I added the configuration in configuration.yaml. After rebooting HA still does not optimistic work. There is an entry in the log: 'optimistic option for mysensors is deprecated. Please remove optimistic from your configuration file '.
I'm afraid Home Assistant has killed the ability to use battery-operated MySensors devices.