Announcement

Collapse
No announcement yet.

Capi needed??

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

    Capi needed??

    I'm trying to change the iTunes player state from within a script. Reason being that setting the state to pause when it is paused starts it playing.
    I can change the state from a script, but it only changes the icon and doesn't stop iTunes if it is playing.
    I suspect I will need some sort of Capi shizzle??
    Any ideas or help would be much appreciated.
    Cheers
    J
    Code:
    sub main (ByVal jwdeviceid As string)
    'iTunes player state device id is 7
    'device value 4 is playing
    'device value 3 is paused
      dim dimlevel
      dimlevel = hs.devicevalue (jwdeviceid)
       if dimlevel = 4 then
      dimlevel = 3
      hs.SetDeviceValuebyref(jwdeviceid, dimlevel, true)
      hs.WriteLog("JW", "iTunes set to Paused Variables are : iTunes device - " & jwdeviceid & " : iTunes device state code  - " & dimlevel)
      else
      dimlevel = 3
      hs.SetDeviceValuebyref(jwdeviceid, dimlevel, true)
      hs.WriteLog("JW", "iTunes wasn't playing Variables are : iTunes device - " & jwdeviceid & " : iTunes device state code  - " & dimlevel)
      end if
     
    End Sub

    #2
    Originally posted by Skinnez View Post
    I suspect I will need some sort of Capi shizzle??
    Any ideas or help would be much appreciated.
    Cheers
    J
    Hi J,

    Likely does need CAPI. Can you post a screen shot of the Status Graphics tab of the device and I can likely help.

    Cheers
    Al
    HS 4.2.8.0: 2134 Devices 1252 Events
    Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

    Comment


      #3
      Capi needed??

      There you go Al
      And a happy new year (soon) to ya!!


      Always helps when someone walks you through it [emoji1]
      Cheers
      J

      Comment


        #4
        Hi J, the picture is not showing up. You can directly insert it into your post rather than linking to a picture on another site.

        Cheers
        Al
        HS 4.2.8.0: 2134 Devices 1252 Events
        Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

        Comment


          #5
          Yeah ok, it's tapatalk from my phone. Not tried it before, I'll post it later just popping out.
          Cheers
          J

          Comment


            #6
            There you go.

            Cheers

            J
            Attached Files

            Comment


              #7
              Ok, try something like this:

              Code:
              hs.CAPIControlHandler(hs.CAPIGetSingleControl(CDbl(jwdeviceid),true,"Play",false,true))
              And if that doesn't work try changing the first true to a false.

              Cheers
              Al
              HS 4.2.8.0: 2134 Devices 1252 Events
              Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

              Comment


                #8
                Wow that's a bit easier than I thought, thanks!!
                Ill give it a try, then figure out what/how it does

                Cheers
                J

                Comment


                  #9
                  Originally posted by Skinnez View Post
                  Wow that's a bit easier than I thought, thanks!!
                  Ill give it a try, then figure out what/how it does

                  Cheers
                  J
                  You're welcome. Yes, the CAPIGetSingleControl command can be used for most devices and once you understand how it works, it's pretty easy to use.

                  You can likely get away with this as well:

                  Code:
                  hs.CAPIControlHandler(hs.CAPIGetSingleControl(jwdeviceid,true,"Play",false,true))
                  Cheers and happy new year!
                  Al
                  HS 4.2.8.0: 2134 Devices 1252 Events
                  Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                  Comment


                    #10
                    Aye you too

                    Comment


                      #11
                      Thanks Al that worked !!
                      Unfortunately I am still having issues with this plugin that need sorting

                      Comment

                      Working...
                      X