Varying light brightness bassed on sensor value


I have an integration from my solar inverter that shows the current export power. (sensor.solis_meter_active_power)

I’ve set up an ESP32 with ESP home & connected it to my immersion heater via a solid state relay. (Its running code that thinks its a dimmable light so I can turn the power level of the heater up and down by adjusting the brightness via the dashboard. I’m now wondering how I go about setting up an automation that will monitor sensor.solis_meter_active_power and adjust the brightness on light.relay

Or should I look at something like node red?

From developer tools:

state_class: measurement
unit_of_measurement: W
device_class: power
icon: mdi:transmission-tower
friendly_name: Solis_ Meter Active Power
supported_color_modes: brightness
friendly_name: Test
supported_features: 40