About This File
Many users are trying to use GPS feature, but the functionality and use of HC2 location data are very confusing and most of the time don't work correctly.
The major advance of this scene that there is no use of HC2 defined locations and localization.
The scene triggered by location change, which received by HC2 and tracks users' presence according to predefined places. The scene sends notification (and could announce on user location in case TTS system has been defined and set) in three conditions:
- User arrived to one of the predefined places.
- User approaching to one of the predefined places.
- User leaves one of the predefined places.
You can define as many favorite places as you need. For example: Shopping Mall, School and etc. to track your family members. It helps to know if your kids are actually at school, and your wife at work and not at shopping mall.
Please note that in most of the time there is a gap of few minutes between user's actually location (physical) to location received by the system. Unfortunately in some cases no update received at all. I'm using this scene for few years and still don't have full understanding how the GPS mechanism works... when, how and why the location is updated by Fibaro mobile application and I believe if the application closed on your mobile, no updates sent at all.
Based on above facts, I do not suggest to execute any actions based on user location (like to open gate, lights), but I do suggest to turn on heating system (gap of few minutes better than nothing, or you already at home and your system anyway is ON)
--=========================== USER CONFIGURABLE PARAMETERS ===============================
eMailId = {2} -- user IDs to send email. To include more users use: eMailId={2,5,20}
eMail = true -- if true, email will send
popupNote = true -- if true, popup notification will send to all users.
pushNote = true -- if true, interactive push notification will send to users, which can receive Push notifications as defined at "Access Control" panel at "Mobile devices list" section.
_TTS = false -- text to speech message. Please before setting to true, make sure to update locationTts() function with your TTS setup. Default code in function based on Text to Speech - Android phone/Tablet scene and could be downloaded from https://forum.fibaro.com/files/file/180-text-to-speech-android-phonetablet/
--list of users ID and names (the reason to include names, is because the name could be email address in the system). Set scene %%properties accordingly to IDs in list. Please update according to your system
GPSuser = {{2,"Alex"},{190, "Tammy"},{457,"Leon"}}
--list of points of interest to follow users' arrival, approaching or leave. Please update/add according to your favorite locations. Make sure that place coordinates are few times more accurate than locAcc variable below.
GPSplace = {{"Home","62.1747177;64.8820022"},{"Work","62.244312;64.842668"}}
ignoreGps = 1 -- Amount of hours to consider the location is too old and ignored. Default to ignore over one hour old user location.
locAcc = 300 -- Defined GPSplace area in meters, to assume presence in place.
distGap=150 -- Distance between current and previous locations to avoid messages in case same location received several times.
By executing the scene manually, table with users' last location and their distance from predefined places will be displayed.
- Please use this feature to verify that the users' location data is receiving and updating by HC2. hasGPS column shows if user has GPS (means if location has been ever sent from this user) and how frequently GPS position is collected.
When the scene is triggered, follow information on debug window displayed:
User name, his previous and current location and timestamps. Current distance of the user from all predefined places
I hope it will do the job for you.
What's New in Version 1.0 See changelog
Released
Bug fix
Manually executed scene shows error below
[DEBUG] 01:30:19: 2019-01-31 01:30:19.852868 [ fatal] Unknown exception: /opt/fibaro/FibaroSceneAPI.lua:116: attempt to concatenate local 'deviceId' (a nil value)