home-assistant / android

:iphone: Home Assistant Companion for Android
https://companion.home-assistant.io/
Apache License 2.0
2.22k stars 618 forks source link

Set default server for lovalace interface. When using multiple servers. #3738

Open biscuit-316 opened 1 year ago

biscuit-316 commented 1 year ago

Is your feature request related to a problem? Please describe.

I manage three Home Assistant instances. One at home, an two at my families. The possibility to have all three of them inside the Home assistant app, is fantastic. All three instances use mostly the entities card. Which gives them a similar appearance.

Some time ago when I was busy. And I wanted to quickly turn on the lights in the Livingroom. I opened the app. I turned on all the lights in my Livingroom, but nothing happened. I tried it again. But still nothing happened. When I looked why the lights didn’t respond. I realised that the Home Assistant app wasn’t showing my Lovelace dashboard. I had toggled the lights at my family’s home.

Describe the solution you'd like

I would like to be able to select an default Home assistant server for the Lovelace dashboard. If it is possible, I would like it to have those three options:

One: There is no default server. Home Assistant opens the last server you used. Just like it is now.

Two: You select an default server. Every time you open the app, it automatically opens the Lovelace dashboard on the selected server.

Three: Show the Lovelace dashboard of the Home assistant server which is currently using the internal url. If there is no server connected through the internal url than open the selected default server.

Personally I use the app mostly for my own Home Assistant. I only use the app with my family’s Home Assistant when I’m at my family’s home. Which makes the third option very useful.

Describe alternatives you've considered, if any

Another option could be that you can enable a boolean within the server settings in the app.

Turn on the boolean, Home assistant will use this server by default. Turn off the boolean and Home Assistant will use the last used server. which are actually function one and two mentioned above.

Additional context

I just have no idea how option three should work if multiple home assistants are using the internal url.

dshokouhi commented 1 year ago

Have you considered using the shortcut feature to create launcher icons for each server and open those? Might be a decent work around while the specifics of the request are considered.

biscuit-316 commented 1 year ago

Have you considered using the shortcut feature to create launcher icons for each server and open those? Might be a decent work around while the specifics of the request are considered.

Honestly, I didn't know those shortcuts existed. But they look like a good workaround. The only drawback I've found so far is that they open the loveloce shortcut in a specific location. instead of the location where you left off. But still they look very useful. Thank you for mentioning.

dshokouhi commented 1 year ago

The only drawback I've found so far is that they open the loveloce shortcut in a specific location. instead of the location where you left off.

given the feature request I am not sure if you will be taken to the last viewed dashboard on that server. When the app switches servers it generally loads the default dashboard. Loading the old state is something android does, given the app hasn't crashed.

Medformatik commented 6 months ago

My problem is similar to this one. I live in two different cities, so I have two Home Assistant servers. It would be great if the app would always show the correct server when I am at home in one of the two locations (either via GPS or internal/external connection). When I'm away, the last used server can be displayed.

raindropworks commented 1 month ago

My problem is similar to this one. I live in two different cities, so I have two Home Assistant servers. It would be great if the app would always show the correct server when I am at home in one of the two locations (either via GPS or internal/external connection). When I'm away, the last used server can be displayed.

This is exactly what I was thinking about. Both HA servers are already pulling GPS polling data to track geofencing, and both HA servers have the ability to push notifications to the app to send notifications to the phone.

Expanding this to something like:

trigger:
  - platform: zone
    entity_id: device_tracker.sm_s918u
    zone: zone.home
    event: enter

(an existing automation start that I use to track when I come home to turn lights on)

then app.companion.server: home to set that mode (assume that my server names in the app are 'home' and 'sister'