Announcement

Collapse
No announcement yet.

How check if system is ON (server ON)

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

    How check if system is ON (server ON)

    I configured a HS4 server (windows) to my sister.
    I need to check if it is working or stopped.

    I created an event (on my sister's HS4) triggered every 5 minutes. The event simple is an immediate command like:

    Code:
    &hs.geturl("https://connected2.homeseer.com","/JSON?request=controldevicebylabel&ref=1111&label=On&user=MY_MYHOMESEER_USER&pass=MY_MYHOESEER_PASSWORD",True,80)
    This turn on a virtual device on my HS4 system (not in the same network!). On my HS4 system I have two events: the first turn off the virtual device if change to on, the second event check if the virtual device still OFF for more than 7 minutes, send me an email to alert me that my sister's HS4 system could be down.

    This work well but I have to share my myhomeseer user and password into the command.

    On my HS4 system I created a specific user and password for that, created a dynamic dns (the router port is opened).
    If I am out of my network I can control my HS4 system:
    Code:
    http://chris-home-automation.duckdns.org
    It works but I need to insert user and password.

    But if I use this immediate command (from my sister's HS4):
    Code:
    &hs.geturl("http://chris-home-automation.duckdns.org","/JSON?request=controldevicebylabel&ref=1111&label=On&user=SPECIFIC_USER&pass=SPECIFIC_USER_PASSWORD",True,80)
    This not work.

    What I'd like to do is a ping every 5 minutes from my sister's HS4 to my HS4 system.

    Some Idea to have something like a whatcdog in order to check if an remote HS4 system is working?

    #2
    You say "This not work", what did happen? If you enter the URL manually in a browser what is returned?

    The examples you pasted shows port 80 open inbound to your HS3 server, I'm not sure I would do that without other protective actions.

    Comment


      #3
      Originally posted by mterry63 View Post
      You say "This not work", what did happen? If you enter the URL manually in a browser what is returned?

      The examples you pasted shows port 80 open inbound to your HS3 server, I'm not sure I would do that without other protective actions.
      If I enter URL manually appear the popup for user and password (but I pas directly the user and pw in the URL...)

      About the port 80, yes, it is not a good solution. I'm working on other port.

      Comment


        #4
        Most browsers won't accept user and password in the URL any longer due to security. Did you enter them in the popup? If so, what happened?

        Comment


          #5
          This is a bit off-topic, but a more secure (and perhaps a bit less reliable) way to accomplish this is with emails sent/processed by the HS systems. You don't need to open any ports to the world.

          I have two HS servers that monitor one another with a series of events as follows:

          Server1
          Event1:
          Recurring trigger sends email to Server2 every 10 minutes with keywords in email subject

          Server2
          Event1:
          IF email is received from specific sender with keywords in email subject
          THEN set VirtualDevice to "online"

          Event2:
          IF VirtualDevice has been "online" for exactly 15 minutes
          THEN send notification "Server2 did not respond for 15 minutes"

          How long to wait before sending notification, how often, etc., is up to you. I have a additional event that, after 30 minutes, sets VirtualDevice to status "offline" and send a 2nd notification. A final event uses EasyTrigger to send a "back online" notification when the value was "offline" and becomes "online".

          Note that VirtualDevice needs to have "Do not update device last change time
          if device value does not change" unchecked.

          I also have this set up the other way so that Sever2 is also monitoring Server1.

          -Wade

          Comment


            #6
            Another secure option could be to share a folder on drop-box and get your sisters HS4, save a text file containing the current date/time to that folder every xx minutes.

            You can also read that file on your HS system and check the date. Can be done with a couple of simple scripts.
            Jon

            Comment


              #7
              Tanks for the interesting tips!
              I was quite ready to bother an ESP8266 or ESP32: HS system send to ESP a mqtt message every xx minutes. If no message received for xx minutes ESP send an email to me.
              Email or Dropbox solutions are more interesting ed not require additional hardware.

              Thank you so much!

              Comment


                #8
                Who says old dogs don't have useful tricks
                HS4 Pro on Shuttle NC10U, Win10; Z-NET
                Number of Devices: 1005
                Number of Events: 293

                Plug-Ins: BLLock, DirecTv, EasyTrigger, Honeywell WiFi Thermostat, Marquis monoprice Amp, MeiHarmonyHub, PHLocation2, Pushover 3P, UltraM1G3, rnbWeather, Worx Landroid, Z-Wave

                External applications: Homebridge-homeseer, Geofency, EgiGeoZone.

                Comment


                  #9
                  I think this can be done much more simple.

                  On the machine make a batchfile containing
                  shutdown /a
                  shutdown /r /f /t 300

                  (Remark: /t 300 is in seconds. Choose whatever time you need)

                  Make an event in HS to run this batchfile every 4 minutes and 30 seconds (250 secons)

                  So when HS stops the event won't run and the machine will autmatically reboot in 5 minutes max.
                  - Bram

                  Send from my Commodore VIC-20

                  Ashai_Rey____________________________________________________________ ________________
                  HS3 Pro 3.0.0.534
                  PIugins: ZMC audio | ZMC VR | ZMC IR | ZMC NDS | RFXcom | AZ scripts | Jon00 Scripts | BLBackup | FritzBox | Z-Wave | mcsMQTT | AK Ikea

                  Comment


                    #10
                    Originally posted by AshaiRey View Post
                    I think this can be done much more simple.

                    On the machine make a batchfile containing
                    shutdown /a
                    shutdown /r /f /t 300

                    (Remark: /t 300 is in seconds. Choose whatever time you need)

                    Make an event in HS to run this batchfile every 4 minutes and 30 seconds (250 secons)

                    So when HS stops the event won't run and the machine will autmatically reboot in 5 minutes max.
                    You may of misread the first post. He is trying to monitor his sisters HS4 install at another location and inform if it stops responding.
                    Jon

                    Comment


                      #11
                      Hi, Jon00,

                      What riggered me was this
                      Some Idea to have something like a whatcdog in order to check if an remote HS4 system is working?
                      My proposed solution will work as a watchdog for HS. Only to fullfill the notifying part he can add een send email event in the HS Start script.

                      And because of this I was assuming that he would like to get HS started again when it stops working.
                      I configured a HS4 server (windows) to my sister.
                      I need to check if it is working or stopped.
                      But i am not saying it will be the best solution but it's just another option to get HS back on line unattended at a remote location
                      - Bram

                      Send from my Commodore VIC-20

                      Ashai_Rey____________________________________________________________ ________________
                      HS3 Pro 3.0.0.534
                      PIugins: ZMC audio | ZMC VR | ZMC IR | ZMC NDS | RFXcom | AZ scripts | Jon00 Scripts | BLBackup | FritzBox | Z-Wave | mcsMQTT | AK Ikea

                      Comment


                        #12
                        Came across this thread after weeks of frustration trying to do exactly this. In my case, both HS4 instances are my own (two locations). I have almost come to terms with the fact that this may not be doable. I can reach System 2 from System 1 via JSON, by using my primary account directly in the URL. However, that wouldn't work the other way around since my primary account has access to both systems, but clearly defaults to one of them ("primary system"?). It would also mean that I would have my primary user account information floating around in text, which I don't want.

                        I have created dedicated guest user accounts for both systems, where both guest accounts only have access to "their" system. The intention was to use the "System 1 guest user" from System 2, and vice-versa. However, I only get 401 Unauthorized with these guest accounts no matter what I do. I'm starting to think that this is not possible with guest accounts (?) (I have also registered the same accounts locally, as I understand is a requirement for HS4.)

                        Sounds like communicating via DropBox or similar might be the solution, but it feels wobbly and cumbersome when a direct call should be possible.

                        Any updates here since 2021?

                        Comment


                          #13
                          Maybe... MyHS offers a Token-based option so you don't have to use credentials. Also, if you have an upgraded version of MyHS that allows for multiple users/systems, you can create users that only have access to the other system (has to be set up right in both MyHS and on each HS4 system) and use those accounts to create the token, then include the token in the URL of the GetURL command.

                          I haven't quite tested it like this, but I do have a dedicated user for my 2nd system that I use for logging in via Homeseer Mobile to get around the whole "Primary System" limitation.

                          Comment


                            #14
                            Yep, I already do that (minus the token). Have dedicated guest users registered identically in both MyHS and locally. But using these users, I am not able to authenticate. With the primary user, it is not a problem.

                            Perhaps worth trying the token solution - how is the token obtained? Could not find anything like that in the MyHS interface, and googling gave me nothing.

                            Btw managed to create a makeshift solution through OneDrive - similar to DropBox, I guess: System 1 prints current datetime to a file, System 2 reads it and reacts if the datetime is (too) old. And vice-versa.

                            Comment

                            Working...
                            X