Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

Is VD or Scene better for this?


Question

Posted

HI,

Looking for some advice here

 

I have a simple scenario. Enter room, sensor picks up the movement, lamp turns on.

 

I can implement this as  a scene (clode below) but I seem to get a lot of "too many instances", presumable because the sensor gets triggered when we are in the room

 

I could also implement this as a VD in the main loop (code below)

 

In terms of best practice or least load on the HC2 or what do our guru's generally do ?

 

Thanks

Frank

 

VD Lua

 

Please login or register to see this code.

Scene Lua

 

Please login or register to see this code.

 

12 answers to this question

Recommended Posts

  • 0
Posted

Hi @AutoFrank,

 

Why are you triggering scene with global variable instead with motion sensor? Is there a particular reason? When and with what you are changing value of global variable G_SPC_ZONE_INPUT_18?

 

I'am asking this questions because I use scenes to control my lighting and they are not causing any TOO MANY INSTANCES warnings even they are triggered by motion & light sensors and even doors where required.

 

  • 0
  • Inquirer
  • Posted
    10 hours ago, Sankotronic said:

    Hi @AutoFrank,

     

    Why are you triggering scene with global variable instead with motion sensor? Is there a particular reason? When and with what you are changing value of global variable G_SPC_ZONE_INPUT_18?

     

    I'am asking this questions because I use scenes to control my lighting and they are not causing any TOO MANY INSTANCES warnings even they are triggered by motion & light sensors and even doors where required.

     

     

    Hi @Sankotronic

    input 18 represents one of my Siemens alarm sensors

    I use Goran's SPC Gateway and all my standard house sensors are mirrored in my HC2 as global variables

    Specifically G_SPC_ZONE_INPUT_18 is a PIR in the corner of my living room

     

    thx

    • 0
    Posted

    Hi @AutoFrank

     

    Now it is more clear to me what problem you are facing. Can you tell me one more thing. How this motion sensors are working? I mean, do they have blind time after registering first movement and keep breached state during that time and how long is that time?

     

    Or to be more clear when global variable for motion sensor state change to breached, for how long it will keep this state before is set back to safe? What values do you use for breached and safe state? Numerical or strings?

     

    I ask you all of this because I have scene that is working very good with battery motion sensors but I want to try to adapt it to be used with your system too so I need to know more details to be able to do that. Thanks!

     

    • 0
  • Inquirer
  • Posted
    7 minutes ago, Sankotronic said:

    Hi @AutoFrank

     

    Now it is more clear to me what problem you are facing. Can you tell me one more thing. How this motion sensors are working? I mean, do they have blind time after registering first movement and keep breached state during that time and how long is that time?

     

    Or to be more clear when global variable for motion sensor state change to breached, for how long it will keep this state before is set back to safe? What values do you use for breached and safe state? Numerical or strings?

     

    I ask you all of this because I have scene that is working very good with battery motion sensors but I want to try to adapt it to be used with your system too so I need to know more details to be able to do that. Thanks!

     

     

    Good questions

    It's a wireless standard PIR (not zwave) and I don't think I have that degree of control over it's response but I see the point and will take a look

    I can see the state change ( using a VD I put together that reads the global variable) within 1-2 seconds of entering the room and it switches to 'safe'  pretty fast if I stop moving.

    Global values are 0 and 1

     

    For me the scene is working well using either a scene or a VD and I was just wondering which is a better overall approach

     

    thanks

     

    • 0
    Posted

    As I mentioned before I use scenes to control our lighting and it is working very good. I also incorporated this blind time to adjust for proper timing. I believe I can adapt this scenes to be triggered by global variables instead by sensors. Why I want that? Well, you can check here what are this scenes capable of if you didn't allready:

     

     

    So adding one more feature will make it even better. :-) 

    • 0
  • Inquirer
  • Posted
    27 minutes ago, Sankotronic said:

    As I mentioned before I use scenes to control our lighting and it is working very good. I also incorporated this blind time to adjust for proper timing. I believe I can adapt this scenes to be triggered by global variables instead by sensors. Why I want that? Well, you can check here what are this scenes capable of if you didn't allready:

     

     

    So adding one more feature will make it even better. :-) 

     

    Thanks .. looking forward to seeing the finished product

    • 0
    Posted (edited)

    Hi @AutoFrank

     

    This is debug window from Very Smart Light™ scene:

     

     Just tested scene when triggered by global variable and looks very good. It doesn't matter how frequently motion sensor is breached and how frequently global variable changes its value, scene is running only one instance. It is now ready to be posted. 

     

    I have only one question. When I try to add global variable

    Please login or register to see this code.

     to my HC2 on 4.100 it was too long so system cutoff last number from name. How did you manage to add global with such long name? Did you do it with REST API?

    Edited by Sankotronic
    Attachment quota filled up / deleting older stuff sorry :-(
    • 0
    Posted

    just a question:

     

    in one of your scene is see this:

     

    Please login or register to see this code.

    meaning: in this way the history from the scene with be registered in the event tab from the HC2 ?

    • 0
  • Inquirer
  • Posted
    16 minutes ago, Sankotronic said:

    Hi @AutoFrank

     

    This is debug window from Very Smart Light™ scene:

    Please login or register to see this attachment.

     Just tested scene when triggered by global variable and looks very good. It doesn't matter how frequently motion sensor is breached and how frequently global variable changes its value, scene is running only one instance. It is now ready to be posted. 

     

    I have only one question. When I try to add global variable

    Please login or register to see this code.

     to my HC2 on 4.100 it was too long so system cutoff last number from name. How did you manage to add global with such long name? Did you do it with REST API?

     

    I have Siemens alarm system and I purchased an SPC Gateway form Lundix IT

    Please login or register to see this link.

    When I installed it the variables were created for me automatically so I assume it was via the REST API

     

     

    • 0
  • Inquirer
  • Posted
    6 minutes ago, samuel said:

    just a question:

     

    in one of your scene is see this:

     

    Please login or register to see this code.

    meaning: in this way the history from the scene with be registered in the event tab from the HC2 ?

     

    Hi,

    I have this function in all my scenes and use it to log specifc events/actions from a scene to a global variable called 'Log_Event'

    Since my HA solution is still very much a work in progress I use it to keep track of certain variable or activities so I can see if there is an issue. My log is different and separate from the HC2 log or events.

     

    I also have code to dump the log ( and clear it) when I enable morning mode but at the moment it's not working as the log is to big for the email. Training to find a solution to this ... I also have a scene where I can just view the contents of the log

     

    It's a bit rough but it works for me

     

    Log dump looks something like 

    Please login or register to see this code.

    -frank

     

     

    • 0
    Posted

    ok, understood now

    • 0
    Posted

    The topic has been moved from "

    Please login or register to see this link.

    " to "

    Please login or register to see this link.

    ".

     

    Temat został przeniesiony z "

    Please login or register to see this link.

    " do "

    Please login or register to see this link.

    ".

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Answer this question...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...