Hello Chris!
The filename issue is resolved. The problem seems to be something different.
My item has values from 0 to 1, corresponding to 0% to 100%. It seems your item returns not percentages but values from 0 to 100. The formula trying to figure out which icon to pick gets confused by this.
This is my channel configuration for the item:
I could use additional logic for values greater than 1, but this would still leave an ambiguous region from 0 to 1 with potential issues.
Alternatively you can change this line
xlink:href: '=`/icon/fronius_battery${#props.battery_charge < 0 ? "_charging" :
""}-${25 * Math.round(#props.battery_level * 4)}?format=svg&anyFormat=true&iconset=classic`'
to this
xlink:href: '=`/icon/fronius_battery${#props.battery_charge < 0 ? "_charging" :
""}-${25 * Math.round(#props.battery_level * 0.04)}?format=svg&anyFormat=true&iconset=classic`'
Notice the change of the factor from 4 to 0.04.
Regards
Peter