Protection of roller shutter

Moderator: leecollings

Post Reply
Roger1971
Posts: 1
Joined: Saturday 18 January 2020 12:07
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Protection of roller shutter

Post by Roger1971 »

Good morning,

I'm new in this community . i'm using Domoticz for a while now, it runs on a raspberry pi. Domoticz Version 4.10717 (May 9th 2019)

There are always new challenges with this system and i like it very much.

Here is my next challenge, I connected my roller shutter to a ASUN-650 switch and this works fine.
However, when the door is open and the roller shutter closes it is blocked by the door and the roller shutter get's dammaged.
I bought a "aeotec recessed door sensor gen 5" and i'm trying to make a scene with blockly to avoid roller shutter movement while the door is open.
I can't seem to get that working.........

Is it possible to make a scene in blockly to prevent that the roller shutter start's closing when the door is open ?

Maybe someone had the same challenge and found a sollution for this.

Kind regards,

Roger
Delfuego
Posts: 32
Joined: Sunday 29 July 2018 16:18
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: The Netherlands
Contact:

Re: Protection of roller shutter

Post by Delfuego »

Hello Roger,

You might try to solve this using DzVents (see script below). It is really easy to use. Don't forget to enable DzVents in your settings tab.

Code: Select all

return {
	on = 	{
		devices = { 'Switch' }  --Replace Switch by the name of your switch that controls the roller shutter in Domotics
		},
	execute = function(domoticz, device)
	    if (device.state == 'On') then
            if (domoticz.devices('Doorcontact') == 'Closed') then  -- Replace Doorcontact by the name of your Aeotec recessed door sensor gen 5 in Domotics
                domoticz.devices('RollerShutter').switchOn() --Replace RollerShutter by the name of your rollershutter in Domoticz
            end
        else
            domoticz.devices('RollerShutter').switchOff()  --Replace RollerShutter by the name of your rollershutter in Domoticz
        end
    end
}
mcjackdus
Posts: 15
Joined: Monday 22 October 2018 10:34
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Protection of roller shutter

Post by mcjackdus »

Hi,

I used this script but without any luck.
It looks like it blocked the operation of the shutter all the time with no difference if the window sensor is on open or on closed.
Can you please help me out on this?
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Protection of roller shutter

Post by waaren »

mcjackdus wrote: Saturday 21 November 2020 14:58 It looks like it blocked the operation of the shutter all the time with no difference if the window sensor is on open or on closed.
Can you show the script you used and the log it produced.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
mcjackdus
Posts: 15
Joined: Monday 22 October 2018 10:34
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Protection of roller shutter

Post by mcjackdus »

Code: Select all

return {
	on = 	{
		devices = { 'Rolluik Woonkamer Achter' }  --Replace Switch by the name of your switch that controls the roller shutter in Domotics
		},
	execute = function(domoticz, device)
	    if (device.state == 'On') then
            if (domoticz.devices('Raam Sensor') == 'Closed') then  -- Replace Doorcontact by the name of your Aeotec recessed door sensor gen 5 in Domotics
                domoticz.devices('Rolluik Woonkamer Achter').switchOn() --Replace RollerShutter by the name of your rollershutter in Domoticz
            end
        else
            domoticz.devices('Rolluik Woonkamer Achter').switchOff()  --Replace RollerShutter by the name of your rollershutter in Domoticz
        end
    end
}
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Protection of roller shutter

Post by waaren »

mcjackdus wrote: Wednesday 23 December 2020 14:57

Code: Select all

	devices = { 'Rolluik Woonkamer Achter' }  --Replace Switch by the name of your switch that controls the roller shutter in Domotics
This code will never work as expected because the script trigger is the blind itself. The script trigger should be a timer or a virtual switch or something else but not the blind. If you schanged that use below script as it will give some additional information what it does and why.

Code: Select all


