mirror of
https://github.com/house-of-abbey/GarminHomeAssistant.git
synced 2025-06-17 03:48:32 +00:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
f2fb7f65a0 | |||
1e103069bc | |||
520309729d | |||
d2aec16811 | |||
a424e35784 | |||
5558e25bda |
@ -29,3 +29,4 @@
|
||||
| 2.14 | Cautionary bug fix for the background service code where refactorisation spoilt some API level guard clauses. |
|
||||
| 2.15 | Better support for templates by isolating erroneous returns and marking the menu item. |
|
||||
| 2.16 | Bug fix for lack of phone connection when starting the application. Includes new activity reporting features from [KPWhiver](https://github.com/KPWhiver) covering steps, heart rate, floors climbed and descended, and respiration rate. |
|
||||
| 2.17 | Bug fix for reporting activity metrics that are not found on some devices. |
|
||||
|
10
README.md
10
README.md
@ -25,6 +25,16 @@ As of version 2.0, there are now two installable versions. For older devices bef
|
||||
| Application (original) | For newer devices that allow glance views in their applications, e.g. Venu 2, the GarminHomeAssistant application can be started either from a glance or from the list of applications and activities. Head over to the [GarminHomeAssistant](https://apps.garmin.com/en-US/apps/61c91d28-ec5e-438d-9f83-39e9f45b199d) application page on the [Connect IQ application store](https://apps.garmin.com/en-US/) to download the application. The application can be started two different ways, either from the glance in the carousel, or as an application from the list of applications & activities. With the latter, it is worth marking the application as a favourite.<br/><img src="images/Venu2_app_start.png" width="200" title="Venu 2" style="margin:5px"/><img src="images/Vivoactive3_app_start.jpg" width="200" title="Venu 2" style="margin:5px"/><br/>If you place the application on your list of favourites, and rearrange it to appear near the top, then the item is just one button press away from the watch face. This second picture here shows the application menu on a Vivoactive 3 watch.<br/><img src="images/Venu2_glance_start.png" width="200" title="Venu 2" style="margin:5px"/><br/>On newer watches, you can also start the application from the glance carousel. The glance view here typically displays some trackable status, so ours provides some early indication of availability. Older watches will still allow you to start this application from the list of applications and activities. |
|
||||
| Widget | **"Maintenance only mode"** so no new features will be added to this version.<br>For older devices that use widgets, e.g. Venu (1) as opposed to applications with "glances", the GarminHomeAssistant application can instead be started from the widget carousel. This is a separate item in the Connect IQ AppStore and with this installation, the application will no longer appear in the list of applications and activities. Head over to the [GarminHomeAssistant](https://apps.garmin.com/en-US/apps/) widget page on the [Connect IQ application store](https://apps.garmin.com/en-US/) to download the widget.<br/><img src="images/Venu_Widget_sim.png" width="200" title="Venu 2" style="margin:5px"/><br/>Typically the widget view implements something similar to the glance view, e.g. status, and exists in a widget carousel to allow you to select an application to launch.<br>**Please note that memory in widgets is more limited than applications. This means a large menu definition can crash the widget without the code catching the error.**<br> This version was born out of the application version and from Ver 2.0 shared the same source code repository until Ver 2.8 when they were [separated](https://github.com/house-of-abbey/GarminHomeAssistantWidget) to allow the application version to take advantage of its increase memory availability. |
|
||||
|
||||
### Features
|
||||
|
||||
The following table lists the differences in functionality between the two. The Widget version is more limited due to memory constraints. As such new features are only being added to the Application.
|
||||
|
||||
| Feature | Application | Widget |
|
||||
|---------|-------------|--------|
|
||||
| Vibration | Optional setting | Always on |
|
||||
| "Always on" support | Slow refresh option to reduce batter demand | No available |
|
||||
| Metric reporting | Fuller, includes: activity, sub-activity, battery, charging, steps, heart rate, floors ascended and descended, respiration rate | Basic, includes: activity, sub-activity, battery only. |
|
||||
|
||||
### Source Code Repositories
|
||||
|
||||
* [Application](https://github.com/house-of-abbey/GarminHomeAssistant)
|
||||
|
@ -150,20 +150,26 @@ class BackgroundServiceDelegate extends System.ServiceDelegate {
|
||||
"type" => "sensor",
|
||||
"unique_id" => "heart_rate",
|
||||
"icon" => "mdi:heart-pulse"
|
||||
},
|
||||
{
|
||||
}
|
||||
];
|
||||
|
||||
if (ActivityMonitor.Info has :floorsClimbed) {
|
||||
data.add({
|
||||
"state" => activityInfo.floorsClimbed == null ? "unknown" : activityInfo.floorsClimbed,
|
||||
"type" => "sensor",
|
||||
"unique_id" => "floors_climbed_today",
|
||||
"icon" => "mdi:stairs-up"
|
||||
},
|
||||
{
|
||||
});
|
||||
}
|
||||
|
||||
if (ActivityMonitor.Info has :floorsDescended) {
|
||||
data.add({
|
||||
"state" => activityInfo.floorsDescended == null ? "unknown" : activityInfo.floorsDescended,
|
||||
"type" => "sensor",
|
||||
"unique_id" => "floors_descended_today",
|
||||
"icon" => "mdi:stairs-down"
|
||||
}
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
if (ActivityMonitor.Info has :respirationRate) {
|
||||
data.add({
|
||||
|
@ -208,7 +208,7 @@ class WebhookManager {
|
||||
|
||||
function registerWebhookSensors() {
|
||||
var activityInfo = ActivityMonitor.getInfo();
|
||||
var heartRate = Activity.getActivityInfo().currentHeartRate;
|
||||
var heartRate = Activity.getActivityInfo().currentHeartRate;
|
||||
|
||||
var sensors = [
|
||||
{
|
||||
@ -224,23 +224,23 @@ class WebhookManager {
|
||||
"disabled" => !Settings.isSensorsLevelEnabled()
|
||||
},
|
||||
{
|
||||
"device_class" => "battery_charging",
|
||||
"name" => "Battery is Charging",
|
||||
"state" => System.getSystemStats().charging,
|
||||
"type" => "binary_sensor",
|
||||
"unique_id" => "battery_is_charging",
|
||||
"icon" => System.getSystemStats().charging ? "mdi:battery-plus" : "mdi:battery-minus",
|
||||
"entity_category" => "diagnostic",
|
||||
"disabled" => !Settings.isSensorsLevelEnabled()
|
||||
"device_class" => "battery_charging",
|
||||
"name" => "Battery is Charging",
|
||||
"state" => System.getSystemStats().charging,
|
||||
"type" => "binary_sensor",
|
||||
"unique_id" => "battery_is_charging",
|
||||
"icon" => System.getSystemStats().charging ? "mdi:battery-plus" : "mdi:battery-minus",
|
||||
"entity_category" => "diagnostic",
|
||||
"disabled" => !Settings.isSensorsLevelEnabled()
|
||||
},
|
||||
{
|
||||
"name" => "Steps today",
|
||||
"state" => activityInfo.steps == null ? "unknown" : activityInfo.steps,
|
||||
"type" => "sensor",
|
||||
"unique_id" => "steps_today",
|
||||
"icon" => "mdi:walk",
|
||||
"state_class" => "total",
|
||||
"disabled" => !Settings.isSensorsLevelEnabled()
|
||||
"name" => "Steps today",
|
||||
"state" => activityInfo.steps == null ? "unknown" : activityInfo.steps,
|
||||
"type" => "sensor",
|
||||
"unique_id" => "steps_today",
|
||||
"icon" => "mdi:walk",
|
||||
"state_class" => "total",
|
||||
"disabled" => !Settings.isSensorsLevelEnabled()
|
||||
},
|
||||
{
|
||||
"name" => "Heart rate",
|
||||
@ -251,27 +251,32 @@ class WebhookManager {
|
||||
"unit_of_measurement" => "bpm",
|
||||
"state_class" => "measurement",
|
||||
"disabled" => !Settings.isSensorsLevelEnabled()
|
||||
},
|
||||
{
|
||||
"name" => "Floors climbed today",
|
||||
"state" => activityInfo.floorsClimbed == null ? "unknown" : activityInfo.floorsClimbed,
|
||||
"type" => "sensor",
|
||||
"unique_id" => "floors_climbed_today",
|
||||
"icon" => "mdi:stairs-up",
|
||||
"state_class" => "total",
|
||||
"disabled" => !Settings.isSensorsLevelEnabled()
|
||||
},
|
||||
{
|
||||
"name" => "Floors descended today",
|
||||
"state" => activityInfo.floorsDescended == null ? "unknown" : activityInfo.floorsDescended,
|
||||
"type" => "sensor",
|
||||
"unique_id" => "floors_descended_today",
|
||||
"icon" => "mdi:stairs-down",
|
||||
"state_class" => "total",
|
||||
"disabled" => !Settings.isSensorsLevelEnabled()
|
||||
}
|
||||
];
|
||||
|
||||
if (ActivityMonitor.Info has :floorsClimbed) {
|
||||
sensors.add({
|
||||
"name" => "Floors climbed today",
|
||||
"state" => activityInfo.floorsClimbed == null ? "unknown" : activityInfo.floorsClimbed,
|
||||
"type" => "sensor",
|
||||
"unique_id" => "floors_climbed_today",
|
||||
"icon" => "mdi:stairs-up",
|
||||
"state_class" => "total",
|
||||
"disabled" => !Settings.isSensorsLevelEnabled()
|
||||
});
|
||||
}
|
||||
|
||||
if (ActivityMonitor.Info has :floorsDescended) {
|
||||
sensors.add({
|
||||
"name" => "Floors descended today",
|
||||
"state" => activityInfo.floorsDescended == null ? "unknown" : activityInfo.floorsDescended,
|
||||
"type" => "sensor",
|
||||
"unique_id" => "floors_descended_today",
|
||||
"icon" => "mdi:stairs-down",
|
||||
"state_class" => "total",
|
||||
"disabled" => !Settings.isSensorsLevelEnabled()
|
||||
});
|
||||
}
|
||||
|
||||
if (ActivityMonitor.Info has :respirationRate) {
|
||||
sensors.add({
|
||||
@ -287,14 +292,15 @@ class WebhookManager {
|
||||
}
|
||||
|
||||
if (Activity has :getProfileInfo) {
|
||||
var activity = Activity.getProfileInfo().sport;
|
||||
var activity = Activity.getProfileInfo().sport;
|
||||
var sub_activity = Activity.getProfileInfo().subSport;
|
||||
|
||||
if ((Activity.getActivityInfo() != null) and
|
||||
((Activity.getActivityInfo().elapsedTime == null) or
|
||||
(Activity.getActivityInfo().elapsedTime == 0))) {
|
||||
// Indicate no activity with -1, not part of Garmin's activity codes.
|
||||
// https://developer.garmin.com/connect-iq/api-docs/Toybox/Activity.html#Sport-module
|
||||
activity = -1;
|
||||
activity = -1;
|
||||
sub_activity = -1;
|
||||
}
|
||||
sensors.add({
|
||||
|
Reference in New Issue
Block a user