Announcement

Collapse
No announcement yet.

IR Devices

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

  • sonypoolplr
    replied
    Once again thanks for your help with this.

    Leave a comment:


  • CFGuy
    replied
    Just make sure you copy the right lines and you should be fine.
    Look for this section
    <pre class="ip-ubbcode-code-pre">
    Set dv = hs.GetDeviceByRef(Request.Form("selectremote"))
    dv.CustomStatus.status = Request.Form("irvalue")
    if dv.Location = "Living Room" AND dv.Name="Some Amp" Then
    Select Case Request.Form("keylabel")
    Case "input_cd" hs.SetDeviceValue("n35"),10
    hs.SetDevicetring"n35","&lt;img align=""absmiddle"" src=""cdrom1.gif""&gt; CD"
    Case "input_tuner" hs.SetDeviceValue("n35"),20
    End Select
    End if
    Set dv = Nothing
    </pre>

    And just add more like this
    <pre class="ip-ubbcode-code-pre">
    Set dv = hs.GetDeviceByRef(Request.Form("selectremote"))
    dv.CustomStatus.status = Request.Form("irvalue")
    if dv.Location = "Living Room" AND dv.Name="Some Amp" Then
    Select Case Request.Form("keylabel")
    Case "input_cd" hs.SetDeviceValue("n35"),10
    hs.SetDevicetring"n35","&lt;img align=""absmiddle"" src=""cdrom1.gif""&gt; CD"
    Case "input_tuner" hs.SetDeviceValue("n35"),20
    End Select
    End if
    if dv.Location = "Theatre Room" AND dv.Name="Some Amp" Then
    Select Case Request.Form("keylabel")
    Case "input_cd" hs.SetDeviceValue("n25"),10
    hs.SetDevicetring"n25","&lt;img align=""absmiddle"" src=""cdrom1.gif""&gt; CD"
    Case "input_tuner" hs.SetDeviceValue("n25"),20
    End Select
    End if
    Set dv = Nothing
    </pre>

    Leave a comment:


  • sonypoolplr
    replied
    Thanks that is working perfectly. Now for the other amps I have, do I just keep adding their codes right after the one for the living room? I am trying to add them right after the other ones but I keep getting script errors. Again thanks a lot.

    Leave a comment:


  • CFGuy
    replied
    Try this. I have added the extra code in.
    Attached Files

    Leave a comment:


  • CFGuy
    replied
    You can't have two cases with the same value in the select.

    <pre class="ip-ubbcode-code-pre">
    Case "input_cd" hs.SetDeviceValue("n35"),10
    Case "input_cd" hs.SetDevicetring"n35","&lt;img align=""absmiddle"" src=""cdrom1.gif""&gt; " & "CD"
    Case "input_tuner" hs.SetDeviceValue("n35"),20
    </pre>

    But you can do this:
    <pre class="ip-ubbcode-code-pre">
    Case "input_cd" hs.SetDeviceValue("n35"),10
    hs.SetDevicetring"n35","&lt;img align=""absmiddle"" src=""cdrom1.gif""&gt; CD"
    Case "input_tuner" hs.SetDeviceValue("n35"),20
    </pre>

    Leave a comment:


  • sonypoolplr
    replied
    After making the changes I am now getting this:
    "
    Response.Send "
    "
    That is with just the first part added, nothing else.

    Leave a comment:


  • CFGuy
    replied
    Change all the fs.Add to Response.Write

    Leave a comment:


  • sonypoolplr
    replied
    If I put in this:
    fs.Add "&lt;input type=""hidden"" name=""keylabel"" value="""
    fs.Add arrKeys(0,w)
    fs.Add """&gt;"
    Then I get this error:
    Script error: Object required: 'fs' fs.Add "
    with a box after the "fs.Add" that I can type something into.
    If I put this in:
    if dv.Location = "Living Room Amp" AND dv.Name="Amp Input" Then
    Select Case Request.Form("keylabel")
    Case "input_cd" hs.SetDeviceValue("n35"),10
    Case "input_cd" hs.SetDevicetring"n35","&lt;img align=""absmiddle"" src=""cdrom1.gif""&gt; " & "CD"
    Case "input_tuner" hs.SetDeviceValue("n35"),20

    Then I get this error:
    Script error: Expected 'Select' End if Next
    If I keep them both in I get the same error as the second.
    Thanks again

    Leave a comment:


  • CFGuy
    replied
    Did you add both of the sections of the code for testing the label?

    If so I would remove them, make sure the page is working, then add just one of the code snippets. Test the page and then add the second code snippet. That will narrow down which part is causing the error.

    Leave a comment:


  • sonypoolplr
    replied
    I just got around to trying this and I think I did everything right but I am getting the following error:
    Script error: Object required: 'fs' With a box over on the right with this in front of it: fs.Add "
    Since I am not that good with scripting I don't understand this error. Thanks for any help I can get with this.

    Leave a comment:


  • CFGuy
    replied
    No, you would need a bit more information.
    The page as it is right now, doesn't send the label for the clicked button. You would need that to test for "input_cd"
    Line 164 is the end form tag so add this right above that line.
    <pre class="ip-ubbcode-code-pre">
    fs.Add "&lt;input type=""hidden"" name=""keylabel"" value="""
    fs.Add arrKeys(0,w)
    fs.Add """&gt;"
    </pre>
    This now sends you the label which is something easy for you to match on.

    And your if would be more something like this.
    <pre class="ip-ubbcode-code-pre">
    if dv.Location = "Living Room" AND dv.Name="Some Amp" Then
    Select Case Request.Form("keylabel")
    Case "input_cd" hs.SetDeviceValue("s30"),10
    Case "input_video1" hs.SetDeviceValue("s30"),20
    End Select
    End if
    </pre>
    Then just repeat the Case "label" lines to cover all your options. Replace Living Room and Some Amp with the correct location and device name that you want to control.

    Repeat the if sections for each device. Doing it this way will allow for situations where you might have input_cd on more than one device.

    If you have trouble with this, I'll be around tonight to answer questions or help.

    Leave a comment:


  • sonypoolplr
    replied
    I am not storing them in an ini file I am using a HS event to set the device value to either 10,20,30 or 40. So could I use something like:
    If dv=input_cd then hs.SetdeviceValue("s30"),10

    And then have other If/then statements for the other inputs and on/off and mute on/off?

    Thanks

    Leave a comment:


  • CFGuy
    replied
    Do you have the values stored somewhere? Like in an ini file. If there is no way for the page to look up what value should go with each button, then the only way would be to hard code in those values.

    On line 8, I set dv to the device being controlled.
    You could enter some if statements. Compare the location and device name being controlled to ones that you track the status of. If it matches then trigger the same event that the x10 would or just set the device's value and hard code in the correct number.

    Leave a comment:


  • sonypoolplr
    replied
    I am using 10,20,30,and 40 for either CD input, tuner input, video 1 input, and video 2 input. When I change the input of the amp by x10 received I am setting a virtual device to that corresponding value. That way if I am listening to a cd and the phone rings HS switches the input to video 2 (for caller ID announcement) and after a minute it looks at the value of the virtual device to see what the input was before the change and in this case would set the amp back to input CD. Hope this is what you need to help me out. Thanks again.

    Leave a comment:


  • CFGuy
    replied
    Can you explain how you have the values setup? How do you normally change them?

    Leave a comment:

Working...
X