The first Widget is able to change the brightness, but does not show the state.
The second Widget does show the percentage state, but it’s not possible to change the brightness.
openhab.log:
23:21:34.361 [WARN ] [.rest.core.internal.item.ItemResource] - Received HTTP POST request at 'items/MyDimmer' with an invalid status value '33 %%'.
Sorry, forgot to mention… Slider instead of Default has no effect (I think Default internally does a link to Slider if using a Dimmer item)
EDIT: But I found the solution: Don’t set the dimension but use
Slider item=MyDimmer label="My dimmer [%d]"
This will cause openHAB to write the number, and as Sliders are of type percentType, the Dimension % will be added… (However, this will not work with Default Widget)