tasker to turn on do not disturb when plugged into charger
It doesn't work because you designed the action not to do anything but let Android disturb you, as usual. Here's what each entry corresponds to under Audio &rarr; Do Not Disturb:


None: silences all sounds, including alarms - Total Silence
Priority: silences sounds except for certain calls or notifications - Priority Only
All: this effectively ends Do Not Disturb mode
Alarms: silences all ringtones &amp; vibrations except alarms - Alarms Only


(Content partially derived from the article: Silence your device with "Do not disturb"  - by Elena)