Merry X-mas

I am struggling with Lua and I hope that somebody can help me.
I have Curtains which are controlled by Zwave (Zwave Fibaro Roller Shutter 2) and added in Domoticz as a Curtain (without Level).
I would like to create a Dummy switch (Push On button) which when enabled opens the curtains when closed, and closes them if open. With this Push button I then can create a Scene which I need for my double click function on a Wall Switch.
Therefore I created this Lua:
(Gordijnen = Curtains, the real Domoticz 'Inverted Blinds')
(DummyHulpGordijnen = my dummy Push On button)
I expected its states to be Open / Closed. Because the Log says "On / Off" I first made te script with On/Off: This didn't work.commandArray = {}
if (devicechanged['DummyHulpGordijnen'] == 'On' and otherdevices['Gordijnen'] == 'Open') then
print("Gordijnen dicht")
commandArray['Gordijnen']='Off'
elseif (devicechanged['DummyHulpGordijnen'] == 'On' and otherdevices['Gordijnen'] ~= 'Open') then
print("Gordijnen open.")
commandArray['Gordijnen']='On'
end
return commandArray
Then I changed to the script above. This worked, but only in one direction. It does not matter if the curtains are open or closed, Lua Always says it is Open. So if my curtains are Closed, it still thinks they have the status "Open" and it tries to close them again.
I tried all kind of things, but I just cannot find the solution. Is there maybe a way to print the current status of the switch "Gordijnen" ? Then maybe I can find out what to put in my Lua script to know they are Closed.
Really strange problem. It seams that my Fibaro Roller Shutter does not report the right/changed status back. Although open and close work using the normal Inverted Blind switch in Domoticz.
I hope someone knows a solution