stop command for Brel MJE24D motor  [Solved]

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
baaspi
Posts: 2
Joined: Thursday 20 June 2019 9:43
Target OS: NAS (Synology & others)
Domoticz version: 4.10717
Contact:

stop command for Brel MJE24D motor

Post by baaspi »

Hello all,

I have just started using Domoticz (on a synology NAS).
Currently I have 5 folding curtains in my house which I can open and close by using Domoticz. these are configured as blinds in the switch tab.

Now I want to implement another feature of these curtains in domotics.
By pressing and holding the 'stop' button on the original remote for about 3 seconds these curtains will move to a middle position.

pressing the stop button in the switch tab a couple of times triggers the curtains to move to the middle position.

I do not know how to implement the 'stop' command in dzVents.

below is the code used to test this. when a dummy switch is set 'on', the curtain moves upwards and after 5 seconds it should stop.
currently the stop command is not recognized. An I see the following error in the log:
2019-06-20 09:30:27.164 Status: dzVents: Error (2.4.19): An error occured when calling event handler Script #1 Vouwgordijnen open op tussenstand
2019-06-20 09:30:27.164 Status: dzVents: Error (2.4.19): ..._scripts/Script #1 Vouwgordijnen open op tussenstand.lua:12: attempt to call field 'switchStop' (a nil value)

Code: Select all

return {
	on = {
		devices = {
		    'Dummy gordijnen open'
		    }
	},

	execute = function(domoticz, switch)
	    if (switch.state == 'On') then
	        domoticz.log('Goodmorning, gordijnen op tussenstand')
	        domoticz.devices('Vouwg. Keuken achterzijde').switchOff()
	        domoticz.devices('Vouwg. Keuken achterzijde').switchStop().afterSec(5)
	    else
	        
	    end
	end
}
Does anyone knows how to send a 'stop command'?
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: stop command for Brel MJE24D motor

Post by waaren »

baaspi wrote: Thursday 20 June 2019 10:01 I do not know how to implement the 'stop' command in dzVents.

Code: Select all

domoticz.devices('Vouwg. Keuken achterzijde').switchStop().afterSec(5)
Does anyone knows how to send a 'stop command'?
From the wiki
Did you try this ??
the method stop() ?

Code: Select all

domoticz.devices('Vouwg. Keuken achterzijde').stop().afterSec(5)
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
baaspi
Posts: 2
Joined: Thursday 20 June 2019 9:43
Target OS: NAS (Synology & others)
Domoticz version: 4.10717
Contact:

Re: stop command for Brel MJE24D motor  [Solved]

Post by baaspi »

Thanks,

This works, I am now able to stop the moving curtains.
I tought I tried this command before but I forgot the '()' after stop.
lets see if I can find a way to send this command a couple of times to mimic the middle position command.
dude
Posts: 21
Joined: Friday 06 December 2013 21:07
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: stop command for Brel MJE24D motor

Post by dude »

Hi Baaspi,

Did you find the solution to send the command for the mid position ?

Thx

Dude
Raspberry PI, RFX 433E, Omnik Solar, Vair Co2, 1-wire, Qubino, TTN lora, Velux KF200, Kaku, Luftdaten, Meteo
dude
Posts: 21
Joined: Friday 06 December 2013 21:07
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: stop command for Brel MJE24D motor

Post by dude »

Although new software versions of RFXcom do have a command to move the curtain to an intermediate position.
I've not found a way to directly send this command from domoticz
The workaround which I found and which is working now for me, is repeatedly sending the stop signal.

Code: Select all

return {
	on = {
		timer = {
				'45 minutes before sunrise',
			}
	},
	execute = function(domoticz, timer)
	    domoticz.devices('Gordijn').switchOff()
	    domoticz.devices('Gordijn').stop().repeatAfterSec(1, 5)
	end
}
Raspberry PI, RFX 433E, Omnik Solar, Vair Co2, 1-wire, Qubino, TTN lora, Velux KF200, Kaku, Luftdaten, Meteo
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest