Announcement

Collapse
No announcement yet.

Status help

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

    Status help

    I need a little help with a problem I have on my web page. What I need is a snipit of code that will change the status of my vertical blinds. This is how it works: The H/U code is A9 which controls a super socket. When an on signal (A9-on) is sent to the socket the motors opens (or closes depending on the position) the curtains. Because the motor needs an on signal, I have set up an event that turns the socket off after 10 seconds. That way when another on signal is sent, the curtains reverse. What I need is a way to set the status to either open or closed (just change the status of the device from one to the other) and dispay it on my web page. Right now it only shows on/off but that doesn't tell me much except that my event worked and turned off the super socket.

    Thanks.

    #2
    Set up an event that triggers on A9 on. Type "By x10 command" and place this code in a file to be run in the scripts/speech tab.


    sub main()

    val = hs.devicestring("a9")

    if val = "Open" then
    val = "Closed"
    elseif val = "Closed" then
    val = "Open"
    else
    val = "Open"
    end if

    hs.setdevicestring "a9",val

    end sub

    -Rupp
    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

    Comment


      #3
      Thanks Rupp, I will give that a try this evening. I'm not much of a coder but I should get back into it. Just need some darn time!!! :-)

      Comment

      Working...
      X