I have a scenario that dims up a light and takes 5 minutes to do it...
(it is composed by several lines LIGH LEVEL 5 after 5, LIGHT LEVEL 10 after 10 etc etc...)
but if I want to stop it... how could I do that?
thanks
ciao
M
is it possible to stop a scenario?
Moderators: leecollings, remb0
- emme
- Posts: 909
- Joined: Monday 27 June 2016 11:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest
- Location: Milano, Italy
- Contact:
is it possible to stop a scenario?
The most dangerous phrase in any language is:
"We always done this way"
"We always done this way"
- Egregius
- Posts: 2592
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: is it possible to stop a scenario?
I don't think you can interrupt the ON AFTER etc.
I do it like this for my dimmers:
When I choose to slowly dim up, or down with my floorplan I set a variable to 1 or 2 (default=0=do nothing).
Then in my script that run's every minute I check that variable for each dimmer and act upon it's state.
As soon as I choose a custom level, switch off or on on my floorplan the variable is set back to 0 so the slow dimming thing is stopped.
I use similar thing to override a setpoint
I do it like this for my dimmers:
When I choose to slowly dim up, or down with my floorplan I set a variable to 1 or 2 (default=0=do nothing).
Then in my script that run's every minute I check that variable for each dimmer and act upon it's state.
As soon as I choose a custom level, switch off or on on my floorplan the variable is set back to 0 so the slow dimming thing is stopped.
I use similar thing to override a setpoint
Code: Select all
<?php
$items=array('eettafel','zithoek','tobi','kamer','alex');
foreach($items as $item){
if($s[$item]!='Off'){
if(strtotime($t[$item])<dertigsec){
$action=cget('dimmer'.$item);
if($action==1){
$level=filter_var($s[$item],FILTER_SANITIZE_NUMBER_INT);
$level=floor($level*0.95);
if($level<2)$level=0;
sl($i[$item],$level,$item);
if($level==0)cset('dimmer'.$item,0);
}
elseif($action==2){
$level=filter_var($s[$item],FILTER_SANITIZE_NUMBER_INT);
$level=$level+2;
if($level>30)$level=30;
sl($i[$item],$level,$item);
if($level==30)cset('dimmer'.$item,0);
}
}
}
}
Who is online
Users browsing this forum: No registered users and 1 guest