but as soon as I add state_class: "total_increasing" beneath the device_class line, the sensor disappears from Home Assistant (doesn’t show up in developer tools or anything either)
Legacy templates do not support state_class and will not be getting support for it. You should be using the new template integration for new sensors as this is the only one that will receive new features.
The availability template is important for setting the the sensor unavailable when the source sensor is unavailable to prevent weird readings in the energy dashboard.
Generally there is no need to move them unless you are missing a feature you need. There is no indication that support for legacy templates will be dropped. Just makes sure to use the new integration for new sensors.
However, if you only have two you might as well move them to the new integration. It’s up to you.
Thanks. Lastly I’m also creating a similar entity to convert the gas m³ consumption into kWh. On my gas bills there’s a conversion factor of 10.99508 to convert it to kWh (and then I’m billed in kWh units), so that’s what I’m trying to add into the Energy dashboard.
If you ever want to just play around with templates to figure out how stuff works, try doing it in the dev tools section of your home assistant! Instant feedback as to why something is or isnt working!