Please format code correctly for the forum: see here.
Please post the correctly-formatted code for your automation and explain what happens versus what you want to happen.
If you’re using a Numeric State trigger, that only triggers when the value crosses the threshold from below the value to above it.
To get a battery class sensor when the file sensor doesn’t accept device_class, you’ll have to duplicate it with a template sensor. You can create this in the UI under Helpers. Use a state template of:
{{ states('sensor.soc') }}