How to control a dimmer channel via a switch

I am trying to control a dimmer channel via a switch in Habpanel, but this doe not seem to work.
When connecting both a slider and a switch to the dimmer channel, pressing the switch affect the slider setting in the correct way ( max or min ) however the lamp is not controlled. Using the slider works.

Behaviour is the same for MQTT and ZWAVE

What is the preferred way to use a dimmer as a switch ?
(Assuming the devices do not have an on/off or power channel)

A dimmer channel will accept On and OFF commands.
Can you post the switch setup, please?

I tried it with 2 items 1 Zwave (Fibaro dimmer 2) thing configured via paper UI, item via text:

Dimmer n08_plafond   "Keuken"   {channel = zwave:device:14599b09:node8:switch_dimmer1"} 

When in Habpanel a switch is linked to it, the switch can toggle the lamp. When both a switch and a dimmer are linked to it, the the switch affects the dim slider, but lamp on or off does not work.
Using the slider does affects the lamp.

2nd is a Tasmota MQTT device (H801 5ch PWM)

Bridge mqtt:broker:mosquitto [ host="127.0.0.1", secure=false ]
{
    Thing topic mything {
    Channels:
        Type dimmer : gang_koof "Koof gang" [ stateTopic="stat/sonoff/meterkast/led/channel2", 
        commandTopic="cmnd/sonoff/meterkast/led/channel2", min=0, max=5, step=1 ]
}

For this device: using a slider works. “Slider + switch” or only switch does not work.

Small remark: the max=5 orgininates from same example, when using a slider the the full range can be used, so never changed it.

I just added a group, which sends an “OFF” to all lights, this also does not work with an MQTT dimmer.