Change icon based on state?

hiya, trying to use a tapo plug to detect if my dish washer is on, I want to be able to change the icon to wether the dishwasher is running or not in the dashboard. anyone know how i can do this? i’m trying this from another post but it doesnt work.

graph: none
type: sensor
entity: sensor.dish_washer_current_consumption
state:

  • below: 5
    icon: mdi:dishwasher-off
  • above: 5
    icon: mdi:dishwasher-on