• Professional advice
  • Order before 23.59 uur shipped today (choose Trunkrs)
  • Almost always available (+31 73 762 0 762)
  • Monday open late (odd weeks)

Fibaro:calculateDistance command



Actieon :

Calculates the distance between 2 geografical points


Uasge and parameters :

fibaro:calculateDistance(position1, position2)

  • position1: first location
  • position2: second location

A location is detemermend by latitude and longitude. Values are displayed in degress with a decimal point (no comma) and are seperated by a semicolom. Negative values are West and Soouth

Example, point 40°44’55″N, 73°59’11″W will be “40.7486;-73.9864″.


Return value:

Distance  in meters.


Programmeervoorbeeld :

local  eigenlocatie = fibaro:getValue(123, 'Location')   --123 is het ID van de gebruiker
local  voorbeeldlocatie = "51.6578349135172;18.6398273982745";

local result;
result = fibaro:calculateDistance(eigenlocatie,voorbeeldlocatie);
'De afstand bedraagt' ..result.. " Meter");


Customer Service Phone

mon-fri: 10am-5pm and sat 10am-3pm


Gerstakker 16 5236 VG Empel Netherlands

Google maps