I've updated the docs at home-assistant.io with sketch examples. Look at the light example.
https://home-assistant.io/components/light.mysensors/#example-sketch
It's what I used for testing during development. It adds an RGB sensor/actuator also besides a dimmer, but you can just remove any references to rgb in the sketch.
The dimmer slider will only be visible after turning on the light and clicking the entity in the gui to bring up the more info card.
After filding around a lot with the MySensor2.0 lib and spending my whole weekend, when I could not get things going I finally switched back to MySensors1.5.4. After that I made quick progress and my node was on network. Here is the link below of a working Dimmer node.
MySensors AC 220v Dimmer with Domoticz – 01:42— S Kumar