[Beta] MQTT beta 3d (released 5th July)

Hi @kevin :slight_smile:
I have been making good progress using your MQTT App to interface with Indigo.
One other issue I have come across is with an Aqara dual rocker switch (button) which sends button "pushed", "doubletapped" and "held" to Indigo. After 1 second it sends "idle". That is apart from when it is "held". It seems that the switch doesn't send a "released" message when the button is released.

I have posted a question in the [BETA RELEASE] Xiaomi Aqara Mijia Sensors and Switches Driver forum thread but in the meanwhile have got round the problem by modifying the MQTT App as follows:

        mqtt.publishMsg (sTopic+'/button/'+"${normalize(type)}","${state}",1,true) 
        if ((btnNum>=0) && (btnNum < 999)) {
            if (type=='held'){
                mqtt.publishMsg (sTopic+"/button/button-$btnNum","held",1,true)
                pauseExecution(2500)
                mqtt.publishMsg (sTopic+"/button/button-$btnNum","idle",1,true)
            }
            else {
                if (type=='pushed' ) mqtt.publishMsg (sTopic+"/button/button-$btnNum","pushed",1,true)
                else if (type=='doubleTapped') mqtt.publishMsg (sTopic+"/button/button-$btnNum","doubletapped",1,true)
  						
                else if (type=='released') mqtt.publishMsg (sTopic+"/button/button-$btnNum","released",1,true)
                pauseExecution(1000)
                mqtt.publishMsg (sTopic+"/button/button-$btnNum","idle",1,true)
            }
        }		 
        else log ("Bad button state $state $btnNum","WARN")

I have chosen an arbitrary time of 2.5 seconds as all I want to detect is the fact that it was held down.

Maybe it is only of use to me but I thought I would mention it as a possibility to have a config option set e.g. if held idle > 0 then delay by the amount of time set in held idle.