Announcement

Collapse
No announcement yet.

Control a device without recalling web page

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

  • Control a device without recalling web page

    Probably a stupid question... I'm using forms to call functions on an ASP page. Is there a way to control a device without using forms?
    Don

  • #2
    Are you trying to control the devices on the back of some sort of user input (button or such) or do you just want the device controlled on page load?
    My Plugins:

    Pushover 3P | DoorBird 3P | Current Cost 3P | Velleman K8055 3P | LAMetric 3P | Garadget 3P | Hive 3P |
    Yeelight 3P | Nanoleaf 3P

    Comment


    • #3
      Have you looked at the JSON interface. You can call these from many different ways.
      -Rupp
      sigpic

      Comment


      • #4
        User Input. I have a video stream embedded in the page and the reload plays havoc with it.

        I'm not sure how to use JSON w/a button.

        Originally posted by mrhappy View Post
        Are you trying to control the devices on the back of some sort of user input (button or such) or do you just want the device controlled on page load?
        Don

        Comment


        • #5
          My gut instinct wonders if you could use some sort of AJAX function with the postback via the JSON interface which would then not need the page to be refreshed. I'll have a play around see whether I can do it...
          My Plugins:

          Pushover 3P | DoorBird 3P | Current Cost 3P | Velleman K8055 3P | LAMetric 3P | Garadget 3P | Hive 3P |
          Yeelight 3P | Nanoleaf 3P

          Comment


          • #6
            You could put an iFrame on the page (hide it after testing) that you target with an asp:LinkButton that runs the JSON command and the results are shown in the hidden iFrame.
            -Rupp
            sigpic

            Comment


            • #7
              Can you give me an example Greg? Or perhaps point me to one...

              Thanks to both of you for suggestions.
              Don

              Comment


              • #8
                Ever find out anything about this? I'm trying to do something similar and having no luck whatsoever

                Comment


                • #9
                  Just saw this. You should be able to use something like this.
                  PHP Code:
                  <html>
                  <
                  body>
                   <
                  iframe id="mainFrame" name="mainFrame" width="200"  height="200" src="" style="visibility:visible;"></iframe>
                          <
                  input type="button" value="Click" onclick="mainFrame.location.href = 'http://yourIpAddress:81/JSON?request=runevent&group=Speaking&name=SpeakTheTime'" /> 
                  </
                  body>
                  </
                  html
                  Once this works set the visibility to hidden on the iFrame.
                  -Rupp
                  sigpic

                  Comment


                  • #10
                    No. Still ended up with the page refreshing. Just saw Rupp's example, and will try that.

                    EDIT:

                    That works.

                    Thanks Greg.
                    Last edited by donstephens; October 18th, 2015, 10:56 PM.
                    Don

                    Comment

                    Working...
                    X