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

Arrive Home Scene with Variable help


Question

Posted (edited)

Hi All,

 

Long time reader first time poster. Having taken the plunge a couple of months ago and started automating my new house with the HC2 and spending hours on this forum and having learnt a lot, I'm looking for some advice on the best way to set up this scene.

 

My aim for this scene is basically a Arrive Home Scene. I have created a VD Called IFTTT_GEO which has Global Variables that are updated when the buttons Home and Away are pushed for both me and my wife from IFTTT Geo fencing, which works perfectly when either my wife or i leave home it sets us as Away when we arrive near home it sets us as Home.

 

I've created a BLOCK scene so when it is dark and either of us are near home and the Variables update as home it turns on the front, garage, hallway and kitchen lights then turns off only the front & garage lights after 8 minutes. This scene works perfectly, but the part i am stuck on is how do i set it up so that if i am at home and my wife is out and comes home or vica versa than it only turns on just the front and garage lights rather than all the lights inside.

 

Is there a way i can use the Global Variable and have it check that if the variable is 'HOME' for either me or my wife than only turn on the front lights but if away than turn on all lights.

 

I'm open to suggestions, as i'm still on the learning boat of LUA and haven't gotten the full grasp of it yet so have been experimenting with both Block & LUA for different scenes but after getting no where for the last 2 weeks of searching for a solution for this i thought i might as well see if someone has an answer.

 

Thanks Again.

Edited by rowlandm

5 answers to this question

Recommended Posts

  • 0
  • Inquirer
  • Posted

    Bump, anyone?

    • 0
    Posted (edited)

    @rowlandm would you mind posting your block scene? its sounds very interested! not a fan of block scenes, but i like to convert it to a lua scene and incorporated into sanktronics UHAS scene im using.  the community is here is has a quite an extensive understanding of LUA.  you might ask @Sankotronic if he can lend you hand in getting this up and running.  he is the guru LUA expert here on the Fibaro Forums.

    Edited by matt1981
    edit
    • 0
  • Inquirer
  • Posted (edited)

    @matt1981 Thanks for your reply.

     

    I agree, and have learnt lots so far from this forum, but as LUA is new to me this is stumping me.

     

    Hopefully this helps and maybe you or @Sankotronic could possibly provide me with a solution. I'm open to LUA so i won't be just restricted to block scenes.

     

    I have attached a screen shot of the block scene.

     

    Switching to LUA i get this.

    Please login or register to see this code.

     

     

    Please login or register to see this attachment.

    Edited by rowlandm
    • 0
    Posted
    On 17/01/2018 at 7:34 PM, rowlandm said:

    Hi All,

     

    Long time reader first time poster. Having taken the plunge a couple of months ago and started automating my new house with the HC2 and spending hours on this forum and having learnt a lot, I'm looking for some advice on the best way to set up this scene.

     

    My aim for this scene is basically a Arrive Home Scene. I have created a VD Called IFTTT_GEO which has Global Variables that are updated when the buttons Home and Away are pushed for both me and my wife from IFTTT Geo fencing, which works perfectly when either my wife or i leave home it sets us as Away when we arrive near home it sets us as Home.

     

    I've created a BLOCK scene so when it is dark and either of us are near home and the Variables update as home it turns on the front, garage, hallway and kitchen lights then turns off only the front & garage lights after 8 minutes. This scene works perfectly, but the part i am stuck on is how do i set it up so that if i am at home and my wife is out and comes home or vica versa than it only turns on just the front and garage lights rather than all the lights inside.

     

    Is there a way i can use the Global Variable and have it check that if the variable is 'HOME' for either me or my wife than only turn on the front lights but if away than turn on all lights.

     

    I'm open to suggestions, as i'm still on the learning boat of LUA and haven't gotten the full grasp of it yet so have been experimenting with both Block & LUA for different scenes but after getting no where for the last 2 weeks of searching for a solution for this i thought i might as well see if someone has an answer.

     

    Thanks Again.

     

     @rowlandm,

     

    Good to see more Aussies appearing on the forums.

     

    Try adding another variable "occupancy_count" and make the value "0".

    Create a block scene that basically says "If Helen_GEO = Home, then occupancy_Count + 1".

    Then add a second block scene for the opposite. "If Helen_GEO=AWAY then occupancy_Count - 1.

     

    If you do this for both you and your wife, your HC2 will know how many people are home and you can then use the occupancy_Count variable as a condition in your scenes. e.g. if Rowland arrives home and occupancy_Count = 1, then turn on front lights else turn on all lights.

     

    Good Luck

    • 0
  • Inquirer
  • Posted

    @Robert Folbigg @matt1981

     

    Thanks for for your input. Whilst building our house home automation was to be a big part and so far it’s been amazing what I can do.

     

    Bit of an update, I was having troubles with using the variable occupancy_count +1 / -1 like you said to try in a scene but it kept giving me errors of too many instances and it started getting out sync at some point it was saying the count was -8 and 4 at other times (it was probably my lack of skill and not creating it properly).

     

    What I managed to do was add a line in to my virtual device button that I created so when the home button is pressed it says either of us at home and adds +1 for the variable and when we leave and the button away is pressed it sets us as away and -1 occupancy count, so far for the last day it has been in sync and has worked better than I planned.

     

    My problem is now, how to do create the scene in either LUA or block that:

    If Either of us arrives home and Occupancy_Count = 1, then turn on front lights else turn on all lights. I’m struggling with the else part.

     

    Thanks

    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...