home-assistant / architecture

Repo to discuss Home Assistant architecture
317 stars 99 forks source link

"Installation name" should to be used by all integrations to allow 2 (or more) concurrent HA instances #396

Closed chemelli74 closed 4 years ago

chemelli74 commented 4 years ago

Context

Due to the importance HA has on my daily activities, I decide to have a prod and a test environment. Such config helps testing and updating with no impact on the real usage and stats of the main HA instance.

Proposal

To allow co-existence of 2 instances on the same environment, all integrations should identify themselves with a specific and different name. Some of those integrations:

Proposal is to remove hardcoded values and use the custom name defined under Settings->General.

Simone

Consequences

I don't see any risk but just a simplification for those with 2 instances. Also, nothing changes for all other users that will not benefit of such improvement.

frenck commented 4 years ago

I'm not sure about your suggestion here, I run a total of 9 environments on the same network (currently 8 online).

What is the issue? And what is your suggested fix? Could you provide a piece of sample code?

chemelli74 commented 4 years ago

What is the issue? And what is your suggested fix? Could you provide a piece of sample code?

Issue is some integrations announce themselves with "homeassistant" hardcoded name. This doesn't allow to have 2 or more instances using the same integration as they will interfere each other.

One sample ? Samsung TV integration is registered in my TV as "homeassistant" and gives the right to connect to the instance that first is configured. Once I configure a second instance, that register itself as "homeassistant", my TV cannot understand which is which and thus ask for authorization every few secs flipping between one and the other instances that try to connect.

If those instead of using hardcoded value "homeassistant" will use the name of the installation, that should be different, then this race won't happen.

Available to discuss this further. Thank you for your time and attention,

Simone

frenck commented 4 years ago

Right, so this is the architecture repository, where one proposes architecture changes they want to implement and want to discuss...

So I'm not sure on the architectural change you are planning to implement or how you are thinking of going to achieve that?

Edit: sounds to me these are issue related to specific integrations you are experiencing, should it be raised as an issue on the core repo to those specific integrations instead?

chemelli74 commented 4 years ago

TBH, I raised a FR, but in Discord I was invited to move the request here to get more audience. So I did ;-)

Anyway, more than a per integration approach for a fix, I would say it should be a common criteria to go with. Once this is part of the guidelines, then non compliant integrations should be fixed and a issue for each should be opened.

Make sense ?

Simone

frenck commented 4 years ago

I'm sorry, this repository is not for raising feature requests.

Feature requests can be raised on the community forums:

https://community.home-assistant.io/c/feature-requests/13