Statistics sensors throw parsing error on every startup

I’ve found this original issue and the PR that is supposed to fix it while googling around why I get the error on every HA startup.

So I’m not sure if it popped back up and I’m supposed to open a new issue or if it’s something in my config or if I’m experiencing something else. The sensors work afterwards, it’s just on startup when presumably the integrations they pull data from aren’t up yet.

2021-12-28 17:37:24 ERROR (MainThread) [homeassistant.components.statistics.sensor] sensor.temp_stats_outside: parsing error, expected number and received None
  - platform: statistics
    entity_id: sensor.ble_temperature_outside
    sampling_size: 1500
    max_age: 24:00:00
    name: temp stats outside
    precision: 1
    state_characteristic: mean

Any insight welcome, thanks!

Hey @C.G.B.Spender,
I’ve implemented that PR. Happy to have a look at this issue.

The sensors work afterwards, it’s just on startup when presumably the integrations they pull data from aren’t up yet.

I’m actually not certain where the issue comes from. Based on a quick check I am not even sure how it is possible. If I were to send you a modified version of the integration, would you be able to provide logging output from it? I would extend verbosity to understand the issue at hand.

@ThomDietrich Sure thing, send away.

Hey, I was able to replicate the behavior. This happens when the python keyword None is converted to string "None" and stored in memory as the value of a sensor. Even though we could catch this in the statistics component, we should instead raise a bug report with the culprit integration. Could you please share which integration is behind sensor.ble_temperature_outside? Thanks!

It is a sensor made by ble monitor which runs on ha in different room and the main ha pulls the sensor from it via remote home assistant

edit: come to think of it, all of the stat sensors are pulled from remote ha, could that be why ?