Page 1 of 1
Protection of roller shutter
Posted: Tuesday 21 January 2020 10:50
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
Re: Protection of roller shutter
Posted: Friday 14 February 2020 14:42
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
}
Re: Protection of roller shutter
Posted: Saturday 21 November 2020 14:58
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?
Re: Protection of roller shutter
Posted: Saturday 21 November 2020 15:03
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.
Re: Protection of roller shutter
Posted: Wednesday 23 December 2020 14:57
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
}
Re: Protection of roller shutter
Posted: Wednesday 23 December 2020 17:27
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
}
Re: Protection of roller shutter
Posted: Thursday 01 April 2021 10:06
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
}
Re: Protection of roller shutter
Posted: Thursday 01 April 2021 13:25
by madpatrick
Found the command to set the correct level
Only the responce time is verly log.
When i activate the shutter it take more then 5 seconds before the other command gets activated.
Re: Protection of roller shutter
Posted: Friday 11 June 2021 16:10
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 ?
Re: Protection of roller shutter
Posted: Saturday 12 June 2021 9:34
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
Re: Protection of roller shutter
Posted: Saturday 12 June 2021 10:01
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.
Re: Protection of roller shutter
Posted: Saturday 12 June 2021 10:31
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