History stat sensor not correctly configured

Hello to everyone.
I would like to trace the grid sensor of my teslawall battery. The voltage in my area is not stable and the battery goes on protection when overvoltage (>251 V).

I setupped following the guide about history stat, the sensors are there but the value is always 0.

My setup

The entity history

But this is the history sensor

What am I doing wrong?

Thank you!

Francesco

Update: solved, the state I put in configuration was not the real state but a label. The real state was grid_uncompliant and grid_qualifying

Thanx anyway