ECMA Problem with UoM

It’s trite, but “you can’t do that”. That’s to say, you can’t compare 30W with 300 … 300 what? kW? horsepower? mW?
Your Group state, as you point out, has a unit.
Your constant needs to have units as well, or comparison is meaningless.

if (items["Strom_Erzeugung"] > new QuantityType("300 W"))

This works if your Item is in kW, mW,or indeed horsepower.

This is a more future proof approach than extracting the numeric value for a numeric only comparison (which is possible).