Announcement

Collapse
No announcement yet.

How to tell if a player is playing from a script

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

    How to tell if a player is playing from a script

    I have a script I would like to check if a sonos player is playing and I've tried this:

    Code:
    hs.writelog("BathroomMusic",hs.DeviceValueByName("RINCON_000E5870EB2201400"))
    But it seems to return -1 no matter what.

    What is the correct way to determine if a sonos player is playing from within a script?

    #2
    Originally posted by sifuhall View Post
    I have a script I would like to check if a sonos player is playing and I've tried this:

    Code:
    hs.writelog("BathroomMusic",hs.DeviceValueByName("RINCON_000E5870EB2201400"))
    But it seems to return -1 no matter what.

    What is the correct way to determine if a sonos player is playing from within a script?
    Don't know either but the name looks wrong. Click on the hyperlink for the player status device in the device status page. I think it may show the reference (number) and perhaps the right Name to use. If you can't find either all HS references can be found in the sonos.ini config file.

    Dirk

    Comment


      #3
      hs.writelog("BathroomMusic",hs.DeviceValueByName("Floor Room State"))

      Or find the device ref of the "State" device for the player you're interested in and use hs.DeviceValue(ref)

      1=Playing
      2=Stopped
      3=Paused

      Paul..

      Comment


        #4
        Originally posted by sooty View Post
        hs.writelog("BathroomMusic",hs.DeviceValueByName("Floor Room State"))

        Or find the device ref of the "State" device for the player you're interested in and use hs.DeviceValue(ref)

        1=Playing
        2=Stopped
        3=Paused

        Paul..
        Originally posted by dcorsus View Post
        Don't know either but the name looks wrong. Click on the hyperlink for the player status device in the device status page. I think it may show the reference (number) and perhaps the right Name to use. If you can't find either all HS references can be found in the sonos.ini config file.

        Dirk

        Thank you both! That worked great!

        Comment

        Working...
        X