Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accommodate multiple instances of Home Assistant from the app. #161

Closed
swperic opened this issue Oct 5, 2018 · 124 comments
Closed

Accommodate multiple instances of Home Assistant from the app. #161

swperic opened this issue Oct 5, 2018 · 124 comments

Comments

@swperic
Copy link

swperic commented Oct 5, 2018

Accommodate multiple instances of Home Assistant from the app.
It would be great to be able to save multiple URLs for Home, Office, Studio and be able to get notifications from all that are "enabled". I love the iOS app!

ps. sorry I cant figure out how to tag this as a feature request

@jchasey
Copy link

jchasey commented Oct 15, 2018

Would like to second this feature request!

@robbiet480
Copy link
Member

While we are closer to being able to implement this thanks to the overhaul done in 1.5.0, I would still have to say that it's probably pretty unlikely this ever gets implemented unless I hear a lot of feedback requesting it. And I totally understand how frustrating this is as my parents use SmartThings + Alexa which only supports one location. It would just be a ton of work to rebuild everything to support multiple locations. Apologies.

@jchasey
Copy link

jchasey commented Oct 15, 2018

Thanks for the honest feedback. Would there be an easier approach which is to have at least multiple config options and you can switch between them in the app, ie only one would be live at one time?

@robbiet480
Copy link
Member

This is probably more trouble that it will be worth, but when we start beta testing of 2.0.0 you will be able to have the beta app and released app installed side by side without having conflicting data or any links between the two. You could set up each one for a different location.

@Scirpus22
Copy link

This is must have feature! Would love to see it in future

@Pre10der
Copy link

Pre10der commented May 28, 2019

I would like to weigh in on this. A lot of work yes, I get it, but this has become critical for me for a couple of reasons. It can provide the ability to run discrete HA instances on seperate RPis within my own home to balance out particular functions that can’t all run on a single Pi. The app would act as an aggregation point. Additionally, i have installed multiple HA deployments across other family members homes, and we would like to to be able to share access and leverage the device-tracking integration that app provides. This is even more pertinent given that the HA user security model is moving towards a privileged based approach (users vs. administrators).
So, supporting multiple instances within the app isn’t just about multiple HA deployments, it’s also about the app supporting multiple user contexts within a single HA deployment without logging in and out...painful with OTP enabled.

@maxx
Copy link

maxx commented Aug 7, 2019

👍 for this.

one instance for home, and one for commercial.

@LAltinell
Copy link

Also want to vote up this feature! I believe this to be a crucial part of supporting the upcoming v1 release of Home Assistant. With that said, I very much respect your opinion in this matter!

@amcox
Copy link

amcox commented Sep 20, 2019

I would also like to request this feature. I have HA installations at my vacation home as well as full time home.

Even the ability to quickly switch between instances and remember login information from within the app, rather than integrating multiple locations into one interface, would be very helpful.

Thank you.

@matteofranceschini
Copy link

Even the ability to quickly switch between instances and remember login information from within the app, rather than integrating multiple locations into one interface, would be very helpful.

This would be more than enough! I'd love that!

@nickb512
Copy link

I have finally finished migrating my house to HA from ST and was about to start migrating the other properties I look after (parents house, holiday home, mobile home) but this is a major barrier. I won’t be able to get native push notifications from my home while I’m at the holiday home?

