Announcement

Collapse
No announcement yet.

Virtual device value in &hs.GetURL

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

  • Virtual device value in &hs.GetURL

    I'm using http calls to change the position of my blinds. I have some events running script commands like below which works great.

    Code:
    &hs.GetURL("http://192.168.2.71","/setposition/ED:FE:DB:B3:F4:01/position",TRUE,8080)
    But I'd like to use a virtual device's value as replacement for position above, i.e.

    Code:
    IF <virtual device> had its value set or changed
    THEN &hs.GetURL("http://192.168.2.71","/setposition/ED:FE:DB:B3:F4:01/<value of virtual device>",TRUE,8080)
    This would allow me to simply drag the slider to set the blind's position. Suggestions?

  • #2
    You can do this with either the device reference number of name. One example:
    Code:
    IF <virtual device> had its value set or changed
    THEN &hs.GetURL("http://192.168.2.71","/setposition/ED:FE:DB:B3:F4:01/" & hs.devicevalueEx(1234),TRUE,8080)
    Where 1234 is the virtual device reference number
    Jon

    Comment

    Working...
    X