Author Topic: Somfy RTS blinds stop command (luup scene) not working any more  (Read 855 times)

Offline mikee123

  • Hero Member
  • *****
  • Posts: 1521
  • Karma: +18/-11
I have a awning with a Somfy RTS motor. I have a Somfy dry contact wired to a Fibaro module, which one contact working as 'in', the other as 'out'. To send a stop command, I have to send in and out simultaneously which am doing with a scene and some luup code. Someone on here gave me this luup code a couple of years ago, and it all worked fine until a few months ago. Now, when I run the scene, quite often there is a delay between the in and out. The awning then does not stop, but either goes out again or in again. So even thought he code has not changed, something in my system stops the commands being accepted at the same time which buggers everything...
I've got no idea of how to fix this. This is the luup code of my scene:

luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{newTargetValue = "1"},150)
luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{newTargetValue = "1"},152)

luup.call_delay( 'switch_off', 1) -- Call the switch off function after a delay of 1 seconds

function switch_off()
luup.call_action("urn:upnp-org:serviceId:VSwitch1","SetTarget",{newTargetValue = "0"},117)
end