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

Scene with time and GPS location


Question

Posted

I'm a new user with Fibaro and have non experience with creating scenes.

This morning i was trying to create a scene with power off an device at a planned time at 23:00 and adding to turn on when i'm almost arriving at home 5000 meters. 

The power on worked fine, but when the scene is trying to turn off it will immediately turn on because i'm at home, how can i solve the power off issue when i'm at home?

14 answers to this question

Recommended Posts

  • 0
  • Inquirer
  • Posted

    Can someone give me an start to get this working?

    • 0
    Posted

    please can you describe what you want?

    or show a picture of what you allready have and we can go with that

    im guessing theres a flaw in your logic

    • 0
    Posted

    So i guess you want to turn it off indipentently if you are home or not at 11 PM? Then if you left home and then arrive back home, then at 5000m you want to turn it on?

     

    You need to tell the system if you left home or not. (If you left outside of the 5000m).

     

    I other word, the Turn on the light scene reaching 5000m can only be triggered if you left outside of this range, otherwise not. (Still home)

     

    My self got a trigger to 3 global variables, Me, My wife and Home Status. I set the first two depending if we left home or not (Set by range, like you). If both left home (Home status = Noone Home), i turn of all lights etc. When one of us arrives back home i trigger the "Welcome home scene". Turning on lights etc. But only of the Home Status is Noone Home. 

    At the end when the door is opened, the wallway lights gets triggered etc.

    • 0
    Posted

    I'm a new user with Fibaro and have non experience with creating scenes.

    This morning i was trying to create a scene with power off an device at a planned time at 23:00 and adding to turn on when i'm almost arriving at home 5000 meters. 

    The power on worked fine, but when the scene is trying to turn off it will immediately turn on because i'm at home, how can i solve the power off issue when i'm at home?

    Do you use LUA or graphic blocks?

    • 0
    Posted

    In any case here an example of LUA code 

    Please login or register to see this code.

    Please replace UserID with real ID  (to find out the user ID in the system use

    Please login or register to see this link.

    By the way you don't need to tell the system if you left home. The system is tracking your movement, so  when you'll be more than 5000 meters away and  will be coming back the scene will turn the lights on again.
    When you at home the current and previous distances are both less than 5000, so when you'll turn lights off it will stay off. Please create another scene (or VD) to turn off the light at 23:00. 
    If you want to be more sophisticate, you can loop the scene and then you can turn off the lights at 23:00 inside the scene and don't need Location trigger at header.
    I don't use graphic blocks, but I believe you can create the same scenario there as well (w/o debug portion)
    • 0
    Posted

    Thanks!

     

    How often do you poll the GPS position for the users? What about battery drain?

    • 0
    Posted
    local homeLoc = "40.7486;-73.9864" --A point is expressed by latitude and longitude. Please fill in your home location

     

    Nice geographical coordinates

    Please login or register to see this image.

    /emoticons/default_icon_smile.gif" alt=":-)" />

     

     

    • 0
    Posted

    Please login or register to see this link.

    ,

     

    I use schedule option... 

    On expected period of returning home from work (17:00-21:00) I poll GPS every 5 minutes. Same for morning hours (06:30 - 10:00). Between 10:00 to 17:00 every 20 minutes.

    During the night no GPS polling at all. 

     

    Higher poll rate for my wife... monitoring her movement 

    Please login or register to see this image.

    /emoticons/default_icon_rolleyes.gif" alt=":roll:" />

    I didn't see any major impact on battery consumption.

    • 0
    Posted

    Nice! So i Guest the trigger for this scene is upon every poll och the device.

    - What Will be the return if the phone is off? Null?

    - When phone further on was started again does it require the fibaro app to be started? (iPhone)

    • 0
    Posted

    When the phone is off there is no trigger....

    Every time that user's phone sends GPS location the scene is triggered.

    Of course the GPS location sends by fibaro application  (iPhone or Android).  

    My personal experience shows that android phones have better response.

    • 0
  • Inquirer
  • Posted

     

    In any case here an example of LUA code 

    Please login or register to see this code.

    Please replace UserID with real ID  (to find out the user ID in the system use

    Please login or register to see this link.

    By the way you don't need to tell the system if you left home. The system is tracking your movement, so  when you'll be more than 5000 meters away and  will be coming back the scene will turn the lights on again.
    When you at home the current and previous distances are both less than 5000, so when you'll turn lights off it will stay off. Please create another scene (or VD) to turn off the light at 23:00. 
    If you want to be more sophisticate, you can loop the scene and then you can turn off the lights at 23:00 inside the scene and don't need Location trigger at header.
    I don't use graphic blocks, but I believe you can create the same scenario there as well (w/o debug portion)

     

    Thanks for the LUA script i've tried it building with blocks, how you've learned scripting could you give me some tips to start some interesting sites?

    • 0
    Posted

    Since the coding in HC2 is some kind of hybrid between LUA and fibaro functions, may suggestion is to take basic training (on-line) for LUA and Fibaro functions - see links below

    Please login or register to see this link.

    Please login or register to see this link.

     (needs registration - is free)

    Please login or register to see this link.

     

    Another way to have better understanding what is going on inside HC2, is to create graphic blocks and to switch scene edit mode to LUA based.  Try it on your GPS blocks.

    Good luck.

    • 0
    Posted

    Update:

     

    I have tried this scene now for a while but did notice one issue.

    Ig the polling is set to eg 5 min the polling only occur if the person is moving.

    So it must do a polling withing the 3000m range or it will miss it upon arriving home.

     

    Is this how it sopose to work?

    • 0
    Posted

    The GPS tracking doesn't work as expected. There are a lot of blind spots and delays on location.

    Several cases have been opened, but till now no proper response or support from Fibaro.

    In general the tracking is not stable at all and it works occasionallyץ

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