Dehumidifier Status from Power Sensor

Hello everyone,
I have a dehumidifier that is connected to an S31 flashed with ESPHome. I would like to have a sensor in Home Assistant show Running/Fan/Standby based on the power sensor on the S31.

EDIT: I got this working.

  - platform: cse7766
      name: "power"
      accuracy_decimals: 1
      id: power

  - platform: template
    name: "Dehumidifier Status"
    id: dehumidifier_status
    lambda: |-
      if (id(power).state > 100.0) 
        {return {"Running"};}
      else if (id(power).state >= 76.9) 
        {return {"Fan High"};}
      else if (id(power).state > 60.0) 
        {return {"Fan Low"};}
      else if (id(power).state < 4.0) 
        {return {"Standby"};}
      else {
        return {"invalid"};}
     update_interval: 60s