Announcement

Collapse
No announcement yet.

Easy Answer - Turn Lights On/Off from Web Page

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

    #16
    Let me clarify

    I don't mind using HS, I just dont want my website visitors to have to open a new browser window to control one light. My application is very simple. I have an outdoor webcam that is currently accessible via the internet (it has a built in webserver and is controlled via a java applet that I have embedded in my page). I want to be able to control the floodlight (which is currently connected to an X10 switch) so that you can see outside during the night. The website is limited to only a few users a day so i'm not worried about random people turning my deck light on an off. So I already have the web image on a page... I simply want a button below the image that says "Lights On" When you click it would send a command to HS or whatever and signal my PowerLinc USB to turn on that specific house code. That's all I want. I hope this clears things up. I dont mind running HS.

    Ok Jonwpb, zoomkat, rupp, and zimmer62 - - = > how do I do this.

    Comment


      #17
      please explain

      I'm new to these boards... can you provide more details?? what is Martins trayswitch, i.e. where do I go for more info???
      Originally posted by Jebus
      Guys,
      Martins TraySwitches does just this. Check the trayswitch.asp that goes with his app.
      I use it all the time with other pages/apps to parse an HTML post/submit string and switch devices.
      The authorization can be modified for external access.
      He did a great job of coding. I have modified mine for dim commands.
      ...JG

      Comment


        #18
        from the Homeseer Help file

        Here is the text from the Homeseer help file called "Controlling devices and events from your own pages". This sounds like exactly what i need, but where do I put the IP addres and port number for my homeseer webserver???

        Controlling devices and events from your own pages

        You can add buttons to your custom web pages to control devices and trigger events. The following HTML code will run the event named "table lamp on".

        <form method="POST">
        <p><input type="submit" value="table lamp on" name="run_event"></p>

        </form>


        The following HTML code can be used to control a device directly. This code uses the name of the device rather than an event name. This code controls a device named "den table lamp". Note that the device name is combination of its location and its name.

        <form method="POST">
        <p>

        <input type="hidden" name="control_device" value="den table lamp=dim=50%">

        <input type="submit" value="Lamp 50%" name="control_device">

        </p>

        </form>


        See the sample page "remote_test.htm" in the HomeSeer HTML folder for a sample page.

        Other device commands can be inserted other than "dim". The following commands are supported. Note that the commands are NOT case sensitive. <!--kadov_tag{{<spaces>}}--> <!--kadov_tag{{</spaces>}}-->Commands supported by Z-Wave are in blue.

        All Units Off
        All Lights On
        On
        Off
        Dim

        Bright
        All Lights Off
        Extended
        Hail Request
        Hail Ack
        Preset Dim
        Status On
        Status Off
        Status Request
        Dim to Off
        DDim <!--kadov_tag{{<spaces>}}--> <!--kadov_tag{{</spaces>}}-->(Direct dim - dims to the specified level regardless of the device type.)

        Dimab (absolute dim, if the light is currently at 10% and the command is light=dimab=20%, then the command bright 10% is sent)
        Dimbf (bright first, the light will go to 100%, then dimmed to the requested value)


        To create a button that turns OFF a device named "lights" that are located in the "den", use the following HTML code.

        <form method="POST">
        <p>
        <input type="hidden" name="control_device" value="den lights=off">
        <input type="submit" value="Lights Off" name="control_device">
        </p>
        </form>

        Comment


          #19
          MP,
          You could add a web page on your HS server that has a frame for the light switch and a second frame that has you camera page in it. This could be served from the HS web server. Does this sound like what your looking for?
          💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

          Comment


            #20
            If your serving that page from your HS server you do not need a port. It talks directly to HS when served from the HS server.
            💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

            Comment


              #21
              Originally posted by marco_polo
              I have a personal webpage which is externally hosted on the Internet. I want to put a buttom on the site that says "Lights On". When you click on the button ( it can be a form submit or image, it doesn't matter) it will send a signal to my Homeseer server at home and activate my X10 light switch (let's assume the light already works via homeseer). The question is - What does the html code look like that makes all this happen. For illustrative purposes, lets assume my home PC IP address is 50.50.50.50 and homeseer is listening on port 1000. I read the help file in HomeSeer that says how to make a form button to post a command to the homeseer server, but how do I get my webpage (on the Internet) to link to the homeseer webserver on my home pc. I know somehome I need to incorporate the ip address and port of my home pc, but how??? I hope this makes sense.
              Can you run CGI on the internet web server? If so, you could trigger a CGI script that would send HTTP POST requests to the HS server, emulating on/off button presses on the device page. In perl this would be done with the LWP::UserAgent object, it's a fairly simple method. This is doable many other ways I'm sure.

              If HS is password protected you'd also need to emulate a logon sequence before sending the POST request.

              Comment


                #22
                yes cgi, but how

                Yes, I can do cgi. Tell me more please?

                Also, the help file in Homeseer seems to talk about simply inserting a form button, but i don't see how this form post gets from my web site to my home PC. Man I am lost.

                Perhaps the CGI solution is best, but i'm affraid I dont have a clue about how to write cgi. Can you help?

                Comment


                  #23
                  Below is a link that shows how to do some buttons with urls. Bottom link is one of my cam test pages where you can see one way to control stuff using apache and batch files. You culd just as well turn lights on/off as move the cam. This page is hosted on geocities. If you get an x10 firecracker kit, you would need a real hardware serial port for use with it and the batch files.

                  http://www.comp.leeds.ac.uk/Perl/Cgi/forms.html
                  http://www.geocities.com/zoomkat/ezservo1.htm
                  Why I like my 2005 rio yellow Honda S2000 with the top down, and more!

                  Comment


                    #24
                    The problem with the iframe solution is the Login/Password prompt.

                    It could be very good if somebody comes with a CGI to interface other sites with HomeSeer.

                    Comment


                      #25
                      Originally posted by marco_polo
                      Yes, I can do cgi. Tell me more please?

                      Also, the help file in Homeseer seems to talk about simply inserting a form button, but i don't see how this form post gets from my web site to my home PC. Man I am lost.

                      Perhaps the CGI solution is best, but i'm affraid I dont have a clue about how to write cgi. Can you help?

                      Are you or are you not running the HomeSeer web server? Can this web server be accessed from outside your LAN?
                      💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                      Comment


                        #26
                        yes and yes

                        Yes, I am running the HS web server. And yes I can access it from outside my home.

                        Comment


                          #27
                          Originally posted by marco_polo
                          Yes, I can do cgi. Tell me more please?

                          Also, the help file in Homeseer seems to talk about simply inserting a form button, but i don't see how this form post gets from my web site to my home PC. Man I am lost.

                          Perhaps the CGI solution is best, but i'm affraid I dont have a clue about how to write cgi. Can you help?
                          CGI is a protocol. Which languages do you have experience with? The exact steps used here will be vary depending on which language you use, but here's a rough approximation:

                          1> Write the script. It needs to do some version of the following

                          - Parse the url and determine whether it's an on or off command
                          - Logon using username/password
                          - Navigate to the devices page (if it is not your homepage)
                          - Parse data from page
                          - Send on/off command as HTTP request
                          - Logoff

                          2> Setup CGI environment. Make sure language is installed (perl etc, whatever you're using). Make sure proper libraries are installed.

                          3> Install script into the proper directory with the proper permissions.

                          4> Modify web page to trigger the CGI script.

                          There are some challenges to this approach you should be prepared for.

                          - This whole methodology can be tough to debug. As always experience helps.
                          - Changes to the username/password would break this
                          - Changes to the HS UI may break this
                          - If the HS server hangs, or the connection to the HS server goes out, your web page will hang
                          - The CGI script must contain login information. You might not want that sitting out on a hosted server somewhere (I sure wouldn't). This could be addressed by compiling the CGI program so it's not human readable and storing the login info in an encrypted file.

                          Comment


                            #28
                            Originally posted by marco_polo
                            Yes, I am running the HS web server. And yes I can access it from outside my home.
                            Let me make sure I understand what you want to do and I can throw together a page for you.
                            Are you wanting a page on your HS webserver that is viewable to the public that has on the left 2 buttons to turn on and off a light and to the right of the image of your web camera? If so contact me via PM on this BB with your URL and port of your web server and the URL and port of your camera and I will put together an asp page for you.
                            Last edited by Rupp; April 12, 2005, 09:11 PM.
                            💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                            Comment

                            Working...
                            X