I would like to control a dimmer via MQTT. On my sitemap I would like to have two elements:
A switch to turn the lights on or off
A slider to finetune the intensity of the light
The switch sends/receives the commands ON and OFF. This is working fine. However, the slider must send/receive the expression “dim” followed by an integer between 0-99.
My question is regarding the syntax of the MQTT definition of the slider. Right now, I use the following definition, that only sends an integer without the expression “dim”.
@Dim I found that topic before, however, I am not able to make the transfer to my problem. I don’t understand how to combine the expression “dim” and the value that I define while using the slider.
For instance, if I set the slider to 50, the command to be send to my MQTT broker must equal “dim 50”.