X10 Community Forum

📱🖥️PiX10Hub ( Always Evolving Open Source) => 🏥Help and Trouble Shooting => Topic started by: Tuicemen on January 31, 2019, 01:21:38 PM

Title: Using Two or more PiX10Hubs (HG servers)?
Post by: Tuicemen on January 31, 2019, 01:21:38 PM
I currently have two HG servers setup in my city place not because I have a large setup but because one is accessible to the web hence security is enabled on it which stops the HGEchoBridge from working. Also one has a added board on the zeroW which allows a Zwave stick as well as my cm19 to be attached.
I'd love to forward status of my Zwave devices to the other Zero W which only has a Cm15 attached but not sure if this is possible. I notice HG does have a Status forwarding  program and a few other goodies in the interconnections section. However I'm a bit stuck (puzzled) as to how and set this up. ::) :'
Has anyone setup any of the interconnection programs?
Title: Re: Using Two or more PiX10Hubs (HG servers)?
Post by: bkenobi on January 31, 2019, 04:10:49 PM
If you search the archive of the old HG forum on the HG.club site, you might find an answer.  I remember some discussion about it but I've never used that feature.  I only have 1 RPi set up that is intended to remain running for HA so I've never tried the communication.
Title: Re: Using Two or more PiX10Hubs (HG servers)?
Post by: racerfern on January 31, 2019, 04:21:18 PM
What are you trying to accomplish?
Could you read the status on the one with the z-wave stick and email to the other one?
Can HG read the email or if they're on the same network can one write a file the other one can read?
Title: Re: Using Two or more PiX10Hubs (HG servers)?
Post by: bkenobi on January 31, 2019, 08:57:20 PM
HG has a system already designed to communicate between multiple HG machines.  The code is based on MQTT and works out of the box if you configure the settings to point at each other.  I don't have 2 machines to try it with currently but, like I said, there are some threads on the old HG forum that discussed setting it up if needed.  I'm sure you could design something else to accomplish the same thing, but MQTT is very fast, light weight, and ready to go so why.
Title: Re: Using Two or more PiX10Hubs (HG servers)?
Post by: Tuicemen on February 01, 2019, 07:03:16 AM
There is some documentation in the User guide for interconnections https://genielabs.github.io/HomeGenie/#/docs/interconnect
Which seems easy enough to setup however I can't get the settings to show (yet).
I believe I read on the old forum you have to enable more then one of the interconnection programs.

I guess I was hoping someone was using this with a more up to date HG version to confirm things work. Guess I'll be the tester.
Title: Re: Using Two or more PiX10Hubs (HG servers)?
Post by: Tuicemen on February 01, 2019, 07:10:24 AM
Ok this  seems to point to why things didn't work in my initial tests as well.
http://old.homegenie.club:8080/www.homegenie.it/forum/indexd961.html?topic=1245.msg8033#msg8033
Title: Re: Using Two or more PiX10Hubs (HG servers)?
Post by: Tuicemen on February 01, 2019, 09:27:41 AM
Ok have the interconnections thingy working however this simply displays the status of devices on the other PI, or at least that's all I can get working.
It is looking like the MQTT route may be the best route to allow controlling devices from any other HG connected to the network.
Title: Re: Using Two or more PiX10Hubs (HG servers)?
Post by: Tuicemen on February 01, 2019, 02:51:08 PM
I finally got it working after reviewing the User guide once more for interconnections I noticed this:
Quote
When using events forwarding, in order to be able to control modules of an interconnected server, the HTTP security settings must be the same on both endpoints.
One of my HG servers had Password protection enabled the other didn't in order to use HG Echo Bridge. Disabling security allowed me to control my Zwave devices from a pi that had no Zwave controller attached. :)% Very cool however One HG server must be connected to the web for remote access for me so this route will not work for me.
I had attempted enabling password protection for both Pis keeping the passwords the same but this wouldn't allow control nor allow the Echo Bridge to work. B:(
Title: Re: Using Two or more PiX10Hubs (HG servers)?
Post by: Tuicemen on February 01, 2019, 06:00:56 PM
UPDATE:
It appears this does work if the HG that is receiving the data updates has password protection enabled.
Originally I had tested relying only on the HG display. B:( After flipping back and forth between HG servers I notice the switches were indeed getting switched. :)% A double click was sometimes required on the HG that didn't have the interface enabled(password protected HG).

I can live with that as the second click (so far is) updating correctly! :)% I suspect if one was to have more then one HG running MQTT would be the route to go. ::) :'
 >!
