Announcement

Collapse
No announcement yet.

Sending multiple capi commands

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

    Sending multiple capi commands

    So I have my wifi2ir and the global cache pro plugin. If I want to switch the set top box to channel 2, the capi commnd string would be hs.CAPIControlHandler(hs.CAPIGetSingleControl(704,True,"DIGI T 2",False,False)). If I understand the way the wifi2ir would send commands to issue a channel of say 29, I'm guessing that there would be two command strings sent. One for the 2, then one for the 9.
    How would the method be created to send capi1 command + capi2 command +... ???
    Is this the preferred method or are there other suggestions that would work?

    The ultimate goal here is to use Jon's alexa script and pass in the integer for the channel I want, from my echo, do some parsing which I then think would need to be broken down to multiple send commands. So for example, it I say change the channel to 29, two command strings would be sent to the wifi2ir from within the script.

    Robert
    HS3PRO 3.0.0.500 as a Fire Daemon service, Windows 2016 Server Std Intel Core i5 PC HTPC Slim SFF 4GB, 120GB SSD drive, WLG800, RFXCom, TI103,NetCam, UltraNetcam3, BLBackup, CurrentCost 3P Rain8Net, MCsSprinker, HSTouch, Ademco Security plugin/AD2USB, JowiHue, various Oregon Scientific temp/humidity sensors, Z-Net, Zsmoke, Aeron Labs micro switches, Amazon Echo Dots, WS+, WD+ ... on and on.

    #2
    You should be able to do something like this:

    PHP Code:
      Sub Main(ByVal Parm As String)

            
    Dim Digit As String ""

            
    For Each c As Char In Parm
                Digit 
    "DIGIT " c
                hs
    .CAPIControlHandler(hs.CAPIGetSingleControl(704,True,Digit,False,False))
                
    hs.waitsecs(0.2)
            
    Next

        End Sub 
    I don't use the Global Cache Pro plugin, however the original Global cache plugin used the following syntax which could be an alternative:

    PHP Code:
      Sub Main(ByVal Parm As String)

            
    Dim Digit As String ""
            
    For Each c As Char In Parm
                Digit 
    "DIGIT " c
                hs
    .PluginFunction("Global Cache","","SendIR", new Object() {"192.168.1.XX"1Digit})
                
    hs.waitsecs(0.2)
            
    Next

        End Sub 
    Jon

    Comment


      #3
      Thank you very much Jon. I'll give your suggestions a try.

      Robert
      HS3PRO 3.0.0.500 as a Fire Daemon service, Windows 2016 Server Std Intel Core i5 PC HTPC Slim SFF 4GB, 120GB SSD drive, WLG800, RFXCom, TI103,NetCam, UltraNetcam3, BLBackup, CurrentCost 3P Rain8Net, MCsSprinker, HSTouch, Ademco Security plugin/AD2USB, JowiHue, various Oregon Scientific temp/humidity sensors, Z-Net, Zsmoke, Aeron Labs micro switches, Amazon Echo Dots, WS+, WD+ ... on and on.

      Comment


        #4
        Robert,

        Did you get this working?
        Jon

        Comment

        Working...
        X