return 
{
	on = 	
	{
		devices = 
		{ 
			'Switch' ,  --Replace Switch by the name of your switch that controls the roller shutter in Domotics
		}, 
	},
	
	logging =
	{
		level = domoticz.LOG_DEBUG,
		marker = 'rolluik', 
	},
	
	execute = function(dz, item)
		local sensor = dz.device('Raam Sensor')
		
		dz.log('State of ' .. item.name ..   ' is:  ' .. item.state, dz.LOG_DEBUG)
		dz.log('State of ' .. sensor.name .. ' is:  ' .. sensor.state, dz.LOG_DEBUG)
	
	    if item.state == 'On' then
            if (dz.devices('Raam Sensor') == 'Closed') then  -- Replace Doorcontact by the name of your Aeotec recessed door sensor gen 5 in Domotics
                dz.devices('Rolluik Woonkamer Achter').switchOn() --Replace RollerShutter by the name of your rollershutter in dz
            end
        else
            dz.devices('Rolluik Woonkamer Achter').switchOff()  --Replace RollerShutter by the name of your rollershutter in dz
        end
    end
}

Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
madpatrick
Posts: 636
Joined: Monday 26 December 2016 12:17
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: Protection of roller shutter

Post by madpatrick »

Hello Waaren,

I was looking at this script and like to use it, but using a dummy switch is difficult.
In the Somfy app you can control the shutters, but of course the Domoticz are not visible.

The shutter can also be control with a level 0-100%
Is it possible to use Shutter as trigger and if the door/windows is open it goed to 5% and else to 100% ?

Appreciate your help

I've tried the Setlevel, but that gives an error

Code: Select all

2021-04-01 10:20:53.092 Status: User: Admin initiated a switch command (488/Somfy - Erker Raam 4/On)
2021-04-01 10:21:08.799 Error: dzVents: Error: (3.0.2) An error occurred when calling event handler Screens Deursensor
2021-04-01 10:21:08.799 Error: dzVents: Error: (3.0.2) ...scripts/dzVents/generated_scripts/Screens Deursensor.lua:12: attempt to call a nil value (field 'Setlevel')

Code: Select all

return {
	on = 	{
		devices = { 'Somfy - Erker Raam 5' }  --Replace Switch by the name of your switch that controls the roller shutter in Domotics
		},
	execute = function(domoticz, device)
	    if (device.state == 'On') then
            if (domoticz.devices('Sensor - Erker') == 'Open') then  -- Replace Doorcontact by the name of your Aeotec recessed door sensor gen 5 in Domotics
                domoticz.devices('Somfy - Erker Raam 5').Setlevel(20) --Replace RollerShutter by the name of your rollershutter in Domoticz
                dz.log('Screen at 20%', dz.LOG_FORCE)
            end
        else
            domoticz.devices('Somfy - Erker Raam 5').Setlevel(50)  --Replace RollerShutter by the name of your rollershutter in Domoticz
            dz.log('Screen at 50%', dz.LOG_FORCE)
        end
    end
}
-= HP server GEN8 Xeon(R) E3-1220L_V2 -=- OZW -=- Toon2 (rooted) -=- Domoticz v2024.7 -=- Dashticz v3.12b on Tab8" =-
User avatar
madpatrick
Posts: 636
Joined: Monday 26 December 2016 12:17
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: Protection of roller shutter

Post by madpatrick »

Found the command to set the correct level

Code: Select all

.dimTo(70)
Only the responce time is verly log.
When i activate the shutter it take more then 5 seconds before the other command gets activated.
-= HP server GEN8 Xeon(R) E3-1220L_V2 -=- OZW -=- Toon2 (rooted) -=- Domoticz v2024.7 -=- Dashticz v3.12b on Tab8" =-
User avatar
madpatrick
Posts: 636
Joined: Monday 26 December 2016 12:17
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: Protection of roller shutter

Post by madpatrick »

Hi,

I need some help to extend the script.

This is my current script any it is working fine.

Code: Select all

local scriptVersion         = 'Versie 1.0'
local scriptVar             = '-=# Screens Blok 2 #=-'
local Erker3                = 501          -- 'Somfy - Erker_3'
local Erker4                = 499          -- 'Somfy - Erker_4'           
local Erker5                = 497          -- 'Somfy - Erker_5'   

