Issue with rule to automate solar charging of electric car

Alternatively, leave it alone and change what you compare it to. (This will take care of unit conversions too)

if (kostal_solar_power.state > 4 | kW)