Home Assistant App for Garmin

Thanks for the quick reply.

I agree it’s kind of niche and you won’t be able to display more than one or two sensor values. Also it’s just a “nice to have” thing as you can always open the app with one more click.
So if this implies breaking changes and big development effort don’t do it :slight_smile:

Follow up question: Is it possible to customize the icons for sensors? Right now it’s always the blue circle. I’d like to either customize it or remove it completely to gain some screen real estate.

PXL_20240419_062635248

Icons are limited to what we’ve already packed into the app. So the icons would you use would need to be provided at compilation time. That prevents a general solution. Remember this is a watch app, not a Windoze app.

There is one degree of freedom, you can choose Unicode characters, and they you some way to providing icons. (As you appear to have done already.)

Now the icons exist because another user requested them, and provided the source code to make it happen, and ultimately we preferred his solution aesthetically. Which meant we removed the non-icon option in the end. So I’m reluctant to back track and revert the code and bring back configuration complications. The existing icons line up the text left aligned with the toggle icon making the presentation less jagged.

As the documentation says at GitHub - house-of-abbey/GarminHomeAssistant: Garmin application to provide a dashboard to control your Home Assistant

“The application will never be as fully fledged as a Home Assistant dashboard, so it is designed to be good enough for the simple and essential things. Those things that can be activated via an on/off toggle or a tap. That should cover lights, switches, and anything requiring a single press such as an automation. For anything more complicated, e.g. thermostat, it would always be quicker and simpler to reach for your phone or tablet… or the device’s own remote control!”

Perhaps the solution here is a watch with a bigger face?

Haha yeah, never can have enough space :slight_smile:

Completely understand and from an aesthetical standpoint I’m totally on your side, once you factor in switches, scripts etc. it for sure should align vertically.

Thanks for all the work you put in so far. I’d love to contribute but unfortunately my coding knowlege is close to zero so I’m limited to testing and asking stupid questions :joy:

Hi, thanks for the app. I like it.
My watch is vivoactive 4s. Switches and taps are working like a charm. :grinning: I have problem with templates. Adding sensors ends with error HTTP 401 on the watch and hassio webgui notifies Login attempt failed
template example:

    {
      "name": "Phone",
      "type": "template",
      "content": "{{ states('sensor.xq_au52_battery_level') }}%"
    },

What should be wrong?

??

Do you mean https://house-of-abbey.github.io/GarminHomeAssistant/web/?

If so, then this is where you need to understand Home Assistant templates. Try going to your Home Assistant GUI’s “Developer Tools” → “Templates” and pasting your

{{ states('sensor.xq_au52_battery_level') }}%

code there. Does it work? If it does it should be fine in the Garmin HA app. If not, the problem is nothing to do with Garmin HA app. You need to fix your template code.

Open your Home Assistant instance and show an integration.

No, I dont. I mean Home assistant web interface.
hassio-web

In Home Assistant GUI’s “Developer Tools” → “Templates”
my code works.

It is strange.

In Home assistant web interface there is the notification:
login-failed

Is the app connected to the API? So does it say “API: Available” ?

For getting API access and trouble shooting the advice is provided here: GarminHomeAssistant/TroubleShooting.md at dec38889a550f4e99f03aa1d785442d96255c47f · house-of-abbey/GarminHomeAssistant · GitHub. Only you said the taps and switches were working, so I guess you have API access sorted.

I’m afriad I have no idea what might be different between your switches and taps and the template for your sensor.xq_au52_battery_level template.

Sorry.

Thanks @wdmnn.

@mezcalf You’re looking for the glance view like this:

Venu2_glance_start

Thanks Philip and wdmnn for your kind support.
I have solved it.
command

curl \
  -H "Authorization: Bearer TOKEN" \
  -H "Content-Type: application/json" \
  https://mydomain.com/api/states/sensor.xq_au52_battery_level

responds data.

command

curl \
  -H "Authorization: Bearer TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"template": "It is {{ now() }}!"}' https://mydomain.com/api/template

responds error 401: Unauthorized

User of the longlife token must be in administration group to template works.

Is that “solved” as in problem found or “solved” as in you have the JSON required to make it work now?

If the latter, I would be curious as to what your solution was.

The solution was setting user as a Administrator.
I dont know why api/template needs administrator permission.

Thank you. That will help other readers here.

I find it a pity that certain API calls require Administrator level access. I recall we had this problem before, I think with reporting the battery level. We found an alternative implementation in the end.

Yes, it seems that different permissions are required for evaluating templates in each of the different APIs (rest, websocket, and webhook).

Hello,

first thanks for you work, this is really a nice piece of app !

I did the setup and it is working, BUT because of course there is always a but… It would be nice if the watch could call HA without being connected to the phone via BLE. My use case is simply to open the Garage door when I come back from running, without my phone.

Up until now, I though this was impossible to get a Wifi connection without a phone being connected too (for whatever reason Garmin decided).

So I did this simple test:

  • turn off Bluetooth on phone
  • start a Spotify sync (expecting it would ask me for a phone connection)
  • And it works

So Spotify must be doing its call through another “path” maybe that allows wifi wihtout BLE ?

Any thoughts ?

I’m surprised. The reason for using Bluetooth to hop via the phone is to save battery. If the watch used Wi-Fi continuously it would run the battery down very fast. My Venu 2 watch can sync over Wi-Fi, but that’s just a brief mement not an always on connection. I’m guessing the same is true for Spotify, and hence “no”, just because you can briefly sync over Wi-Fi does not mean you can maintain an always on connection to HA to operate your garage door.

I would be happy for someone to explain otherwise. I think we’ve have a similar suggestion in the history of these posts, see Home Assistant App for Garmin - #102 by NP_Complete.

@NP_Complete brilliant work! I just thought about a Garmin app yesterday. Having dabbled in MondayC years ago (I made Trello integration - Connect IQ Store | Free Watch Faces and Apps | Garmin) I thought that would be a great project, but I doubt I’d have came up with such an elegant solution!

Q: Is there a deeper reason content is not allowed for type: 'tap'? It would save some space to have an action which also displays current state. My use case: toggling heating while displaying temperature at the same time. Currently I have to have 2 separate items for action and displaying template.
I could try to make a PR if you think it’s doable/good idea.

Is this not already covered by type template?

You can only have one tap action, so any cleverness would have to be implemented on the HA assistant side, but that’s in line with the design philosophy. (Keep the watch end simple.)

Thanks for the link. I did not see this post above.
This is good news I think because if the APIcall can make it it means it’s possible.
The code is not opensource though which could have helped.

The idea is definitely not to have Wifi always on (battery kiler), but for “actions” I think it make sense to let the watch connect to the wifi in what I’d call a oneshot.

I’m happy to help, would you have some link to that simulator you’re referencing to sometimes ?