Hi. you should post your code as YAML - see the sticky at the top of the forum. What is the actual name of your sensor? I suspect you dont need the .state for it to work.
Try adding your sensor value in the Developer Tools → Template section to get instant feedback on your syntax.
That was a copy and paste of the YAML, but I see something weird happened between the editor in the HA Android app and the Chrome editor for this forum.