return {
	on = 	{
		devices = {494}
		},
		        logging = { level = domoticz.LOG_INFO,
                marker      = scriptVar },
       	        
	execute = function(dz, device)
	    
	    local Erker3     = dz.devices(Erker3) 
	    local Erker4     = dz.devices(Erker4)  
	    local Erker5     = dz.devices(Erker5) 
	    
	    if (device.state == 'Open') then
            Erker3.switchOn()
            Erker4.switchOn().afterSec(0.5)
            Erker5.switchOn().afterSec(1)
            dz.log('Screens Erker blok 2 helemaal Open', dz.LOG_FORCE)
            
        elseif (device.state == 'Dicht') then
            Erker3.switchOff() 
            Erker4.switchOff().afterSec(0.5) 
            Erker5.switchOff().afterSec(1)
            dz.log('Screens Erker blok 2 helemaal dicht' , dz.LOG_FORCE)
        end
    end
}
I'm using 1 dummy switch to control 3 shutters

Sometime I control 1 shutter and later another one, depeniding on the sun/weather
The only issue is when you close or open the shutter seperatly, the dummy switch is not updated.
Is it possible when all 3 shutters has been operated seperatly, the dummy switch is corrected to this situation ? Without operating the blinds ?
-= HP server GEN8 Xeon(R) E3-1220L_V2 -=- OZW -=- Toon2 (rooted) -=- Domoticz v2024.7 -=- Dashticz v3.12b on Tab8" =-
User avatar
madpatrick
Posts: 636
Joined: Monday 26 December 2016 12:17
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: Protection of roller shutter

Post by madpatrick »

A reply on my own question.
I have tried this script, but i doesn't work unfortunately

Code: Select all

local scriptVersion         = 'Versie 1.0 '
local scriptVar             = '-=# Screens test #=-'
local Erker1                = 496  -- 'Somfy - Erker_1' 
local Erker2                = 500  -- 'Somfy - Erker_2' 
local dummy_blok1           = 493 

return {
	on = 	{
		devices = {496,500}
		},
		
		        logging = { level = domoticz.LOG_INFO,
                marker      = scriptVar },
       	        
	execute = function(dz, device)
	   local delay          = 30
	   local Erker1         = dz.devices(Erker1) 
	   local Erker2         = dz.devices(Erker2)
	   local dummy_blok1    = dz.devices(dummy_blok1) 
	    
	    
if Erker1.lastUpdate.secondsAgo > delay then	    
        if Erker1.state == 'Open' and Erker2.state == 'Open' then
                dummy_blok1.switchSelector(0).checkFirst().silent()
                dz.log(' Dummy switch update to OPEN',dz.LOG_FORCE)
        elseif Erker1.state == 'Dicht' and Erker2.state == 'Dicht' then
                dummy_blok1.switchSelector(0).checkFirst().silent()
                dz.log(' Dummy switch update to DICHT',dz.LOG_FORCE)
        else
                dz.log(' Dummy switch status unchanged',dz.LOG_FORCE)
            end
    end
end
}
Because of the time top close or open the screens i've setup a delay of 30sec before it must check the status.
This is not working. The check is done directly.

Also the switchselector change doesn't work.

Appreciate any feedback
-= HP server GEN8 Xeon(R) E3-1220L_V2 -=- OZW -=- Toon2 (rooted) -=- Domoticz v2024.7 -=- Dashticz v3.12b on Tab8" =-
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Protection of roller shutter

Post by waaren »

madpatrick wrote: Saturday 12 June 2021 9:34 A reply on my own question.
I have tried this script, but i doesn't work unfortunately

Appreciate any feedback
To further investigate you could extent the log level an add some loglines. It might also help identifying the issue(s) if you describe what you expect vs to what you see.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
madpatrick
Posts: 636
Joined: Monday 26 December 2016 12:17
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: Protection of roller shutter

Post by madpatrick »

The first issue i'm facing is the delay.
Because the delay is not working the status of the switch is not (yet) correct. It takes time before the screens are down and the status is upate.
Now when i activate the screen the script runs and i see the message " Dummy switch status unchanged" in the log almost directly
-= HP server GEN8 Xeon(R) E3-1220L_V2 -=- OZW -=- Toon2 (rooted) -=- Domoticz v2024.7 -=- Dashticz v3.12b on Tab8" =-
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests