custom-components / remote_homeassistant

Links multiple home-assistant instances together
Apache License 2.0
907 stars 81 forks source link

Cannot specify if system is remote or main #192

Open TangoOversway opened 2 years ago

TangoOversway commented 2 years ago

I've been using 3.7 and have spent hours trying to get communication working between my 2 instances. I'm reporting this as an issue because I have no idea where else to go to get help. There's no discussion board for this project. I have written out many images of HA for my Pi and restarted with new images to clear out any data. I've also tried to clear out any data by deleting the Remote Home Assistant files and removing it from HACS. So I've tried, may times, to redo this with a clean setup.

When I add RHA through HACS, it tells me to restart HA. I do, and when it comes back up and I go to RHA, it always asks for the information for the other system. It gives me no way to just specify that the system I'm installing RHA on is the remote system.

benjycov commented 2 years ago

When you add the integration (after installing with HACS), don't you see this dialog? image

TangoOversway commented 2 years ago

I've seen that once or twice in a number of attempts to install. I'm going to condense steps here to tell you what I see, so if I leave something out, I can clarify it, but since you know how it works, I figure, in many cases, you'll know the in-between steps. (I can write long posts and I'm trying to keep it shorter!)

I started with a new HA install on a Pi. I added Terminal & SSH, then used the terminal to add HACS. From there, I went into HACS and added RHA. From there, I can't remember if I came back to the HACS screen with the menu, but I saw, "You have something that needs for HA to restart before it can be used." (I can't remember the exact wording.) So I restart HA, go to Integrations, and I see RHA. I click on Configure and I get the dialog that asks for the remote system server IP address or host name, the port, and the token. (Plus the 2 checkboxes.) My understanding is that is for the main instance, not for the remote one.

I cannot tell you how much I appreciate your response, because I have had no idea where to get help from someone experience with RHA. I thought I remembered that some projects on GitHub had discussion forums to go with the project, but maybe I'm wrong. (I'm from "the olden days" before GitHub, before Git. Where I learned, way back, and in the setting, revision control was saving your old files with dates attached to the filename for future reference.)

A few other questions, if you have time:

Again, thank you - so nice to finally find someone who knows RHA!

benjycov commented 2 years ago

Just to confirm you have added RHA with HACS to both HA instances?

Then on the remote instance you have gone to the integrations page in HA and add integration Remote Home Assistant. That is when you get the dialog I've shown above and set it up as a remote node.

In terms of your questions, if you remove RHA via HACS it should delete and cleanup the underlying directory. You shouldn't need to use any config in configuration.yaml, RHA works configured entirely from the dialogs.

TangoOversway commented 2 years ago

I have added RHA to both HA instances by using HACS.

I have found what may be a glitch. I don't want to call it a bug. When I add RHA via HACS, and use the back arrow to go back, when I get to the HACS screen, I get a notice on it that RHA won't configure until I restart HA. From there, I went to Integrations and didn't see RHA and when I tried to add it as an integration, it wasn't there. So I restarted HA. It restarts and I get to the Integrations page and see RHA. I click "Configure" and I get the configuration dialog for the main instance.

BUT - one time I added RHA (I delete everything before adding it a 2nd time), then stopped and went to the kitchen fo a snack. I was gone 3-10 minutes and got back to my system and did the same - "backed out" from adding RHA to get to the HACS screen. Still get the warning about needing to restart. I go to the Integrations page and pick "Add Integration." At this point I've done everything the same as before EXCEPT taking a break and going to the kitchen. This time, in "Add Integration," I find RHA there. I didn't do any more testing on that particular point, but that one experience indicated to me there may be some setup time or other delayed time involved. When I added it (through "Add Integration"), this time it gave me the dialog box you posted in an earlier reply ("Select Installation Type").

This explains (at least to me) why I had seen that dialog previously, but usually didn't. It only shows up when adding RHA as an integration. It does not show up if I restarted HA first. If I do that, it seems to default to a main system and then it wants the remote system's info.

Oh, and BEFORE doing any of this, I had added the required two lines to configuration.yaml.

Also, on the main system: I could never get it to connect to the remote unless, on the remote, I had the chance to go through that dialog box. Also, after I did that on the remote system (pick the option to set up as a remote), and pressing "Submit," I went right to the tab to the left, to my main system, and tried to do the setup right away. I wasn't racing, but just trying to move over and get it done. I pasted the security token into the dialog and put in the remote system's hostname (or was it the IP address? Forgot which - doesn't seem to matter) and pressed "Submit." It didn't connect to the remote system.

However, when I stopped and reviewed everything in my head, I did it again, making sure I was doing what I should - entering the system info and port (well, that's in there by default), and pasting in the security token, and it worked.

I don't know if this is because a Pi might be slower than other systems, or I was running off an SD card instead of something faster like an SSD, but this experience makes me think that it takes time for RHA to show up as an integration in "Add Integrations" and that, once set up on the remote system, it also takes time for it and the main system to communicate with each other.

And one non-related question: I'm not seeing things on the remote system show up on the main system. Only 1 item, the remote itself. The docs are quite sparse about the 4 configuration dialogs that show up after the connection to the remote system. For now all I have on the remote are ZWave devices, but eventually I'll have some Insteon and other devices, too. The documentation for those pages is sparse. I'm not clear on just what I need to do with the filters to make devices or automations or scenes to show up on the main system. But if someone can help me work that out, I'll be glad to write it up for documentation for others to use on those pages. (For instance, I'm not clear - do I specifically have to include something for it to show up, or will things show up by default unless excluded?)

MattWestb commented 1 year ago

I have installing as custom_components and was adding the config i 4 remote system restarting HA and can adding then in master HA. After testing more configs i wad deleting it and restarting HA and its working. So the instruction is wrong its no need adding the config only installing the files and restarting and then shall the add integration is working out of the box for aster and clients.

Only large problem is ZHA as load_components and need being patched in the core.config_entries then its showing up in the configure GUI.