Hi Guys

,
I've been thinking about this issue for a while now and came here for your guided assistance haha.
Situation:
Ik have 6 heater mats spec'd at 12 volt. I need to power them with either a 12 or 24 volt battery. When powering them with a 12 volt battery I simply put all the heater mats in parallel.
(see image: "knipsel1")
When powering the heater mats with a 24 volt battery I configure it as 2x 3 mats in parallel. (see image: "knipsel2")
The problem rises when I've physically placed the heater mats. I cannot change the placement nor connections of the heater mats on the PCB after physically placing them. However the input voltage can and will continuously change and be EITHER 12 or 24 volt.
Question: How can I wire the heater mats so that it works with 12 and 24 batteries? Is there a way to automatically make the switch? maybe an IC?
I came with this solution but I feel asif there are way smarter solutions: in this solution the cpu turns on/off mosfet's to create parallel and series configurations. (see image: "knipsel3")
As always,
Thanks amazing community!