I hesitate to point you to my modification because it isn't terribly close to the changes you need but maybe it'll help anyway
I think you'll need to add the other temp readings similar to the one that the Logger is doing correctly for you now. But you'll have to put them inside a test for the specific Shelly device because all the other devices won't have them. I strongly suspect there is a better way because I'm not a HE/groovy programmer.
I think it would be cleaner to use node-red then you could get the Shelly temps with a Device node from HE Nodes for NR and write them to your InfluxDB with the InfluxDB Out node.