Using gpio for pwm dimming

I have a project on my cottage. Planing to use solar power 12V (only). Using a Raspberry PI 3B with Home Assistant. My plan is to make it as “simple” as possible. Using GPIO on the PI. Both for PWM output and pushbuttons as input. The basic light functions wired. The problem is: How do I make this work? I have tried to do this in NodeRed, but I have entity issue. I have tried a Velleman VMA107. This is dimming fine in dashboard, but unstable, and no pushbutton for dimming. Thats part of the reason I want a wired solution for this project. Also to use as little as possible power when the cottage is not in use.
Can I code it directly in configuration.yaml or do I have to use NodeRed? Struggleing with the basics here I think, so keep the answers “basic” :slight_smile:

For PWM pigpio Daemon PWM LED - Home Assistant, and for gpio generally Raspberry Pi GPIO - Home Assistant