Your dynamo problem my be causing your headlight problem.
You may not have enough charge in your battery to activate
the dimmer relay.you need to sort your charging problem first.
you can test it with a volt meter.
I replaced the dimmer stalk and relay with a foot operated dip switch,
much more reliable.