Zigbee2MQTT hold button on remote

Hi,

I got a Ikea switch connected to Symcon via Zigbee2MQTT.

the status i got from the buttons are:

  • On
  • Off
  • Brightness_move_up (long press I )
  • Brightness_move_down (long press O)
  • Brightness_stop

Is there a way to register the duration of the time Brightness_move_up & down is pressed.
So i can use that as a dimmer.

Use case:

  • press I or O long
  • dimmer start to raise/lower the brightness with 10% every second
  • until i stop the button press

thanx!

You can use the variable informations.

https://www.symcon.de/service/dokumentation/befehlsreferenz/variablenverwaltung/ips-getvariable/

Greetings,
Kai

Hi!

Thanx,

i created this script, this is also working.

$lop=false;
$status=GetValue(30822); // disable on change trigger
$cnt=0;

if ($status == „“) return;

if ($status==„brightness_move_up“)
{
$lop = true;
IPS_SetEventActive(37830, false);
$val = round(GetValue(57826)*2.55);

}
if ($status==„off“)
{
PHUE_DimSet(30687,false);
}
if ($status==„on“)
{
PHUE_DimSet(30687,(90*2.55));
}

while($lop==true)
{
$a = IPS_GetVariable(30822);
$status=GetValue(30822);
if ($status==„brightness_move_up“)
{
$cnt++;
if ($cnt>2)
{
$cnt=0;
$val+=40;
PHUE_DimSet(30687,$val);
if ($val>=255) $lop=false;
}
IPS_Sleep(50);
}
elseif ($status==„brightness_move_down“)
{
// TODO
IPS_Sleep(25);
}
else
{
$lop=false;
}

}
SetValue(30822, „“);
IPS_SetEventActive(37830, true);