Comfort Automation/ Security System Forums

Full Version: Best way to know the state of a flag
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
What is the best way to know the state (if it\'s 1 or 0) of a flag?

Thaks

Rui

 

Guest

Set it as the status in the control menu?

What do you aim to achieve?
Thank\'s!

It was just to test this response:

[indent]
If Flag Flag01 <> 0 Then
    Do _sim_presenca_02 [p0_luz cozinha_off]
    Do _sim_presenca_04 [p1_luz cozinha_off]
    Do _sim_presenca_06 [p1_quarto susana_off]
    Do _sim_presenca_08 [ex_varanda_off]
    Do _sim_presenca_10 [ex_jardim suite_off]
    Do _sim_presenca_12 [ex_muro circuito 1_off]
    Do _sim_presenca_14 [p1_quarto srª conceição_off]
    Clear Flag Flag01
End If
[/indent]
The flag is set when the system is armed in vacation mode.

Before this response all the lights in vacation mode remain on after the custemer disarm the system.

Rui

Guest

Rui,

If you are using a flag to determine whether in vacation mode before deciding to execute responses or not, wouldn\'t it be easier to set it such that:

If  SecurityMode = VacationMode Then
    Do _sim_presenca_02 [p0_luz cozinha_off]
    Do _sim_presenca_04 [p1_luz cozinha_off]
    Do _sim_presenca_06 [p1_quarto susana_off]
    Do _sim_presenca_08 [ex_varanda_off]
    Do _sim_presenca_10 [ex_jardim suite_off]
    Do _sim_presenca_12 [ex_muro circuito 1_off]
    Do _sim_presenca_14 [p1_quarto srª conceição_off]
    Clear Flag Flag01
End If
Hi,

 

Here is the scenario:



 

On the vacation programs I have some responses (see attach).



This responses are just EIB light groups.



When the system is in vacation mode this light groups are turn ON and OFF randomly.

 

Until here everything OK.

 

The problem was - when the customer arrives home and disarm the system, all the lights that where ON remain ON

 
Your solution should work then
When you arm to vacation mode, you set the flag by the vacation Mode response
when you disarm you check the flag and control the lights if it is on. That is a good pieve of programming

Does this work?
Yes, it works fine.