Announcement

Collapse
No announcement yet.

using a device value in a url ?

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

  • Vincenttor
    replied
    Thats fast Mr happy,

    Well i did copy the code you wrote.
    It does not respond.

    Did some tests, with the string i used
    Code:
    const server_url = "http://vusolo2/api/message?text=$$DSR:150:&type=2&timeout=2&_=1456770893382"
    It gives a text box on the tv.
    So i thought well let's see what it does when i change const to dim.
    But then there is no more response.

    Then i thought let's try to do this but change dim to const
    Code:
    const server_url = "http://vusolo2/api/message?text=" &  hs.devicevalueex(150) &  "&type=2&timeout=2&_=1456770893382"
    But this also did not respond.
    Not sure if the " " signs are the problem here.
    Also googled on the hs.devicevalueex to see how it was used but i see that the device number is in some scripts also between "150" so tried this as well with no result.
    I guess this is also not necessary since the part already starts with " & hs.device etc etc "
    Last edited by Vincenttor; February 29, 2016, 05:26 PM.

    Leave a comment:


  • mrhappy
    replied
    Originally posted by Vincenttor View Post
    Well what i suddenly thought of is the following.
    I am using a Vusolo 2 satellite receiver for my TV.
    This has a web control function, i used Wireshark to capture some strings that i can use in homeseer for controlling almost everything.

    This also has the function to display a message on the tv screen , it also has a question message where you have to respond with Yes or No and it gives the pressed value back to the browser.

    So i thought, this would be great to display notices, for example device values when someone is calling the number.
    Or when there is movement or well, whatever you want.

    Also the option that it responds on YES or NO i can think of some nice things and further down the road i will think of different things for this solution

    What i am trying is to get a device value in the url, but i am a bit stuck with this.

    The url i need to trigger is this :

    http://vusolo2/api/message?text=HERE COMES THE MESSAGE&type=2&timeout=2&_=1456770893382


    So what i am trying to do , and not sure if this is possible is use a post command and then repace the HERE COMES THE MESSAGE with a value of a sensor.
    Code:
    dim s
    const server_url = "http://vusolo2/api/message?text=$$DSR:150:&type=2&timeout=2&_=1456770893382"
    const headers="Content-Type: application/x-www-form-urlencoded"  
    
    s = hs.URLAction(server_url, "POST", data, headers)
    I do see the message but it contains the device number, is this even possible to do this by calling a script ?
    You will probably need to change const to dim (because a constant will change with the device value) but I don't know if a script handles that differently.

    Use hs.devicevalueex and do something like this

    dim s
    dim server_url = "http://vusolo2/api/message?text=" & hs.devicevalueex(150) & "&type=2&timeout=2&_=1456770893382"
    const headers="Content-Type: application/x-www-form-urlencoded"

    s = hs.URLAction(server_url, "POST", data, headers)

    Leave a comment:


  • Vincenttor
    started a topic using a device value in a url ?

    using a device value in a url ?

    Well what i suddenly thought of is the following.
    I am using a Vusolo 2 satellite receiver for my TV.
    This has a web control function, i used Wireshark to capture some strings that i can use in homeseer for controlling almost everything.

    This also has the function to display a message on the tv screen , it also has a question message where you have to respond with Yes or No and it gives the pressed value back to the browser.

    So i thought, this would be great to display notices, for example device values when someone is calling the number.
    Or when there is movement or well, whatever you want.

    Also the option that it responds on YES or NO i can think of some nice things and further down the road i will think of different things for this solution

    What i am trying is to get a device value in the url, but i am a bit stuck with this.

    The url i need to trigger is this :

    http://vusolo2/api/message?text=HERE COMES THE MESSAGE&type=2&timeout=2&_=1456770893382


    So what i am trying to do , and not sure if this is possible is use a post command and then repace the HERE COMES THE MESSAGE with a value of a sensor.
    Code:
    dim s
    const server_url = "http://vusolo2/api/message?text=$$DSR:150:&type=2&timeout=2&_=1456770893382"
    const headers="Content-Type: application/x-www-form-urlencoded"  
    
    s = hs.URLAction(server_url, "POST", data, headers)
    I do see the message but it contains the device number, is this even possible to do this by calling a script ?
Working...
X