It would appear that the error message is not referring to string vs number issue. It’s complaining about attempting to get the attribute state from something it can’t find (None).
Please post the automation in question as well as the configuration of the sensors it uses.