Announcement

Collapse
No announcement yet.

Help with html link action, please

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

    Help with html link action, please

    I'm trying to get a single "link" - such as in the form of <a href="http://IP-of-my-internal-HS-server/run_the_event_I_want"> working.

    I have found that I can create a static button action pretty easily with a
    <input class="formbutton" type="submit" name="" value="Close garage door">
    <input type="hidden" name="run_event" value="Garage - close garage door"></td></form>
    code, but this gives me trouble because I'm trying to run it from Message Server clients; so it's losing it's link to HomeSeer. In other words, if I run the above code in a "test.htm" file and call it from "http://HSserver/test.htm" all is good; but from MS_Client, it doesn't know to send the button action to HS.

    So, I'm thinking that if I can put it in an "href" type call, it should work, eh?

    Help, please?

    (see profile for environment)

    #2
    Anyone correct me if I am wrong, but I think it has to be in a form post...JG



    <form method="post">
    <CENTER><input src="clock1.gif" type="image" TITLE="Knock Knock" width="25" height="25"></CENTER>
    <input type="hidden" value="page" name="run_event">

    The Garage
    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


      #3
      Thanks, Jebus.

      I'm able to make that work if I'm already calling the native page from the HomeSeer server. What I want to be able to do is send a single "link" call to HS' web server.

      Imagine taking the code and opening it as a raw .htm file instead of as a link off a HS server reference.

      Basically, putting the code in as you suggest will give you the pretty button, but the call will go nowhere. That's the problem I have: I need a way to send it as a "http://HSserver/do_this.htm" or something like that due to the way I'm sending it.

      PLEASE tell me it can be done!

      FWIW, what I'm looking to do is this: I send a "The garage door has been opened for 10 minutes and there does not appear to be anyone in the garage" message via MS_Client, including a picture of the garage so I know there's no car in the way of the door. I now have a link to open HS on that pop-up, but would prefer to be able to click "close the door". I thought I was there when I got the button on and such, but then realized it wasn't working because the MS_Client wasn't sending the data back to HS, because it was basically opening the code locally.

      Help, please!

      (see profile for environment)

      Comment


        #4
        In Jebus' post there's a missing "</form>"-tag at the end.

        I fear as a single link you'll have to use JavaScript... don't ask me how...

        Cheers

        Never say never again ...

        Comment


          #5
          In looking at code from HS auto-generated pages, I can go directly to any event's config pages, but using the internal reference number: "http://HSserver/trig50" takes me to the trigger screen for event ID 50. Is there anyway to do "run50" or the like?

          (see profile for environment)

          Comment


            #6
            You could write an ASP which takes the name of an event in its parameters, and then executes the event. Then just make the link include the parameter. This should be a ten-line-or-so ASP.

            Heck, you could even pass in the URL to return to after the event is executed. So the ASP would display a page that has a meta redirect to that page after 5 seconds, and otherwise says "Please wait, executing event Activate Wombat Stapler Subsystem..." until the five seconds are up.

            Nucleus Home Automation | System Specs
            News, support, and updates for Rover, Network Monitor, TimeIcons, and more

            Comment


              #7
              ... Hunter. I thought I've finished my WebInterface, but who knows ...

              Cheers

              Never say never again ...

              Comment


                #8
                Search for HACT in tha board..
                It gave me a lot off code snippets and help....

                Greetz P.S.Y.C.H.O.T.I.C.

                Comment


                  #9
                  Grab Martin's Remote Tray Switch. There is an ASP in it called trayswitch.asp. You can use that to launch an event from an href like:

                  http://HSserver/trayswitch.asp?event...se+garage+door

                  The downside to this is that it launches in a new browser window. That can be overcome by using a base tag in the message you send to MS_Client:

                  <base href=http://HSserver target='_self'>

                  but then the MS_client window changes to the output of trayswitch.asp (either OK or Failed). The base tag also allows you to simplify the href tag:

                  /trayswitch.asp?event=Garage+-+close+garage+door


                  Paul

                  Comment


                    #10
                    Paul,
                    I was thinking the same. The added benefit of this is that: You can rename Trayswitch.asp and modify the response sent back to the browser window, to MS_Client specs. You could even send a response to HSPI_MessageServer on HS.Server. I have done this for TraySwitch, to get the dim level. You could actually call up a msgbox_*.html that is located on the HS.Server and make it look like MS_Client called it up. That would give you any response you want. Many ways to do this......JG

                    The Garage
                    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


                      #11
                      Thanks, Paul. The trayswitch.asp does what I want. Sure, the open window with the "OK" is not really what I had in mind, but I think I can work on that.

                      I'm not sure I'm understanding the additional ideas you put forth, Jebus: can you give me an example of how you'd take advantage of the call within a MS_Client window and push valuable content back to it? Any sample should help me understand.

                      Thanks.

                      (see profile for environment)

                      Comment


                        #12
                        Greg,
                        I haven't done this with MS_Client yet. Like Paul said, I don't see any reason it couldn't be done. I'm far from the authority on this though. I have modified it for trayswitches to get the dim level displayed in the task bar for the trayswitches app. Here is the version I use as a template. It is commented where I have modified the response. note: For trayswitches client you have to return the "OK" or "failed" with the string it reads, You will see. But for MS_Client you could send anything back and the asp does the interaction with HS. Hope this helps......JG

                        The Garage

                        [This message was edited by Jebus on Sunday, 27 October 2002 at 03:30 AM.]
                        Attached Files
                        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


                          #13
                          Greg,
                          You could also just use Trayswitches.exe and MS_Client on same remote PC like I do. Trayswitches to run events, control devices, ect... and MS_client for the messages back...JG

                          The Garage
                          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


                            #14
                            I just have an idea. If you create a HomeSeer web page that have your web cam and a button to run event or play with device. I can upload today a version that if you send a link as message “http://hs.serverp/webcam.asp” the message will go to the web page.

                            Let me know if that can help you.
                            Regards,
                            Christian

                            Comment


                              #15
                              Maybe that will fix a couple of other problems I've come across. I tried including an <EMBED> tag in a message hoping it would play a wav on the client. The media control shows up but doesn't seem to get the URL to the wav passed to it. I also ran into the same thing trying to put an <IFRAME> in the message - I can't get anything to load in it. Maybe having the client message window loading a "true" page will help.


                              Paul

                              Comment

                              Working...
                              X