Announcement

Collapse
No announcement yet.

How to use device on/off buttons for script controlled devices

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

    How to use device on/off buttons for script controlled devices

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="ProgId" content="OneNote.File"><meta name="Generator" content="Microsoft OneNote 14"> I have a remote relay circuit connected to HomeSeer via a serial interface. The relay can be turned on/off locally via a button, or remotely via HomeSeer (which sends it a serial command). HomeSeer needs to keep track of the current status of the device.

    That way it is configured now, pressing the local button turns the relay on (or off) and sends a serial string to HomeSeer which runs a HomeSeer script to update the device string and value (so the HS website shows its current status.)

    This works great, and if that was the only way to control it, I would be done.

    The challenge I'm having is how to allow for control from the HomeSeer webpage. How do I trigger an event when a user clicks on "On" button on the HomeSeer webpage?

    I currently have an event that triggers when the status changes to "On". But the problem is this event also gets triggered when the device string is updated from the script triggered by local control.

    For example: The relay gets turned on via the local button. This sends a serial string to HomeSeer to update the device status. The status gets updated via a script. This status change now triggers the event on HomeSeer to turn the device on (which is already on).

    I need a way to capture the event of a user clicking the "On" button (on the webpage) other than simply monitoring that status change.

    I'm very interested in anyone's thoughts and ideas. I'm happy to share more information if needed.

    Thanks,
    Robert.

    P.S. I'm sure this situation has arisen before but I've been searching the forum for other posts and cannot seem to find anything that helps.

    #2
    Originally posted by azrobbo View Post
    I need a way to capture the event of a user clicking the "On" button (on the webpage) other than simply monitoring that status change.
    My approach to accomplish this was the following:
    I suggest you to use the hs.PollDevice and save the status value in an INI file
    hs.SaveINISetting. You are then abled to access that INI and retrieve the status value and depending on the answer do what ever you like. You can study the script here:

    http://board.homeseer.com/showthread.php?t=140406

    Comment

    Working...
    X