Dimmer command event trigger 2 times

HI all,

I have the following scenario.

A Led lamp which can be switched ON/OFF using ‘switch item’ and ‘dimmer’ item to dim this led bulb. The bindings are done to MQTT. What I see in the log is that when I use the dimmer , the command event is shown 2 times next to the StateChanged event.

10:48:31.519 [INFO ] [smarthome.event.ItemCommandEvent ] - Item ‘lamp2’ received command 40
10:48:31.720 [INFO ] [smarthome.event.ItemCommandEvent ] - Item ‘lamp2’ received command 59
10:48:31.720 [INFO ] [marthome.event.ItemStateChangedEvent] - lamp2 changed from 40 to 59

The MQTT binding now received the 2 command events resulting into 2 MQTT publish
commands .

1485165028: Sending PUBLISH to ESP8266Client-18-FE-34-A2-21-2A (d0, q0, r0, m0, ‘dimmer-18-FE-34-A2-21-2A’, … (5 bytes))
1485165028: Received PUBLISH from ubuntu (d0, q0, r0, m0, ‘dimmer-18-FE-34-A2-21-2A’, … (5 bytes))
1485165028: Sending PUBLISH to ESP8266Client-18-FE-34-A2-21-2A (d0, q0, r0, m0, ‘dimmer-18-FE-34-A2-21-2A’, … (5 bytes))

Is there a way to stop this behaviour ?
Could I use the ‘ItemStateChangedEvent’ which appears only once and how would I do that. I have ‘state’ already in the Dimmer setup.

sitemap :
sitemap demo label=“Main Menu”
{
Frame {
Switch item=lamp1
Slider item=lamp2

	}

}

items :
Switch lamp1 “Lamp Schuifpui” {mqtt=">[mymqtt:switch-18-FE-34-A2-21-2A:command:ON:bg01-0-1],>[mymqtt:switch-18-FE-34-A2-21-2A:command:OFF:bg01-0-0]"}
Dimmer lamp2 “Dimmer Schuifpui [%s]” {mqtt=">[mymqtt:dimmer-18-FE-34-A2-21-2A:state:*:SCALE(DimLvl.scale)]"}

Help appreciated .

I’m not that deep into MQTT binding so I don’t know if there is something that can be done there. If not, you can create a proxy Dimmer Item and a Rule that triggers only when that Proxy Item changes. In this rule use the MQTT publish action to send your new state to the device.