Whenever the output of PVOUTPUT reaches a 1000 kwh, color an icon from red to green

How can i set this up? Here in belgium, whenever my pv array has reached a 1000kwh production I can register for a certificate, worth 350€.

It’s a pv installation at a different location. a server uploads the data to pvoutput.
The data from pvoutput can already be pulled in.

I would like to get a notification in the form of a changing icon color of similar.

Any ideas?

I’m using the button card for this kind of indicator - I have a whole rows of them (in horizontal stack cards) to give me a color status without even having to look at the value itself:

type: custom:button-card
show_entity_picture: true
icon: mdi:home-roof
styles:
  icon:
    - color: |
        [[[
          if (entity.state < 50) return 'white';
          if (entity.state >= 50 && entity.state < 63) return 'blue';
          if (entity.state >= 63 && entity.state < 85) return 'green';
          else return 'red';
        ]]]
entity: sensor.roof_temp
show_state: true
show_label: true
name: Roof
size: 59%

Thnx for the info! However, my data keeps counting up. I need something like with every 1000kwh added, stay green until over 1100kwh… or something in that order…