Nest hvac_state is always off

I’m trying to use a nest sensor to trigger an automation. It works fine when I set the hvac_state manually in the GUI but when the heater actually turns on the state still says off. Any help is appreciated.