Title: Re: Using Two or more PiX10Hubs (HG servers)?
Post by: bkenobi on February 01, 2019, 06:38:36 PM
If you are worried about security, be aware that HG does not have any encryption or security built in.  There was a thread on the old forum discussing how to set it up in case you are worried about security.  It's a bit over my depth of knowledge, so I accept the risk based on it being unlikely someone will try to mess up my RPi.  If I was connecting to a cloud service or was transferring data to/from the internet more regularly, I would be more concerned but since the box sits idle the vast majority of the time there is basically no traffic for anyone to see and want to mess with.
Title: Re: Using Two or more PiX10Hubs (HG servers)?
Post by: Tuicemen on February 01, 2019, 06:51:10 PM
I also don't believe anyone would be interested in messing with my Pi setup however having to enter a simple Password & Username prior to gaining access is enough to make me feel more at ease.
 After all if anyone was to want to gain access, encryption wouldn't stop them just slow them down.
I also can restrict access to the HG port to only specific IPs if I really wanted to from my router for added protection.
In any case I'm happy to have this worked out without diving into MQTT right now.
Title: Re: Using Two or more PiX10Hubs (HG servers)?
Post by: bkenobi on February 02, 2019, 08:43:49 PM
FWIW, MQTT is an awesome protocol that opens a world of possibilities.  You have a broker on some system that listens for incoming packets from clients.  If a client publishes, any other client listening will be able to access the data near instantly.  If a client is disconnected, nothing breaks you simply don't get a potential event to fire on the receiving client.  I use it to transmit sensor data from a fire safe as a test right now, but it works flawlessly!
Title: Re: Using Two or more PiX10Hubs (HG servers)?
Post by: Tuicemen on February 06, 2019, 09:20:17 AM
 I just downloaded the paid HomeGenie Plus app to compare it with the free version. This will allow you to access at least 3 HG servers without any additional setup changes to the servers. :)%
I only have 3 HG servers but I suspect it will connect to more like the interconnect option in HG it's self you can select what is displayed from all servers. The Idea initially behind using the interconnections was to be able control devices which only one server had control over with the others in the city without having to open another browser window.
 I was going to try the interconnection or MQTT to access my off grid server from the others but HomeGenie Plus makes doing that a waste of time (I think)
 >!
Title: Re: Using Two or more PiX10Hubs (HG servers)?
Post by: bkenobi on February 06, 2019, 12:46:17 PM
If you don't need the HG systems communicating then it's probably a waste of time doing it.  If you have things set up so there is a single master HG and slaves which handle different locations then it might be useful.  If you are performing activities manually then the app is probably good enough.  But, without the master knowing states of various modules on the slave HG machines you would have no way to run scripts that control them.
Title: Re: Using Two or more PiX10Hubs (HG servers)?
Post by: Tuicemen on February 06, 2019, 12:59:34 PM
Thanks for confirming my initial thoughts bkenobi. :)%
My 2 HG servers in the city don't need to control things in the Off grid place as it handles it's own automation. Depending on a internet connection there for automation would not be reliable. I just need to check in on things and maybe manualy switch something once in a while.
The two Pi HG servers in the city each handle different things one the automation and one Alexa control also one has a Zwave dongle attached which both can control. Although both have a X10 controler attached cm15 and cm19 I plan to remove the cm19 at some point.
 >!
Title: Re: Using Two or more PiX10Hubs (HG servers)?
Post by: bkenobi on February 06, 2019, 03:34:20 PM
I have never seen a personal need for multiple HG boxes that do the same thing.  But, if you have multiple tasks for each then it might be beneficial to have them linked.  Perhaps one is a media server, another a sensor interface (thinking RF gateway of some kind), and a third is the master controlling your lighting.  The media server could be high enough demand for decoding videos that there would be a delay in your HA activities so having it split could be good.  If you are processing the RF in real time on the RPi, it might not be a good idea to try to do anything else on it.  So, you could have a sensor in the media room with some automated lights and the master HG box could be aware of the lighting level, outside temperature, and media being played.  It could then control the lights and window treatment to get appropriate lighting and adjust the thermostat accordingly.  If you wanted to use a single machine to do all of this, it could be done but would not be feasible with a single RPi.

I don't do that stuff, so a single RPi with HG is sufficient for me!
Title: Re: Using Two or more PiX10Hubs (HG servers)?
Post by: Tuicemen on February 06, 2019, 03:53:29 PM
Originaly I had two reasons for two Pis till I got a addon board for my Zero W allowing 3 full sized USB ports.

Now the only reason I run two RPI with HG is one is accessible from the web for which I have HG password protected. This renders the HG Echo Bridge inoperable. The program may get updated to work with the password protection of HG at some point.

If/when that happens I'll move to one giving me a board for my magic mirror.