Skip to content

Latest commit

 

History

History
59 lines (39 loc) · 3.04 KB

File metadata and controls

59 lines (39 loc) · 3.04 KB

OpenStreetMap + Hubitat Maker API (Life360) Demo

🛑 Warning:
Use the new version at https://community.sharptools.io/t/life360-live-map/7135

The new version talks directly to Life360, so it isn't dependent on Hubitat or a custom driver.

Overview

This demo uses Hubitat Maker API to retrieve the device's geolocation (latitude & longitude), and display the location in the map using OpenStreetMap API.

Quick View

Please note that this is using a Hubitat community developed smartapp and device driver to access Life360 geolocation info. For SmartThings users, the community developed device driver needs to be updated with the new Custom Capability before the new SmartThings REST API can retrieve these custom attributes. Or the alternative option is to access Life360 API directly to get the latitude and longitude info. See below for the detailed information and these implementation are not the "official" connection on either platform.

Getting Started

Enable Hubitat Maker API

Follow the steps below to enable Maker API in Hubitat admin page. Maker API

  • Select the devices that can be controled using this Maker API
  • Enable "Allow Access via Remote/Cloud"
  • Add "https://run.sharptools.app" in the Allowed Hosts (for CORS) field
  • Scroll down and copy the Access Token generated

Create Custom Tile

  • Go to Developer Tools in SharpTools user dropdown
  • Create a custom tile
    • Select "HTML" as Type

    • Create four settings (String type) settings

      • Sample Maker API URL: can be found in the Hubitat Maker API page. smaple_url
      • Life360 Device Id: Hubitat device id for Life360. Can be found by going to SharpTools User Page, tap ... next to the Hubitat location in the Authorized Locations section, select the Life360 device, and toggle the Advanced option in the device page. settings
      • Avatar Image Url (optional): the image you want to display in the map
      • Map Source (optional): four different map styles - default, bright, light, and dark.
    • Set default dimensons to 2x2

    • Copy & paste the code from here

Deploy Custom Tile

  • Go to the desired dashboard, Edit, and Add Item. Tap "Custom Tile" in the Other section and add this custom tile.

  • Edit the tile and fill-in the Hubitat Maker API sample URL and Life360 device id.

    Edit custom tile

  • Save

Done