you’re getting a string from your dimmer item. Then your operations are done on strings and returned as strings which causes the error.
If you use OH4 then you have the number-block under “math” to convert to a number.
Btw: OH4 has huge improvements for blockly-users that make it so much easier an fun. So in case you haven’t upgraded yet that’s the time…
Btw @stefan.hoehn (sorry to ping you, but you’re the wizard): Why does getState from a dimmer-item return a string and not a number? A dimmer is always a number, isn’t it. The same from a number-item works without conversion.
In OH3 you had to multiply your variable by 1 to turn a string into a number.
IMHO this is because Strings often return Units with the value like 1000 K(elvin) which results into a String. As Udo has mentioned, just use the numeric state instead.