Weird behavior of Dimmer in combination with a Generic MQTT Thing

You might find this discussion illuminates your difficulty.

A Dimmer Item has a percent type state / command, which is not just a number.