Announcement

Collapse
No announcement yet.

"Distributed" HS possible?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    DC,

    Is's not PHP code. It's VB Code! Thats how you post VB code here to have it show up and not be rendered.


    Maybe the thing to ask for is that the remote speaker application be more robust and support scripting, devices, and plugins on the remote PC????

    ...JG
    3.0.0.548: HS3PRO - 3.0.5.10: AIAlert - 2.1.1.0: APIWeather - 2.0.64.0: BLBackup - 2.0.45.0: BLLAN - 2.0.37.0: BLRoombaWifi - 1.0.0.3: DevLog - 1.2.5.15: KeyPad - 3.0.2.25: NetCAM - 0.0.0.52: Pushover 3P - 3.0.0.5: SendVFD - 1.0.0.3: Tiles - 3.0.11.0: Z-Wave

    Comment


      #17
      I have a Plugin Connector in my drawer....

      Basicaly, it simulates a plugin on the HS server side, and there is a client application on the remote side, that mimics the HomeSeer plugin interface. This means you can install HS plugins on a remote PC.

      It's not fully tested, but as soon as the SIP Connector is out, I'll work on this again.

      Regards,
      --
      stipus

      Comment


        #18
        Even with remote plug-ins HS only supports one X10 interface per HS instance. I like DC's idea of the possibility of multiple interfaces on remote machines (or even local). However I think Rich is right, there are not many that would use this, and therefore it doesn't make good business sense for HST to invest a lot of time into it (it would be a lot of work, this is not a trivial change). And it can be done with xAP (and exactly why xAP was originally developed, to provide an open and distributed automation infrastructure via a simple to implement protocol).

        Bill

        Comment


          #19
          Originally posted by rjh
          Its pretty easy to access a remote HS system using .NET remoting. Here is a vb.net script that will connect to a remote instance of HS and get a reference to the HS interface there. You can then execute script commands as if you were on that actual PC. I did not test this code, but it should work, or at least be close. I can help if you have issues. You may need to add a reference to the HomeSeer2.dll in your settings.ini file.

          PHP Code:
           
          Sub Main
          (parms as object)
          dim hsinterface As HomeSeer2.application
          dim hs 
          As Scheduler.hsapplication
           
          ' create the class from HomeSeer2.dll
          hsinterface = New HomeSeer2.application
           
          set the remote host we will connect to
          hsinterface
          .SetHost("myremotepc")
           
          ' try to connect to the remote pc, this could even be on the Internet!
          Dim rval As String = hsinterface.Connect("user", "pass")
           
          if the return value is not an empty stringthen there is an error
          If rval <> "" Then
          ' log an error
          hs.writelog ("Error","Could not connect to remote server: " & rval)
          Else
          good connection
          EndIf
           
          ' get a reference to the remote HS object
          hsapp = hsinterface.GetHSRef
           
          Now call any HS script commandexecutes on the remote PC
          ' Send an X10 command
          hs.ExecX10("A1","on",0,0)
           
          Speak on the remote PC
          hs
          .Speak("Hello on the remote PC")
           
          End Sub 
          Next would be to trigger this from an event with X10 recieved, then use hs.LastX10 to get the x10 command and send it to the remote PC.

          I think this is very powerful feature of HS2, but I don't see many using it. If anyone has any questions on how to make this work, let me know.
          So I suppose that if I have a Speaker client running on the non-HS machine, I could alter that last hs.Speak line to include the non-HS machine's Speaker client name and have remote HS speak on local machine.
          Jim Doolittle

          My Twitter
          My Hardware & Software

          Comment


            #20
            Jim, maybe. You can only speak to an HS system that is currently connected. So in my example, I am speaking to the remote HS PC. That remote system must have a speaker client connected to it.

            DC,

            I don't see distributed HS as a feature many would want. Its pretty easy to do what you want with the script I posted.
            💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

            Comment


              #21
              If (and that's a big if) I understand your script, it allows the remote pc to request that the HS pc send the x10 command. That, I do not believe, was the point of this thread. The point was to actually issue x10 commands from the remote pc.

              I believe a scenario is to have a plugin that determines if the request is for an x10 device that should be issued from the remote pc. Via remoting, tell the remote pc to issue the x10 command (via a serial powerline interface).

              Ed T.
              tenholde

              Comment


                #22
                Rich,

                I might play around with that later. I am leaving home for Thanksgiving and that would be a good opportunity...before everyone else is up or after they are asleep.

                I probably would have the script make sure that Speaker is started locally, connect to HS as soon as possible, and then wait for some time for Speaker to connect before completing the script tasks.
                Jim Doolittle

                My Twitter
                My Hardware & Software

                Comment


                  #23
                  To those (Rupp!) that are asking why have 2 PC's: I have the same situation as the original poster in that X-10 signals do not reliably cross between the basement (which is on a secondary panel) and the upstairs, so I added a second HS PC (yes, two licenses!) upstairs equipped with an X-10 interface. Through trial and error I found the X-10 devices which do not reliably respond to the basement PC and ported those devices to the upstairs PC. Since I had not seen Rich's post about the .NET way of doing comms between the PC's, I developed a script that wrote a file from the basement PC to the upstairs one and then polled for changes in that file. When the file changes, it instructs the upstairs PC on which device to fire. That way, the basement is the master and knows the state of everything in the house. Fairly simplistic, but it works. Now... on to enacting the .NET method.

                  Rich: a comment - I distinctly recall that the remote capability was indeed a major feature request when 2.0 was in the planning stages.

                  Mitch
                  http://www.midondesign.com

                  Comment


                    #24
                    I'm very interested myself in this thread.

                    I have an issue with UPB noise on one phase of the powerline but only sometimes during weekend nights. I'm not sure, but I believe I share a transformer with a bunch of nightclubs on the raucous 6th Street here in Austin. My theory is that when the bands gear up to play with perhaps some cheap AV equipment, so much powerline noise is created it creeps in to my powerline. As soon as the bands quit playing at 2am, the noise is always gone.

                    During this noisy period, if a move the PIM over to the bad, noisy phase, the UPB signal can overcome, but the signal isn't strong enough to communicate to the good, no noise phase. This is the case even though I have a UPB residential repeater installed.

                    So, I an interested in being able to have two PIMs, one for each phase.

                    My plan is to use MLHSplugin and MLServer to get the job done. So, I'll have one PIM (on Phase A) controlled directly by HomeSeer and another PIM (on Phase B) controlled directly by MLServer. On Friday nights after 8pm and before 2am, HomeSeer would issue commands to MLServer (via mlhsplugin) for lights and devices on the noisy phase.

                    Don't know if it will work (it should though), but it's my current plan to get two UPB PIMS working in the system.

                    I already have the spare PIM and MainLobby. Just waiting on the Cinemar plugin for UPB.

                    Comment


                      #25
                      I don't see distributed HS as a feature many would want. Its pretty easy to do what you want with the script I posted.
                      If it would be a complicated thing to do, and there is no demand for it, that's fine.

                      But, I don't see how that simple script would do what I'm talking about. What tells HS to send commands to a remote HS instance for some devices and not for others? How would the remote HS systems know to take over when the master is down? How would the remote HS instance know the status of all the devices without a shared database? Or maybe I should ask, is it possible now for two HS instances to share the same database? Is there an enqueue mechanism built in to prevent them from both updating the database at the same time?

                      Thanks.

                      <!-- / message --><!-- sig -->

                      Comment


                        #26
                        Midon,

                        What remoting capbabilities are you referring to here:
                        "I distinctly recall that the remote capability was indeed a major feature request when 2.0 was in the planning stages."

                        Do you mean the ability to host plugins remotely? We have some prototypes of this working, but there are some technical issues that are holding this up.

                        DC,

                        I was trying to solve your issue of being able to send X10 commands long distances. As for some of your other requests, all is possible with a little scripting. The remote system can use commands like hs.DeviceStatus to get the status of all your devices. As for taking control, this would really need a copy of the database, which is not sharable, but it could be copied, then the remote system could just run with the copy. The script I posted could also be used to "ping" the other PC and if there was no response, it would assume the main PC was down and then take over. Maybe the remote PC keeps all events disabled, then enables them all when the remote PC goes down.
                        💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                        Comment


                          #27
                          Thanks Rich. Your solution requires programming (well, writing VB scripts which is a form of programming). It's interesting that for some people one of the strengths of HS is the ability to do most anything with scripts, but for other people who don't want to spend a lot of time writing scripts (like me) the strength of HS is what it can do without ANY programming.

                          I'm looking for a built-in feature that can be enabled in a few minutes, not with hours of research, programming, testing and debugging (it might not take you that long but it would me!). It seems to me that it would be an advanced feature that might not be used by a LOT of home hobbyists but it would have the potential to take HS to a new level of scalability and reliability - much the way clustering increases the scalability and reliability of an Oracle or SQL Server configuration. What if you sold it as an optional added cost feature? (I would pay for it). Call it "HA HomeSeer" (High Availability HomeSeer) or GD HomeSeer (Globally Dispersed HomeSeer) or HomeSeer-D (HomeSeer Distributed) or Clustered HomeSeer. Just something to think about!

                          Comment


                            #28
                            DC,

                            Before this topic gets to far away from your original goal, I think you'd be well served looking into xAP. From the xAP Automation web site;
                            "xAP is an open protocol intended to support the integration of telemetry and control devices primarily within the home - it is the glue that supports the interconnectivity of Home Automation devices."
                            Using xAP you could place a PC running only the xAP X10 connector with a CM11 installed on the troublesome electric circuit. This could then be controlled by Homeseer through the xAP plugin. This eliminates the need for the second instance of Homeseer. xAP is free, but there is an active mailing list so support seems pretty good. Now having said this I am not currently using xAP, but many others are.

                            Another option you could look into a serial port server, like this;
                            http://www.lantronix.com/device-netw...rs/mss100.html
                            This would allow you to place a second PLC in the problem area, but has the advantage of not requiring a second PC. You'd place the second X10 interface on the troublesome electric circuit, and run the xAP connector on you orignal HS server. You're still going to need xAP for this because as far as I know HS will not support a second X10 interface. I use one of these devices myself, not for a PLC but for a remote Betabrite sign. The software sets up a virtual com port on the server that connects to the device when the serial port is openned.

                            Finally, if you're set on a second instance of Homeseer you might want to look into the Girder\NetRemote plugin. It is also free and allows Homeseer to send and receive netremote commands. You could then setup virtual devices in the primary Homeseer instance that when acted upon cause the plugin to send those commands to the remote HS instance. I don't think this would require programming per se, but would involve setting up some rather elaborate events in the secondary instance of Homeseer.

                            Just a couple of ideas to look into.

                            Aaron

                            Comment


                              #29
                              Following up on what Aaron just wrote, you could have Girder on the second PC that can send its own X10 commands. Girder is not free though. It would be similar to xAP.
                              Jim Doolittle

                              My Twitter
                              My Hardware & Software

                              Comment


                                #30
                                I've been pulling my hair out lately...

                                ...dealing with signal problems in my house. I'll have to think about it some before taking action, but it looks like it may be an easier solution to have another PC in a different location in the house and communicate between them via Rich's method above...

                                Thanks Rich!

                                Comment

                                Working...
                                X