Unfortunately, the Garmin connect iq API does not provide a method to detect sleep, so this is not possible.
Thanks, however I am not talking about getting sleep data into HA. Only a binary sensor that tell me if Sleep mode is on or off. But probably not?
Hey, I’m fairly new to HA need help with my setup
I entered the api token, api url and the path to the json file. it says on my watch
API: Available
Menu: Unavailable
When I tap on it it says “No JSON returned from HTTPS request”
I used the web-based editor to find something out of the troubleshooting guides this is what it says in test API: API running.
test Menu: “Check CORS settings on HomeAssistant server.”
I use the HA Cloud, my file is in /homeassistant/garmin/garmin.json
I think there is something wrong with my json file.
I don’t know what to check in the CORS setting.
Firstly, thank you for reading the trouble shooting guide before posting.
When using the web editor did you check the initial banner?
GarminHomeAssistant Web Editor
This is the web editor for the GarminHomeAssistant watch app, it offers enhanced schema checking and validation over the original JSON schema by using the HomeAssistant API to create a schema based on your HomeAssistant configuration.
This editor makes use of the same credentials as the watch app (these can be pasted in the top bar of this page). However in order for this editor to work, you will need to amend the CORS settings of your HomeAssistant instance. Add this to your configuration.yaml file:
http: cors_allowed_origins: - https://house-of-abbey.github.io
Once you have added this to your configuration.yaml file, you will need to restart HomeAssistant. After HomeAssistant is restarted, reload this page.
: [and more]
I suspect that’s the source of the “Check CORS settings on HomeAssistant server.” error.
You can return to that banner and the fuller text by clicking the (i)
button in the top right corner.
That should get the web editor working. But as for the menu URL itself, you should be able to view that in a standard web browser. If you can’t then the URL is inaccessible, meaning, in the wrong location, or an area the web server cannot serve files from. So you need to fix the menu file location. Once you’ve made the file accessible via the URL (correct location on the webserver and correct URL), you can then use the web editor to check it against the JSON schema we supply. But you might like to verify the JSON file format a standard format checker too (with or without the schema).
Thanks for your answer.
I have the http line in my configuration.yaml and then I restarted the system
# Loads default set of integrations. Do not remove.
default_config:
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
http:
cors_allowed_origins:
- https://house-of-abbey.github.io
This is my garmin.json
{
"$schema": "https://raw.githubusercontent.com/house-of-abbey/GarminHomeAssistant/main/config.schema.json",
"title": "Home",
"items": [
{
<my-items>
}
]
}
I have tried different URLs.
https://.ui.nabu.casa/garmin.json,
https://.ui.nabu.casa/homeassistant/garmin/garmin.json
It says:
Test API: API running.
Test Menu: “Check CORS settings on HomeAssistant server.”
Yes, the file was probably in the wrong place, but when I click on the arrow in the top left corner, nothing happens. So can I just put the .json file there?
I use the File Editor Add-on.
It looks as if your JSON menu file is not accessible at the URL you are using. You need to amend the URL or the file location (or both). For example:
/config/www/garmin/<file>.json
maps to https://<domain>/local/garmin/<file>.json
This is covered in the basic setup in the README.md → Dashboard Definition.
Note I am not using Nabu Casa. There is a note on that page subsequently about changes to Nabu Casa that have been reported but which the authors are unable to verify:
Important
However recent reports suggest this path may no longer work on Nabu Casa and you should use
/homeassistant/www/
instead of/config/www/
. We are unable to verify this since our free trial of Nabu Casa has expired.
If this report is correct then try:
/homeassistant/www/garmin/<file>.json
mapping to https://<domain>/local/garmin/<file>.json
Just a small refinement in the setup that’s occured. Once you get the file location correct, the online editor will be able to fetch your menu file via the arrow button. I expect this is why your watch gets no menu too.
Thank you!!, that helped me a lot.
/homeassistant/www/garmin/<file>.json
mapping tohttps://<domain>/local/garmin/<file>.json
Apparently I didn’t read carefully…
Now I just have to fix my .json because there are a lot of errors in it but I just reduced it to a minimum and then it finally worked
Happy New Year!
Definitely best to start small and simple and work up as the confidence builds.
Glad you are now on your way, Happy New Year to you too!
Hello.
New to Garmim and this app. I followed the setup instructions anda managed to install the app and get my (test) menu in the app (2 lights). However when I try toggle the light nothing happens. The clock vibrates ackowldge my tap but the light does not turn on/off and the icon remains the same in the watch face. I tried with different entities but without success. Any tip for what may be worng? Thank You
Please confirm you have completed the troubleshooting guide.
If you want more detailed help, you will have to share your menu configuration. I have no idea what your menu definition looks like, and how it might differ from the examples we have provided via our general documentation.
Hey, just trying to set this up. Got it working now. One thing I’m wondering though:
The setup guide recommends to put the config json into HAs own web server to make it accessible via https://<url>/local/germin/<something>.json
. My issue with that is that this makes the file publicly available without authentication and it contains somewhat sensitive information about entity ids and such. Am I missing something?
Correct, the menu file is public and users accept this risk.
Here the security is with the Home Assistant “Long-Lived Access Token” which is what enables only the authorised users to effect changes. Otherwise the security of the menu item IDs is managed via obscurity.
Its a bit like when you give your bank details out for people to pay you for services rendered, they can’t extract money with those details as that requires additional authorisation.
However the question as posed has sparked a thought by my co-author. Check back later there’s an experiment brewing.
Yes I read the troubleshoot. Maybe i miss something important…
Here is my json file
{
"$schema": "https://raw.githubusercontent.com/house-of-abbey/GarminHomeAssistant/main/config.schema.json",
"title": "Home",
"items": [
{
"entity": "light.west_office",
"name": "Attic Light",
"type": "toggle"
},
{
"entity": "switch.edp_withus_zb_smartplug_1_0_0_switch_3",
"name": "Dishwasher",
"type": "toggle"
}
]
}```
Just experimented with basic HTTP authentication, using this python script Python3 http.server supporting basic HTTP Auth (username/password) · GitHub. Unfortunately setting up public SSL for my a HTTP server on laptop would be necessary to test it because of Garmin’s requirements for HTTP.
python3 .\py_http.py --username hello --password world
The URL that you put in to the settings would then look like:
http://hello:world@localhost:8000/config.json
I have not tested this on the watch because of SSL but if Garmin supports that format of URL then it should just work with the current version of the app.
Does the dishwasher menu item work? If so, then the problem is with you entity ID for the light. Does the web editor find your entities without any problems?
None of them work. I tried different entities, same result. Yes, the webeditor find the entities
Looking at the source code here: GarminHomeAssistant/source/HomeAssistantToggleMenuItem.mc at 816f2e6399c4a5c75bfdb145b58f600f337f3da1 · house-of-abbey/GarminHomeAssistant · GitHub, the API call will translate to:
Communications.makeWebRequest(
url, // "<API URL>/services/light/turn_on" or "<API URL>/services/switch/turn_on"
mData, // key = "entity_id" (Lang.String), value = "light.west_office" (Lang.String)
{
:method => Communications.HTTP_REQUEST_METHOD_POST,
:headers => {
"Content-Type" => Communications.REQUEST_CONTENT_TYPE_JSON,
"Authorization" => "Bearer " + Settings.getApiKey()
},
:responseType => Communications.HTTP_RESPONSE_CONTENT_TYPE_JSON
},
method(:onReturnSetState)
);
That means the service or action light.turn_on
must be called on light.west_office
. Can you check that does work in the “Developer Tools”? (Developer Tools → Actions) If not, then we can confirm the source of the problem is in your HA setup.
Now that the template type is deprecated, which should be the right syntax for an entry showing info, without any expected action (such as showing room temperature and humidity)? A “tap” entry with an empty tap_action section? Even though that shows a warning?
If you are using an iPhone there is a known problem, see GarminHomeAssistant/README.md at main · house-of-abbey/GarminHomeAssistant · GitHub and reports above in this thread.
Clutching at straws here…
Are you able to verify that your watch can actually see the Home Assistant? Is there a confirmation that the API is available, e.g. via the glance. (Yes I know, you’ve probably already verified this but forgive me for asking as I’m struggling.)
This is going to need more thought, sorry.