Thanks seems like already try with states() with same result.
Should this work in sensor.template for value_template? I’m use this for testing template.
Today my microsd in RPi died I will check your variant asap.
The states() function does not return a different result if the state exists. It’s when the state does not exist that it matters. If you use states.x.y.state and there is no state for x.y then this will cause an error. But if you use states('x.y') then if the state doesn’t exist it will not cause an error but rather return ‘unknown’.