Sensor filter time simple moving average croaks on string value

I’m trying to use a time simple moving average filter on a temperature sensor. The filter fails with the following in the log: Could not convert state: 19.0 (<class ‘str’>) to number.

My understanding is a state is always a string and I would imagine the input to the filter is always a number. How do I fix this? Is it a bug with simple moving average filter?

I think I’ve resolved this. The state string had trailing null character which was preventing float conversion.

1 Like