Logic Machine Forum
FB Editor Staircase Lighting Function - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: FB Editor Staircase Lighting Function (/showthread.php?tid=4233)



FB Editor Staircase Lighting Function - d.r soutras - 11.09.2022

Hello guys!!
I tried all the compinations but it seems that i can not make the staircase lighting module to work.
The only thing that does is when it receives 1 in the input the output stays 1, when it receives 0 it stays 0. No time function.
Any help please would be appreciated.


RE: FB Editor Staircase Lighting Function - Dré - 11.09.2022

You need to add 'Filter' Filtr On-On / Off-__ between the outbut from your 'Lock out' and the input of your Stairase lighting function.
When you use this it only sent a 1 and never sent a 0.

the help says about input 1:
Start of the module by a telegram with the value not equal to zero. Output 1 has a one for the duration. If this input receives a zero, then Output 1 switches to zero.

i did made a script and do the same, but it also checks if the doors are closed, it all the doors are closed, then it goes off, if not, it stay on.
*at my script, more doors enable the lights, but not at all doors are the check if it is closed.

but it is a script, not blockly like you used.

Code:
--Read current status/value
deur_berging = grp.getvalue('14/0/57')            --'Deur Berging'
Garage_loopdeur = grp.getvalue('14/0/65')        --'Garage Loopdeur'
Poort = grp.getvalue('14/0/45')                --'Poort Buiten'
Schemering = grp.getvalue('5/0/9')            --'Schemering'
Buitenlamp_achterdeur = grp.getvalue('1/4/162')        --'B verl. Achterdeurlamp (tm)'    

--if one of these go open, set light on
if (deur_berging or Garage_loopdeur or Poort == true)
        and Buitenlamp_achterdeur == false
        and Schemering < 200
then grp.checkwrite('1/1/162', true)            --'B verl. Achterdeurlamp (s)'
end

os.sleep (300)                        --wacht voor 300 seconden (5 minuten)

repeat    -- repeat all below till 'Buitenlamp_achterdeur' is off
       
--Read current status/value (find because update time, doenst work with getvalue
deur_berging =         grp.find('14/0/57')            --'Deur Berging'
Garage_loopdeur =     grp.find('14/0/65')            --'Garage Loopdeur'
Poort =         grp.find('14/0/45')            --'Poort Buiten'

--calculate the time differents between now and last time of a true
now = os.time()                                -- current timestamp in seconds
delta_deur_berging    = now - deur_berging.updatetime         -- last object update relative time
delta_Garage_loopdeur     = now - Garage_loopdeur.updatetime         -- last object update relative time
delta_Poort         = now - Poort.updatetime             -- last object update relative time

--Read current status/value
get_deur_berging =     grp.getvalue('14/0/57')            --'Deur Berging'
get_Garage_loopdeur =     grp.getvalue('14/0/65')            --'Garage Loopdeur'
get_Poort =         grp.getvalue('14/0/45')            --'Poort Buiten'
Buitenlamp_achterdeur = grp.getvalue('1/4/162')            --'B verl. Achterdeurlamp (tm)'    
       
--if all is closed for set time turn light off
if         delta_deur_berging >    (1 * 60 ) -- minuten        -- controleer of de PIR niet meer actief is geweest voor de laatste 1 minuut
        and     delta_Garage_loopdeur >    (1 * 60 ) -- minuten        -- controleer of de PIR niet meer actief is geweest voor de laatste 1 minuut
        and     delta_Poort >        (1 * 60 ) -- minuten        -- controleer of de PIR niet meer actief is geweest voor de laatste 1 minuut
        and get_deur_berging == false
        and get_Garage_loopdeur == false
        and get_Poort == false
                and Buitenlamp_achterdeur == true
then    grp.checkwrite('1/1/162', false)            --'B verl. Achterdeurlamp (s)'
end

os.sleep (120)                        --wacht voor 120 seconden (2 minuten)
Buitenlamp_achterdeur = grp.getvalue('1/4/162')        --'B verl. Achterdeurlamp (tm)'    


until (Buitenlamp_achterdeur == false)



RE: FB Editor Staircase Lighting Function - d.r soutras - 11.09.2022

Thank you Dre for your reply.
I add the filter as you said but the problem still exists, I can not make the staircase lighting to set lights to off after 10sec.


RE: FB Editor Staircase Lighting Function - Daniel - 12.09.2022

It seems that this block works only as timer not as event. It was made by SE and I asked them to check it.


RE: FB Editor Staircase Lighting Function - d.r soutras - 17.09.2022

Thank you Daniel!