mirror of
https://github.com/house-of-abbey/GarminHomeAssistant.git
synced 2025-12-25 15:18:15 +00:00
Compare commits
6 Commits
0584fa4bce
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6149098d25 | ||
|
|
fd2a07e6eb | ||
|
|
5eabea49a9 | ||
|
|
043292d753 | ||
|
|
fb799ebdac | ||
|
|
1e79be594e |
13
README.md
13
README.md
@@ -56,6 +56,15 @@ The following table lists the differences in functionality between the two. The
|
|||||||
|
|
||||||
## Dashboard Definition
|
## Dashboard Definition
|
||||||
|
|
||||||
|
> [!IMPORTANT]
|
||||||
|
> Remember, you are expecting to define a customised menu making use of several options using your Home Assistant's custom entities on a small (portable) device. **There is no "_simple_" way to configure the menu with the ever increasing options demanded by the user community.** Was your Home Assistant trivial to setup? No!
|
||||||
|
>
|
||||||
|
> Therefore as developers we have two options:
|
||||||
|
> 1. Assistance via menu driven configuration with nested menus on a small screen whose implementation would expand the code beyond the capacity of smaller devices, or
|
||||||
|
> 2. As we have opted here, for assistance via some external configuration that is driven by code and can be authored using a more fully functional desktop or laptop PC.
|
||||||
|
>
|
||||||
|
> Review comments like "_The setup is not trivial_" and "_Configuration is indeed not easy, unforgiving, and requires careful reading of the documentation_" fail to respect the enormity of the task you as a user are expecting to achieve for your own menu. Such comments are more a reflection of the user's disproportionately high expectation of a small watch (portable device) application with no mouse, no keyboard and a limited user interface, hence I hope you will agree they are poorly considered given the functionality that has been achieved. For the purposes of menu customisation, please reign your expectations in and _be realistic_. And yes, please do read the documentation please before contacting for support as its volunteer time robbed out of family time.
|
||||||
|
|
||||||
Setup for this menu is more complicated than the Connect IQ settings menu really allows you to specify. In order to make the dashboard easily configurable and easy to change, we have provided an external mechanism for specifying the menu layout, a JSON file you write, retrieved from a URL you specify. JSON was chosen over YAML because Garmin can parse JSON HTTP GET responses into its own internal dictionary, it cannot parse YAML, hence a choice of one really. Note that JSON and YAML are essentially a 1:1 format mapping except JSON does not have comments. We recommend you take advantage of [HomeAssistant's own web server](https://www.home-assistant.io/integrations/http/#hosting-files) to provide the JSON definition. The advantages of this are:
|
Setup for this menu is more complicated than the Connect IQ settings menu really allows you to specify. In order to make the dashboard easily configurable and easy to change, we have provided an external mechanism for specifying the menu layout, a JSON file you write, retrieved from a URL you specify. JSON was chosen over YAML because Garmin can parse JSON HTTP GET responses into its own internal dictionary, it cannot parse YAML, hence a choice of one really. Note that JSON and YAML are essentially a 1:1 format mapping except JSON does not have comments. We recommend you take advantage of [HomeAssistant's own web server](https://www.home-assistant.io/integrations/http/#hosting-files) to provide the JSON definition. The advantages of this are:
|
||||||
|
|
||||||
1. the file is as public as you make your HomeAssistant,
|
1. the file is as public as you make your HomeAssistant,
|
||||||
@@ -303,7 +312,7 @@ A future move to v3.x will remove support for all deprecated JSON elements to si
|
|||||||
## Editing the JSON file
|
## Editing the JSON file
|
||||||
|
|
||||||
You have options. The first is what we use.
|
You have options. The first is what we use.
|
||||||
1. **Best!** Use the GarminHomeAssistant [Web-based Editor](https://house-of-abbey.github.io/GarminHomeAssistant/web/) which includes `entity` and `action` name completion and validation by fetching data from your own HomeAssistant instance. _Pretty nifty eh?_ The other method listed below do not add this convenience and checking.
|
1. **Best!** Use the GarminHomeAssistant [Web-based Editor](https://house-of-abbey.github.io/GarminHomeAssistant/web/) which includes `entity` and `action` name completion and validation by fetching data from your own HomeAssistant instance. _Pretty nifty eh?_ The other method listed below do not add this convenience and checking. NB. This has been tested in Microsoft Edge, Chrome and Firefox.
|
||||||
2. Use the [Studio Code Server](https://community.home-assistant.io/t/home-assistant-community-add-on-visual-studio-code/107863) addon for HomeAssistant. You can then edit your JSON file in place.
|
2. Use the [Studio Code Server](https://community.home-assistant.io/t/home-assistant-community-add-on-visual-studio-code/107863) addon for HomeAssistant. You can then edit your JSON file in place.
|
||||||
3. Locally installed VSCode, or if not installed, try
|
3. Locally installed VSCode, or if not installed, try
|
||||||
4. The on-line version at https://vscode.dev/, which works really well.
|
4. The on-line version at https://vscode.dev/, which works really well.
|
||||||
@@ -395,7 +404,7 @@ Its obvious that a toggle menu item has been triggered as the visible switch cha
|
|||||||
|
|
||||||
<img src="images/SimTapResponse.png" width="400" title="Tap Triggered"/>
|
<img src="images/SimTapResponse.png" width="400" title="Tap Triggered"/>
|
||||||
|
|
||||||
The application will display a 'toast' showing HomeAssistant's friendly name of the triggered item. The toast will disappear after a short while if not dismissed by the user. N.B. There are reports that on the Forerunner 55 device, the toasts do not dissapear without manual intervention. On other devices like the Venu 2 the toast can take 15 seconds to dissappear if not dismissed. Unfortunately, there is no API call to change this behaviour.
|
The application will display a 'toast' showing HomeAssistant's friendly name of the triggered item. The toast will disappear after a short while if not dismissed by the user. N.B. There are reports that on the Forerunner 55 device, the toasts do not disappear without manual intervention. On other devices like the Venu 2 the toast can take 15 seconds to disappear if not dismissed. Unfortunately, there is no API call to change this behaviour.
|
||||||
|
|
||||||
## External Device Changes
|
## External Device Changes
|
||||||
|
|
||||||
|
|||||||
@@ -6,12 +6,12 @@
|
|||||||
|
|
||||||
Before [raising an issue](https://github.com/house-of-abbey/GarminHomeAssistant/issues) about a possible bug, _please, please_ check your JSON is compliant with both the JSON format and our schema. To do this you have options. The first is what we use.
|
Before [raising an issue](https://github.com/house-of-abbey/GarminHomeAssistant/issues) about a possible bug, _please, please_ check your JSON is compliant with both the JSON format and our schema. To do this you have options. The first is what we use.
|
||||||
|
|
||||||
1. **Best!** Use the GarminHomeAssistant [Web-based Editor](https://house-of-abbey.github.io/GarminHomeAssistant/web/) which includes `entity` and `service` name completion and validation by fetching data from your own HomeAssistant instance. _Pretty nifty eh?_ The other methods listed below do not add this convenience and checking.
|
1. **Best!** Use the GarminHomeAssistant [Web-based Editor](https://house-of-abbey.github.io/GarminHomeAssistant/web/) which includes `entity` and `service` name completion and validation by fetching data from your own HomeAssistant instance. _Pretty nifty eh?_ The other methods listed below do not add this convenience and checking. NB. This has been tested in Microsoft Edge, Chrome and Firefox.
|
||||||
2. Use the [Studio Code Server](https://community.home-assistant.io/t/home-assistant-community-add-on-visual-studio-code/107863) addon for HomeAssistant. You can then edit your JSON file in place.
|
2. Use the [Studio Code Server](https://community.home-assistant.io/t/home-assistant-community-add-on-visual-studio-code/107863) addon for HomeAssistant. You can then edit your JSON file in place.
|
||||||
3. Locally installed VSCode, or if not installed, try
|
3. Locally installed VSCode, or if not installed, try...
|
||||||
4. The on-line version at https://vscode.dev/, which works really well. Paste in your JSON (and change the file type to JSON if not saving), it will then verify your file format and schema for you, highlighting any errors for you to fix.
|
4. The on-line version at https://vscode.dev/, which works really well. Paste in your JSON (and change the file type to JSON if not saving), it will then verify your file format and schema for you, highlighting any errors for you to fix.
|
||||||
|
|
||||||
A failure to get the file format right tends to mean that the response to the application errors with `INVALID_HTTP_BODY_IN_NETWORK_RESPONSE` (code of -400). This means the response did not contain JSON, it was probably an error message in plain text that could not be parsed by the Connect IQ API call. See [Toybox.Communications](https://developer.garmin.com/connect-iq/api-docs/Toybox/Communications.html) for the list of error code you might be presented with on your device.
|
A failure to get the file format right tends to mean that the application displays _"No JSON returned from HTTP request"_ and internally the network response errors with `INVALID_HTTP_BODY_IN_NETWORK_RESPONSE` (code of -400). See [Toybox.Communications](https://developer.garmin.com/connect-iq/api-docs/Toybox/Communications.html) if you are presented with an error code on your device screen. Alternatively this might instead mean the response did not contain JSON, as it was probably an error message in plain text that could not be parsed as JSON by the Connect IQ API call.
|
||||||
|
|
||||||
There are some cases where the file format may be valid JSON, but invalid against the schema, and the failure to catch this error could cause the application to crash. Whilst we have taken care to manage many issues, there may still be cases that are uncaught.
|
There are some cases where the file format may be valid JSON, but invalid against the schema, and the failure to catch this error could cause the application to crash. Whilst we have taken care to manage many issues, there may still be cases that are uncaught.
|
||||||
|
|
||||||
@@ -317,7 +317,11 @@ JSON for copy & paste:
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
When the application persists in reporting _"No JSON returned from HTTP request"_ this might be due to a mismatch between the Webhook ID and the device settings on the HomeAssistant server. We have discovered that the Webhook ID is required for HomeAssistant API calls with templates in order to work in a non-privileged account. The application options include the ability to clear the Webhook ID in the application forcing a new one to be set up. This should prevent the above error being shown on startup.
|
When the application persists in reporting _"No JSON returned from HTTP request"_ this might be:
|
||||||
|
|
||||||
|
1. Because there's a syntax or scheme conformance error in the JSON menu. Please [verify your JSON menu](#check-your-json-schema) file using the web-based Editor.
|
||||||
|
|
||||||
|
2. Due to a mismatch between the Webhook ID and the device settings on the HomeAssistant server. We have discovered that the Webhook ID is required for HomeAssistant API calls with templates in order to work in a non-privileged account. The application options include the ability to clear the Webhook ID in the application forcing a new one to be set up. This should prevent the above error being shown on startup.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|||||||
@@ -119,7 +119,26 @@ If you would like to temporarily disable an item in your menu, e.g. for seasonal
|
|||||||
|
|
||||||
# Selects
|
# Selects
|
||||||
|
|
||||||
Here is an example of how to make a light effect selector:
|
An example of using a `select` service. In this example, the `tap` item allows you to pick the mode of your EV charger. The code snippet asks Home Assistant to cycle to the next mode every time the menu item is pressed.
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"name": "SmartEVSE Mode",
|
||||||
|
"content": "{{ states('select.smartevse_mqtt_mode') }}",
|
||||||
|
"type": "tap",
|
||||||
|
"tap_action": {
|
||||||
|
"service": "select.select_next",
|
||||||
|
"data": {
|
||||||
|
"entity_id": "select.smartevse_mqtt_mode",
|
||||||
|
"cycle": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Try the same pattern for any selector `input_select.*`, `select.*`, `climate.*` mode? With thanks to @[arobaZ](https://community.home-assistant.io/u/arobaZ) for the above example.
|
||||||
|
|
||||||
|
Here's another example of how to make a light effect selector using a `group` menu item with explicitly defined menu items below it:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
@@ -176,8 +195,6 @@ Here is an example of how to make a light effect selector:
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
The same pattern works for any selector (`input_select.*`, `select.*`, `climate.*` mode).
|
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
With thanks to Matthias Oesterheld, [moesterheld](https://github.com/moesterheld) for contributing the PIN feature.
|
With thanks to Matthias Oesterheld, [moesterheld](https://github.com/moesterheld) for contributing the PIN feature.
|
||||||
|
|||||||
Reference in New Issue
Block a user