Finally it works!
here the new lie to add in siocConfig.lua depending on type of mom button
[511] = {OnOffMom, 39, 6, 7, 1} -- For buttons With -1;1 range
[511] = {OnOffMom, 39, 6, 7, 0.5} -- For buttons with 0;1 range
And the code to add in ExportSupport.lua
function OnOffMom(pValue, pDevice, pNumber1, pNumber2, pType)
local pVal, PNumb
if pType == 0.5 then
if pValue == 1 then
pNumb = pNumber1
pVal = 1
elseif pValue == 2 then
pNumb = pNumber1
pVal = 0.5
elseif pValue == 3 then
pNumb = pNumber2
pVal = 0
else
pNumb = pNumber2
pVal = 0.5
end
end
if pType == 1 then
if pValue == 1 then
pNumb = pNumber1
pVal = 1
elseif pValue == 2 then
pNumb = pNumber1
pVal = 0
elseif pValue == 3 then
pNumb = pNumber2
pVal = -1
else
pNumb = pNumber2
pVal = 0
end
end
GetDevice(pDevice):performClickableAction(pNumb + 3000, pVal)
end
And the code for SIOC
Var 0511, name Canopy
Var 1010, name Canopy_Open, Link IOCARD_SW, Input 16
{
IF &Canopy_Open = 1
{
&Canopy = 1
}
IF &Canopy_Open = 0
{
&Canopy = 2
}
}
Var 1011, name Canopy_Close, Link IOCARD_SW, Input 15
{
IF &Canopy_Close = 1
{
&Canopy = 3
}
IF &Canopy_Close = 0
{
&Canopy = 4
}
}
Thanks for help gadroc