{"id":5174,"date":"2020-07-10T11:32:14","date_gmt":"2020-07-10T11:32:14","guid":{"rendered":"https:\/\/www.beaconzone.co.uk\/blog\/?p=5174"},"modified":"2020-07-10T11:59:44","modified_gmt":"2020-07-10T11:59:44","slug":"bluetooth-le-ble-real-time-locating-system-rtls-with-api","status":"publish","type":"post","link":"https:\/\/www.beaconzone.co.uk\/blog\/bluetooth-le-ble-real-time-locating-system-rtls-with-api\/","title":{"rendered":"Bluetooth LE (BLE) Real Time Locating System (RTLS) API"},"content":{"rendered":"\n<p>Our <a href=\"https:\/\/beaconrtls.net\/\" target=\"_blank\" rel=\"noreferrer noopener\">BeaconRTLS\u2122<\/a> locates valuable plant tools in manufacturing\/construction and tracks parts and sub-assemblies. In healthcare it tracks high value equipment, monitors the location and temperature of medicines and saves time searching for equipment and monitoring vulnerable patients. For smart buildings, it tracks valuable assets, monitors lone workers and automatically locates people or students for safety and evacuation.<\/p>\n\n\n\n<p>When we designed  v2 of BeaconRTLS\u2122 we purposely omitted any reporting. While the system creates alerts for situations such as area entry\/exit, unexpected movement and missing assets there are no text or pdf based reports. For v1, we found that each customer needed different output reporting data. Some needed textual reports, others pdfs, Excel or electronic links to other systems. Some needed current information, historical, special subsets or calculated data. The required data also tends to change over time. For example, room occupancy has recently become important due to the Covid pandemic.<\/p>\n\n\n\n<p>Instead of fixed reports, all the data in the system is open and accessible via a HTTP REST API which makes the system very flexible. Open doesn&#8217;t mean insecure because the API can use SSL (https) and authentication (needs a special key to access). We can create reports and part of your solution but it&#8217;s simple enough that we find many customers are able to do this themselves. The BeaconRTLS\u2122 user guide provides examples how to use the REST API.<\/p>\n\n\n\n<p>The BeaconRTLS\u2122 API can be used from generic report writers such as jsreport, Jasper and <a rel=\"noreferrer noopener\" href=\"https:\/\/en.wikipedia.org\/wiki\/List_of_reporting_software\" target=\"_blank\">other report writers<\/a>. Excel <a rel=\"noreferrer noopener\" href=\"https:\/\/support.microsoft.com\/en-us\/office\/power-query-overview-and-learning-ed614c81-4b00-4291-bd3a-55d80767f81d\" target=\"_blank\">Power Query<\/a> , that comes free with Excel, is useful as it allows importing of data into Excel using a HTTP REST query which can be set up to automatically refresh every so often. Once in Excel, there&#8217;s a huge number of ways data can be re-formatted, combined, filtered, presented and forwarded.<\/p>\n\n\n\n<p>The main output information in BeaconRTLS is provided as BeaconLocation data that has the following format:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">{<br>\"dateTime\": \"2020-07-10T10:56:42.809Z\",<br>\"RSSI\": 0,<br>\"beaconMACAddress\": \"string\",<br>\"gatewayMACAddress\": \"string\",<br>\"beaconType\": \"string\",<br>\"beaconColour\": \"string\",<br>\"beaconLabelAttributes\": \"string\",<br>\"temperature\": 0,<br>\"humidity\": 0,<br>\"accelerationX\": 0,<br>\"accelerationY\": 0,<br>\"accelerationZ\": 0,<br>\"batteryPercentage\": 0,<br>\"batteryVoltage\": 0,<br>\"magneticSwitch\": true,<br>\"moving\": \"string\",<br>\"proximity\": true,<br>\"airPressure\": 0,<br>\"lightLevel\": 0,<br>\"buttonPress\": true,<br>\"id\": \"string\",<br>\"beaconId\": \"string\",<br>\"nearestGatewayId\": \"string\",<br>\"areaId\": \"string\"<br>}<br>]<\/pre>\n\n\n\n<p>For example, the following REST query fetches the beacon, gateway and time for most recent 20 beaconlocations:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">http:\/\/&lt;your ip or domain\/api\/beaconlocations?filter[fields][beaconMACAddress]=true&amp;filter[fields][gatewayMACAddress]=true&amp;filter[fields][dateTime]=true&amp;filter[limit]=20&amp;filter[order]=dateTime%20DESC<\/pre>\n\n\n\n<p>Putting this into Excel Power Query gets the data directly into Excel.<\/p>\n\n\n\n<p><a href=\"https:\/\/beaconrtls.net\/\" target=\"_blank\" rel=\"noreferrer noopener\">Read about BeaconRTLS\u2122<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Our BeaconRTLS\u2122 locates valuable plant tools in manufacturing\/construction and tracks parts and sub-assemblies. In healthcare it tracks high value equipment, monitors the location and temperature of medicines and saves time searching for equipment and monitoring vulnerable patients. For smart buildings, it tracks valuable assets, monitors lone workers and automatically locates people or students for safety &hellip; <a href=\"https:\/\/www.beaconzone.co.uk\/blog\/bluetooth-le-ble-real-time-locating-system-rtls-with-api\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Bluetooth LE (BLE) Real Time Locating System (RTLS) API&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[151,31],"tags":[],"_links":{"self":[{"href":"https:\/\/www.beaconzone.co.uk\/blog\/wp-json\/wp\/v2\/posts\/5174"}],"collection":[{"href":"https:\/\/www.beaconzone.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.beaconzone.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.beaconzone.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.beaconzone.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=5174"}],"version-history":[{"count":2,"href":"https:\/\/www.beaconzone.co.uk\/blog\/wp-json\/wp\/v2\/posts\/5174\/revisions"}],"predecessor-version":[{"id":5176,"href":"https:\/\/www.beaconzone.co.uk\/blog\/wp-json\/wp\/v2\/posts\/5174\/revisions\/5176"}],"wp:attachment":[{"href":"https:\/\/www.beaconzone.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=5174"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.beaconzone.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=5174"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.beaconzone.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=5174"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}