Non coder struggling to get the code right - help please

Hi all,

I would like to ask for some help working through a template to update the colour of an icon based on a numerical state.

I have a Shelly1pm behind a power point which controls my pool chlorinator and pump. When the chlorinator is in standby (and thus the pump not running), there is a draw of approx 10w on the sensor.shelly_1pm_pool_pump_energy_power entity. When the chlorantor is active (and the pump running) there is a draw of over 1000w on the same entity.

I have the following template which updates the colour of the icon from blue to red when the pump is running (which works)

state:
  - operator: template
    value: >
      [[[ return states['sensor.shelly_1pm_pool_pump_energy_power'].state > 200
      ]]]
    icon: mdi:hydro-power
    color: rgb(255, 0, 0)

What I would like to do, is capture the use case that the 1pm is OFF and thus not delivering power to the chlorinator. In this case, I would like the use case to be

  1. When sensor.shelly_1pm_pool_pump_energy_powerless than or equal to 1 the icon should be rgb(255, 0, 0)
  2. When sensor.shelly_1pm_pool_pump_energy_powerless than or greater than 1 and less than 200 the icon should be rgb(28, 128, 199)
  3. When sensor.shelly_1pm_pool_pump_energy_powerless than or greater than 200 the icon should be rgb(128, 205, 120).

Happy to give it a go if someone can point me in the right direction, but I have tried and failed miserably, so i also wont complain if someone was to help with providing that part of the code

Thanks in advance