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

Question
BernhardtZs 0
Hi to All!
I have a problem to get my mobile location, and some issue with the calculateDistance function.
I have HC3, here is my mobile registered, location is set. On my mobile is the location all the time allowed. It seems to me, when I get closer to my house, that a Fibaro-Icon is showing but for 1 sec only, and nothing happened after this.
My code is the following:
Line 1: local userID = 2
Line 2: local homeLocation = "xx.xxxxxxxxxxxxxxx;xx.xxxxxxxxxxxxxxx"
Line 3: local userLocation = fibaro:getValue(userID, "Location")
Line 4: local distance = fibaro:calculateDistance(userLocation, homeLocation)
The error what I got:
for Line 3: "Assertion failed: Expected number". Here I have tried also: local userLocation = fibaro:getValue(tonumber(userID), "Location")
for Line 4: "attempt to call a nil value (method 'calculateDistance')"
What could be the problem here?
Thank you for your help!
Zsolt
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.