I’m seeing this error in my logs from time to time, but have not been able to associate it with any specific automations. I feel like I’ve looked at the handful of OR conditions I have set up and nothing is jumping out at me.
Error during or-condition: unsupported operand type(s) for -: 'NoneType' and 'float'
Can anyone give me any suggestions as the best way to find where this may be coming from?
if you use a decent text editor (Notepad++, etc) you can tell it to search all files in a directory for ‘float’. That’s the way I found a bunch of vague errors.
None types don’t support operators. So this is most likely an addition, subtraction, multiply, or divide between 2 things. I’m guessing the ‘float’ potion would be a hard-coded number. So… look for something like this:
{{ state_attr('x.x','x') + 4.0 }}
Reason I say state_attr, is because state_attr returns None. states() does not, it returns ‘unknown’, which is a string. And the error in that case would say ‘str’ and ‘float’.
EDIT. Also, look and see if you are using the last_triggered attribute. That one returns None if nothing has been triggered since restart.
This could also be a new bug that cropped up… I’m seeing these errors too but I don’t really have any templates… Let alone any automations. All my stuff is in appdaemon.
EDIT: Nevermind those errors are from when I was playing around in the template editor. Maybe yours are from there too?
Thanks for the tips. I do have a few automatons that don’t run too often, but they do use the last triggered attribute. So, I guess my question would be, other than the occasional error in the logs the 1st time the automation attempts to run, is this an issue. I guess a better question would be, will the automaiton run, throw an error, and then continue to run without error.