Never thought I would say this, but I guess the others will have to stay on ST :(

@gianky69
Copy link

gianky69 commented Nov 5, 2019

This would be great!

@treetopsflyer
Copy link

This request Is a critical feature. Many people who would automate a home will likely need multiple instances. Examples would be vacation home, parent’s home, business, ect. In my case it’s an airplane hangar.

The reason it’s crucial is for monitoring/notifications at a location not visited every day. Be it security, smoke, water leak, ect, many have set up HA to alert us of these critical things as a self-monitored system. Not having this ability really cripples the entire idea of automation providing peace of mind as well as control.

@jes1417
Copy link

jes1417 commented Nov 19, 2019

@maxx came here for this!

@nibblerrick
Copy link

If something like switching servers will be implemented maybe it could be useful to access it with forcetouch (or however it is now named) like Blue Iris does it.
Blue_Iris_Switch_Servers
I would like to see this feature.

@lindehoff
Copy link

👍 This would be a very nice feature to have

@krisnyse
Copy link

krisnyse commented Dec 9, 2019

Supporting this proposal 👍

@treetopsflyer
Copy link

I agree, I don’t think the iOS app needs to combine or integrate two instances, just have the ability to switch between them.

Again, notifications from multiple instances are the most important thing here, allowing remote monitoring of homes/buildings. This really is the backbone of the entire home automation idea and adding it to the iOS app would be killer.

Any updates or ideas from the developer on this front?

@igiannakas
Copy link

Ditto, would love to be able to switch between the two instances of homeassistant I’m running on my home and my girlfriends home..

@cyrenaud
Copy link

cyrenaud commented Feb 5, 2020

Ditto. In my case I would like three instances integrated into the app (home, office & holiday home). I would like to easily switch between the three premises to view each separately, but need notifications from all three locations sent to the app and location tracking for each HA instance. Sounds like a lot of work, but would make this app incredibly useful. Thanks for all the work so far.

@igiannakas
Copy link

What I’ve done as a workaround is to create two web apps on my iPhone screen. It’s pretty much the same functionality wise but no notifications..

@nirkons
Copy link

nirkons commented Feb 9, 2020

Also would appreciate the feature.

Even two separate apps is a good enough solution, but its a temporary one.
I just want to be able to switch between homeassistant instances like you would for example Gmail accounts in the Gmail app.

@GaryOkie
Copy link

It certainly is a must-have feature for me to be able to access primary home and lake home and receive notifications from both.

Having 2 instances of HA Companion running to accomplish this would probably suffice. Has anyone looked into using an iOS app cloner such as Parallel Space or Slices? (see: https://blogs.systweak.com/how-to-duplicate-apps-on-iphone-without-jailbreak )

@ahvink
Copy link

ahvink commented Mar 9, 2020

Yes please, I need this....

@rmooreID
Copy link

rmooreID commented Mar 29, 2020

Soon I will have three instances of Home Assistant in my life. This would be a helpful feature.

@vvv850
Copy link

vvv850 commented Mar 30, 2020

Same here. I manage HA in my home and one at my parents house. This would be really useful even if you need two nabu casa accounts.

@thomasja27
Copy link

👍

I have one instance for home, and one for my cabin.

@nirkons
Copy link

nirkons commented Apr 15, 2020

What I’ve done as a workaround is to create two web apps on my iPhone screen. It’s pretty much the same functionality wise but no notifications..

and no widgets..

this feature would be much appreciated

@Pre10der
Copy link

What I’ve done as a workaround is to create two web apps on my iPhone screen. It’s pretty much the same functionality wise but no notifications..
and no widgets..
this feature would be much appreciated

And in the case of iOS, no advanced location features and extended device sensors which are one of the main benefits of the app.

@ericreich
Copy link

I also disagree. I am also not on Twitter. It does not need full functionality, just a way to flip from a primary to a secondary home assistant.

But I have resolved this by using 2 Nabu Casa accounts and bookmarks to the separate instances. Costs only $5 per account per month.

@robbiet480
Copy link
Member

All I'm looking to do is be able to tell the HA app which of my HA instances to log into. I don't need cross-platform, create an automation in one place that works in another-type functionality.
Right now I use the HA app for my main house, and a mobile web browser for my other instance and it sucks. Just have the HA app ask me which instance I want to sign into and we're done.

Totally agree! How difficult could it be to create a simple frontend switcher or popup chooser! Completely bemused.

While that sounds simple, the reality is that there’s behind the scenes work going on between the app and the frontend. We reuse the front ends WebSocket connection for a lot of data transfer. If that connection is severed (by switching to another web view), no more data transfer is possible. So now, to keep that going, we need to both migrate away from reusing the frontend WebSocket but also figure out how to route data to the right place at the right time. This doesn’t even cover how we figure out what to do about notifications... how do we know where to route a button press back or which instance to stream a camera from in a notification.

@floodwayprintco
Copy link

floodwayprintco commented Mar 6, 2021 via email

@Redebo
Copy link

Redebo commented Mar 6, 2021

We reuse the front ends WebSocket connection for a lot of data transfer. If that connection is severed (by switching to another web view), no more data transfer is possible. So now, to keep that going, we need to both migrate away from reusing the frontend WebSocket but also figure out how to route data to the right place at the right time. This doesn’t even cover how we figure out what to do about notifications... how do we know where to route a button press back or which instance to stream a camera from in a notification.

I don't want both HA instances reporting notifications at the same time through the app. All I want to do is switch from viewing my Main instance to The Other instance. When I"m in "the other" instance, I do not expect to get any notifications, updates or anything else from my "Main instance."

Right now to do this, I can open the app on the Main instance, go to App Configuration, delete the Home Assistant URL for my Main Instance and replace it with the URL of my Other instance. That's horrible.

Just a selector switch when I open the app saying: Which instance of HA do you want to connect, Main or Other. That's it!!!

@robbiet480
Copy link
Member

I do not expect to get any notifications

I get that you don’t expect that but there’s no way to stop notifications being received from the other instance, and no way for us to even tell which instance is which in an incoming notification, so you’d still receive notifications but they’d be broken and/or not do what you expect if the button presses or any interactivity gets routed to the wrong instance.

Anyway though, notifications are like the least of the issues here (especially since they would work pretty much fine for any simple notifications that don’t have buttons or embedded content). I understand your want for a “simple switch” as a starting point. It’s just not as simple as it sounds due to how the code was written expecting to only ever be connected to a single instance. There are lots of assumptions made that won’t work for any kind of switching, like how we are storing and updating your access tokens and the mobile_app webhook configuration. In fact, writing that sentence out even made me realize there’s more issues I hadn’t previously considered like access token expiration and sensor configuration. Adding a switch won’t do you any good if every time you switch you have to log back in again because the access token is expired.

I hear you all on this and I know it’s frustrating to continually hear that we aren’t doing it. If we had simple solutions to this problem they would’ve been implemented long ago, I promise.

@floodwayprintco
Copy link

floodwayprintco commented Mar 6, 2021 via email

@Redebo
Copy link

Redebo commented Mar 6, 2021

Appreciate your additional feedback @robbiet480. I certainly have ZERO idea how the code side works and will defer to your expertise. My requests come from having that functionality already in native apps like Lutron, ADT Pulse, Nest, etc where I can just "switch homes" i'm looking at by tapping an icon or a drop down. I'm guessing it works for those companies because you have to connect back to their cloud service in order to get the auth tokens and stuff.

Maybe this is a project for Nabu Casa where there's some money there for developers to spend the time doing it. I'm thinking of something how DuckDNS works, but Nabu Casa holds the auth creds and the HA App checks against them when logging in.

Either way, appreciate the open conversation and everything that is HA.

@hanerd
Copy link

hanerd commented Mar 6, 2021

Definitely appreciate the context on this.

I come back to the idea that just simplifying the logout / login process could be the MVP to make people happy.

Right now when I switch houses I have to reset the app and then reconfigure it. It’s not hard it could just be easier.

Being able to “store” url, username, password for multiple instances and just tap them and have the app reset and reconfigure itself would eliminate 95% of the “annoyance” factor.

Quick example: I have an nfc tag on the garage door at my vacation house. I tap to open the door and turn on the lights. Standing in the snow and dark resetting the app, punching in the url, and logging in and then tapping is the “ugh, this thing sucks” factor.

Being able to go to app configuration -> connection -> other house and have it run through the reset and login process while I’m walking to the NFC tag would be a massive improvement.

@bkvargyas
Copy link

I missed the poll, but I have 5 instances I maintain, of which 3 are "main" or important to me on a daily basis. Having the simple ability to switch would be a life saver for me. If I had the time, I would compile another instance of this and publish on the app store under a different name, just so I could have multiple "apps" with the same codebase running at the same time.

I know Samsung users have the ability to run multiple instances under a security firewall that would accomplish the same thing I believe. Either way, as others have said, I do appreciate the time and effort that goes into this distribution. And while I cannot contribute as a developer, I would be willing to fund the feature if someone is interested in writing it for a fee.

@heron65
Copy link

heron65 commented Mar 6, 2021 via email

@bkvargyas
Copy link

No takers on the paid feature? I've got $3k (estimated 38 hours @$80/hr) for @robbiet480 or @zacwest.... to add the feature. PM me if interested.

@zacwest
Copy link
Member

zacwest commented Mar 9, 2021

There's many views on how multi-server should work. Keep in mind that although you may understand certain limitations in your proposals, other users likely would not. Support burden and stress play a big role in open source projects.

If you don't need features like sensors, notifications, actions, widgets, watch complications, NFC tags, etc., and you just want to control the frontend, I recommend saving a web clip on your home screen for the other servers.

If you do need any of these features, understand that what you would pick is not identical to what others would, if that even were an option.

Since this is a hot-button ticket, it's unlikely it will see live updates until the feature is entirely done and available for use. For example: would "multi-complication support for watchOS 7" really strike your chord as a multi-server feature? So many things that look unrelated are indirectly required and litigating it seems un-fun.

I have made a good amount of progress over the past 6ish months since this ticket was last really updated:

  • Added multi-window support for iPad and macOS, which was a fairly substantial undertaking while keeping iOS 12 support.
  • Continued rewriting our webhook handling, adding support for things like background updates (required for watchOS).
  • Cleaned up a huge swath of functionality around how we connect to servers or make API calls.
  • Cleaned up the settings around connectivity, unifying it into one server-specific area, etc.
  • Written a new library based on the WebSocket API, with forthcoming plans of moving all of our API handling into it.

These things are tens of thousands of lines of code and tests and hundreds of hours of work. This is all on top, of course, of fixing a huge amount of bugs and adding some really great features.

These are all building blocks necessary to move from a one-server world, and each addresses an underlying need. I do not believe it's worthwhile to spend a huge chunk of time rewriting for the sake of rewriting, so I prefer to bundle small-to-medium features with various cleanup efforts. It's personally a lot more rewarding, and it prevents what I can best describe as writers' block.

Anyway, time moves forward. I am very intentionally not making promises but this request isn't being ignored either.

@bkvargyas
Copy link

@zacwest I appreciate the comment, and thought behind what's really going on.

I think most people from the comments I've seen are okay with a make or break type function, meaning just a raw connection swap. For my use case, based on the SSID you're connected to, would auto-switch instances, or use a "default" if unknown with the ability to manually switch at any time. I do use NFC and notifications, but as you mentioned, I could just do a web screen icon and loose the NFC and use a different notification method. I'm also looking into the remote home assistant plug in to bring in select devices from remote sites into a master instance that the app is connected to.

I do realize the amount of time and effort that has gone into getting to this point. I manage a software and hardware development team at my office, so I really appreciate what goes on in an open source environment. I look forward to the progress the team makes on this application. If there is anything I can do to help support the cause, please let me know.

@grischard
Copy link

Some of the reason for the poll result is probably survivorship bias, like that famous airplane diagram. 17% of Home Assistant users have more than one instance, even though the mobile app only supports one. If the mobile app supported multiple instances, it would encourage users to install more than one.

@dubhunter
Copy link

Another vote for this feature.

@OneCyrus
Copy link

why don't you publish multiple versions in the store as a short term solution? not as a limited user beta but a fully released version?

@jrb80
Copy link

jrb80 commented Mar 20, 2021

Yes I agree! I actually do this already as I am an Android user. I am using the full version with Google services and minimal version without Google, both operating concurrently. This setup works completely fine for my use. My only complaint is the application icon is identical, it would be nice if the background colour was changed or something else to distinguish between apps!

@floodwayprintco
Copy link

floodwayprintco commented Mar 22, 2021 via email

@jfgreco
Copy link

jfgreco commented Apr 5, 2021

Yes please!

@Codelica
Copy link

...I get that you don’t expect that but there’s no way to stop notifications being received from the other instance, and no way for us to even tell which instance is which in an incoming notification, so you’d still receive notifications but they’d be broken and/or not do what you expect if the button presses or any interactivity gets routed to the wrong instance.

Anyway though, notifications are like the least of the issues here (especially since they would work pretty much fine for any simple notifications that don’t have buttons or embedded content)...

I realize this is just a small part of the puzzle, but just FYI, I believe Apple push notifications can include custom data in the payload outside Apple's APS keys. At least I've sent custom data using Expo/React Native and the Apple docs seem to confirm. So if messages included instance data, maybe(?) you'd be able to switch appropriately or ignore if that instance isn't active (potentially based on settings, just dreaming :) )

Anyway.. I'd love this also having both a home and office setup. But you get HUGE props for what's been created already. I use the app constantly!!

@fxstein
Copy link

fxstein commented May 19, 2021

Definitely needed. Have been dealing with this since the early days of Hass. So painful. I'd be happy to sponsor some of this work.

@picotrain77
Copy link

Yes please, as home assistant becomes the only real go to SW for powerful home automation the need or want for multiple instances become greater.

I can help but think that having 2 versions of the companion app on the store would be a quick way round the issue until such time as a fully functional answer is available.

@grischard
Copy link

This is a busy issue. If you'd like to show your support in favour of a resolution, please just hit 👍🏻 on the initial comment, and 'Subscribe' in the right sidebar. No need for 'me too' comments, I think the point has been made :).

@TyrantFox
Copy link

TyrantFox commented Jun 2, 2021

I see a lot of discussion about changes to the iOS App. I will admit I have not read every comment on this item. I understand the complexities of notifications coming from different places and that the general architecture of the app is not conducive to connecting to multiple servers at once. I don't really think that 17% of users have multiple homes (or this is a rather elite bunch of users), but like everyone else who seeks out this issue I too would love to have a solution.

Would a good alternative be a server-side federation? Some mechanism that will establish and keep open a web socket (or TCP Socket) to a remote server instance and to share the entities and their updates. This will not do what many are looking for, but it does keep the IPA exactly as it is, and removes any complexity from the notifications: Any notifications will arise from automations in the primary server instance, even though they may be reacting to entity changes received from the remote server.

I use HA for my office as well. I would like to let many people connect directly to the office instance (works fine for most), but for those of us who use it at home as well, it would be great to integrate it into our own HA instances. Perhaps this exists already - in which case I apologize for the noise.

Edit: Sorry - found this https://github.com/custom-components/remote_homeassistant. I think for many of the posters above it would address their needs.

@jes1417
Copy link

jes1417 commented Jun 3, 2021

I see a lot of discussion about changes to the iOS App. I will admit I have not read every comment on this item. I understand the complexities of notifications coming from different places and that the general architecture of the app is not conducive to connecting to multiple servers at once. I don't really think that 17% of users have multiple homes (or this is a rather elite bunch of users), but like everyone else who seeks out this issue I too would love to have a solution.

Would a good alternative be a server-side federation? Some mechanism that will establish and keep open a web socket (or TCP Socket) to a remote server instance and to share the entities and their updates. This will not do what many are looking for, but it does keep the IPA exactly as it is, and removes any complexity from the notifications: Any notifications will arise from automations in the primary server instance, even though they may be reacting to entity changes received from the remote server.

I use HA for my office as well. I would like to let many people connect directly to the office instance (works fine for most), but for those of us who use it at home as well, it would be great to integrate it into our own HA instances. Perhaps this exists already - in which case I apologize for the noise.

Edit: Sorry - found this https://github.com/custom-components/remote_homeassistant. I think for many of the posters above it would address their needs.

I use HA at home and at work and I was able to get two HA apps running but we are google workspaces users so on my Android device I have set up a work profile that allows you to run two independent android systems at the same time. I get notifications and location updates from both apps.

@cameronurnes
Copy link

cameronurnes commented Jun 23, 2021

+1 for needing this. I have HA at my house but will soon be setting up a more elaborate system at my parents house, and really need to be able to easily check on both and get notifications from both (particularly the alarmo ones). As it is, I'll probably double install the APK for now.

@home-assistant home-assistant locked and limited conversation to collaborators Jul 18, 2021
@zacwest zacwest closed this as completed Jul 18, 2021
@home-assistant home-assistant unlocked this conversation Jul 18, 2021
@home-assistant home-assistant locked and limited conversation to collaborators Jul 18, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests