[RELEASE] HD+ - Android Dashboard

Thanks, I'll get right on that then. A device with command called setLocation that will parse the incoming string (CSV as you show) and populate the 3 values. I've written a couple very very simple groovy devices so I should be able to get this done with a little more research but it will take me a little time as I'm that proficient at groovy yet. My expertise is in PLC code for industrial automation.

version 1.0.2136 (beta)

  • Life360: better starting map position / animation
  • Life360: fix "ERROR: NotInstalled" popup

2 small changes in this version for Life360 (or OwnTracks) devices

2 Likes

Having issues with fully that screen saver is not working. Do you have any issues with hd+ and fully

@jpage4500

Picked up a small bug where backup does not work correctly on both my Samsung phone and tsb as well as my daily Xiaomi phone. It sais it backs up a file but doesn't and when I click back up to a link . It just goes back to the backup or restore page.

Hi @jpage4500, as it turns out it was actually much simpler than I thought to create a simple device driver as described. I have one done to play with whenever the feature needs to be tested. You may already know how to do this but when I was debugging the driver through maker it didn't play well with the commas in the string. If I set the delimiter to an underscore (or other non-special character) it worked fine. When I use commas I get an error that it's not a 'string' and that I could try declaring the variable as an object. There may be some trick I don't know to include commas in the string, so you'll have to let me know what delimiter you prefer.

It works right now, I just need to add some error traps in case something goes wrong.

Lemme know when I can of any assistance, thanks!

it doesn't matter to me.. i'd just use whatever other drivers use (if it's common). The only thing I was hoping to avoid was making multiple makerAPI calls to set lat, then lng, then accuracy. I guess the driver could have multiple ways to set location including individual setLat, etc.

I tried to find some other examples and only came across this one for setColor

Maker API setColor - #11 by JasonJoel?

http://192.168.2.xx/apps/api/621/devices/190/setColor/{"hue":88,"saturation":99,"level":35}?access_token=abc…

Hi @jpage4500, if I interpret that correctly, then that is a Json Object and not a basic string, sadly. And I completely understand the reasoning for 1 call vs 3.

I would just use and underscore if that's easy enough. I played a little bit more last night and actually sent the 3 values as one string (i.e. 45.12345_-78.901234_15) to my device thru the actual HD+ tile using underscores and it worked fine.

You certainly can do it as a JSON Object if you wish but that just seems like unnecessary work when a simple string works just as well.

But whatever is easier for you, you're doing the lion's share of the work. I'll adjust the driver if need be.

I apologize if this has been asked and answered before....
How do I move a HD+ dashboard to a new Hubitat hub?

I think I posted further up regarding this. Easiest way is to backup and export the config file from the app, edit the exported file, then restore the modified version. There’s only one or two lines that need to be edited.

HA! I even "liked" your post above on this very topic. Thanks for the reminder.

1 Like

No problem. I think it'll be lines 2, 3 & 4 that might need changing. Only line 4 if it's an old hub being exported to a new one (like my C-7 to C-8 was):

Line 2 "Server" - If the IP address is different on the new hub
Line 3 "App ID" - The app ID for Maker API
Line 4 "Token" - That's the only bit I had to amend

2 Likes

doesn't matter to me - I might have some time this weekend to work on this so if you have a driver to test with send it over and I'll test it out too!

Probably not the standard way but you could back it up whatever dashboard your using, switch hubs, then backup to the new hub.

When you do the restore on the new hub it wouldn't work as the token will be different (I found out when migrating C-7 to C-8). So you backup from old, edit the config in a text editor to amend the token before restoring to the new one.

1 Like

Wow, that'd be great. Although, it's the holiday weekend, I hope you're not taking time away from the family for this.

Here's the driver (I'm a groovy newbie so don't laugh at the code :slight_smile: ). I had to just copy/paste as a txt or groovy file isn't an authorized file upload. Obviously the character in the loc.split, function is the delimiter, you can change that to whatever you want. Please let me know if you need anything else.

metadata {
definition(name: "My Location", namespace: "myLocation", author: "MarK Weninger") {

  capability "Actuator"

  command "setLocation", ["STRING"]

}

preferences {
input name: "enlog", type: "bool", title: "Enable Logging", description: "", required: true
}

attribute "myLat", "number"
attribute "myLon", "number"
attribute "myAcc", "number"

}

def setLocation (loc) {

if (enlog) {log.info "Location received ${loc}"}
try{
   String [] str
   str = loc.split('_')

   sendEvent(name: "myLat", value: Double.parseDouble(str[0]), displayed: true)
   sendEvent(name: "myLon", value: Double.parseDouble(str[1]), displayed: true)
   sendEvent(name: "myAcc", value: Double.parseDouble(str[2]), displayed: true)

} catch (Exception ex) {
    log.warn "Caught Exception ${ex}"
}

}

1 Like

I have a dashboard on my HOME Hubitat that I control with HD+ on my phone. I have the exact same dashboard on my TRAVEL Hubitat. How do I control the TRAVEL dashboard with my phone?

Are you asking how to control multiple hub's with HD+ or just how to connect to the other hub? The normal way to setup HD+ is to just make sure you're on the same network as your phone. Switching between 2 hubs from the app is harder but doable. I have a support page on it here: Shortcut - HD+ (Hubitat Dashboard)

version 1.0.2145 (beta)

  • add support for sending device location to hub
  • add help setting which opens support page in browser
  • Location: add option to disable showing other locations on interactive map
  • many misc map changes and fixes

Most of these changes are related to location / presence tracking in HD+. The biggest is a new feature, Location Tracking, that will send your device's location to the Hub.

Location Tracking vs Presence Tracking

I imagine these features can look similar to a lot of people so I'll try to explain the differences:

Location Tracking will send the device's coordinates (lat/lng) to your Hub. Similar to Apple's "Find My" service or Life360 -- except no 3rd party server involved. The location is only sent to your Hubitat Hub.

Presence Tracking is for setting up 1 or more geofences (areas) and only notifying the Hub if your device enters or exits those areas.

Generally speaking Presence Tracking will work for most people. You can have it monitor your Home and when you arrive or leave it'll update a Hubitat device, which can then put your Hub into 'Away' mode, enable security/etc.. and vice-versa when you arrive home.

But, if you're interested in having a devices coordinates on the Hub, this is where Location Tracking can be helpful

Setting up Location Tracking

  1. Install the "My Location" device driver on your Hub. @wecoyote5 wrote a driver which you can install either from HPM (it's not there yet but should be soon) or manually from here
  2. Create a new virtual device with "My Location" device type.. give it any name
  3. Add the new device to MakerAPI so HD+ can see it
  4. In HD+, open More Settings -> Location Tracking
  5. Make sure HD+ has all of the permissions it needs.. including Location (allow all the time), Physical activity and unrestricted battery.
  6. Select your "My Location" device to notify

permissions needed:

How it works

For now HD+ is relying 100% on Android's Physical activity API (side-note: I'm not even sure this is available on all versions of Android). It'll notify HD+ when the user is doing some kind of activity like driving/walking/etc and HD+ will fetch & send the current location to the Hub.

I tested on a Pixel 7 and was a little surprised to see fairly frequent updates being made. It's entirely possible this won't work as well on a Samsung phone but I will keep testing and can adjust the logic from there.

Because I'm relying on the Physical activity API the battery drain should be low. I'll try to add more options which can increase the frequency of updates -- but at the cost of battery life. Either way though, this feature is still a work in progress.


The other change in this version is also related to location devices. If you long-click -> edit a location device (Life360, OwnTracks, My Location) it'll give you a couple of new options:

  • Interactive Map - if checked (default) when you click on a location device it'll open an interactive Google Map where you can zoom in or change views. If unchecked, HD+ will just open a full screen static map (the same one you see on the main dashboard)
  • Show All Locations - if checked (default) when you open up the Interactive Google Map, HD+ will also show any other location devices on the map and let you switch between them. But, if you don't want to see the other devices on the map, uncheck this

Finally, I'm starting to add a new "Help" setting which will open a browser to the relevant support page. Just trying to make it a little easier to find/use.

5 Likes

I am using my phone to control a specific dashboard when at home. When I travel, I take a different Hubitat hub. On that hub I have the exact same dashboard. How do I control that dashboard when traveling?

I don't have any recent items so I can't test this at the moment.. but, try long pressing on the "Recent" section/title.. maybe that's where I put it.