Announcement

Collapse
No announcement yet.

Events with Sonos Triggers do not filter correctly

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

    Events with Sonos Triggers do not filter correctly

    I have 6 events that use Sonos Triggers and conditions. When I filter events on any device, the events with Sonos Triggers or Conditions will show up. Below is a screenshot of my events filtered on a single device and that single device is not used in any event. This same result will be true on any device filter. If I filter on any device that is in events, those events will show up AND all six containing the Sonos trigger. I have also confirmed that it is the Sonos Trigger or condition that causes the filtering error, not any Sonos Device. I created an event with a Sonos Trigger, no conditions and no actions and it will show up when filtered on ANY device.

    Click image for larger version

Name:	Capture.jpg
Views:	1
Size:	93.5 KB
ID:	1210429

    I have marked the Triggers and Conditions that cause the filteringerrors.

    Click image for larger version

Name:	Capture1.jpg
Views:	1
Size:	18.0 KB
ID:	1210430

    Click image for larger version

Name:	Capture2.jpg
Views:	1
Size:	17.6 KB
ID:	1210431

    This is a minor problem and is very easy to duplicate. If you need more information let me know.
    Last edited by randy; January 18, 2017, 09:55 AM.
    HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

    #2
    Originally posted by rprade View Post
    I have 6 events that use Sonos Triggers and conditions. When I filter events on any device, the events with Sonos Triggers or Conditions will show up. Below is a screenshot of my events filtered on a single device and that single device is not used in any event. This same result will be true on any device filter. If I filter on any device that is in events, those events will show up AND all six containing the Sonos trigger. I have also confirmed that it is the Sonos Trigger or condition that causes the filtering error, not any Sonos Device. I created an event with a Sonos Trigger, no conditions and no actions and it will show up when filtered on ANY device.

    [ATTACH]58953[/ATTACH]

    I have marked the Triggers and Conditions that cause the filteringerrors.

    [ATTACH]58955[/ATTACH]

    [ATTACH]58956[/ATTACH]

    This is a minor problem and is very easy to duplicate. If you need more information let me know.
    I wouldn't even know where to start looking, these are HS3 functions not of a PI. I suspect however that the HS3 filtering is able to only filter on HS devices (it has a unique HS REF and all possible values or ranges are known) and unable to filter on complex conditions. All my triggers/conditions have at least 2 parameters, one being a state/value and the other which player. My recommendation is to post this question somewhere where the HS team will see it and comment on what it might be or where we might start looking. As far as I recall, there is no function in the PI API that would return a yea/nay if something should or shouldn't be shown, there is a call HOW something is shown.

    Dirk

    Comment


      #3
      Originally posted by dcorsus View Post
      I wouldn't even know where to start looking, these are HS3 functions not of a PI. I suspect however that the HS3 filtering is able to only filter on HS devices (it has a unique HS REF and all possible values or ranges are known) and unable to filter on complex conditions. All my triggers/conditions have at least 2 parameters, one being a state/value and the other which player. My recommendation is to post this question somewhere where the HS team will see it and comment on what it might be or where we might start looking. As far as I recall, there is no function in the PI API that would return a yea/nay if something should or shouldn't be shown, there is a call HOW something is shown.

      Dirk
      I sent Rich an email. There are many other plug-ins that use their own triggers based upon devices they use, that do not exhibit this behavior. Yours is the only one.
      HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

      Comment


        #4
        I think it has something to do with ActionReferencesDevice / TriggerReferencesDevice, your plugin probably always return true.

        Comment


          #5
          Originally posted by spud View Post
          I think it has something to do with ActionReferencesDevice / TriggerReferencesDevice, your plugin probably always return true.
          You were right, I return always true for TriggerReferencesDevice and always false for ActionReferencesDevice.

          What I can't get my head around is what this function call is supposed to do? Way back when I created this PI the sample code had no meaning for it so neither did I ever change it. Is there a better example out there or an explanation what it is supposed to do?

          Thanks,

          Dirk

          Comment


            #6
            Originally posted by dcorsus View Post
            What I can't get my head around is what this function call is supposed to do? Way back when I created this PI the sample code had no meaning for it so neither did I ever change it. Is there a better example out there or an explanation what it is supposed to do?
            I have never implemented those functions, all my plugins always return false, but I guess you are supposed to check if the device passed as the 2nd parameter is used in the action/trigger passed as the 1st parameter, if that is the case return true.

            I will try it on my EasyTrigger plugin for which the device filters could be usefull.

            Comment


              #7
              Originally posted by spud View Post
              I have never implemented those functions, all my plugins always return false, but I guess you are supposed to check if the device passed as the 2nd parameter is used in the action/trigger passed as the 1st parameter, if that is the case return true.

              I will try it on my EasyTrigger plugin for which the device filters could be usefull.
              After studying it some more, I think you are right that we are supposed to look at the data and tell HS whether any of our devices matches the dvRef provided.
              I believe I was mistakenly returning true for all trigger checks.
              My PIs whether action or trigger don't really have a 1:1 relationship with any HS device, else I wouldn't have added the special Sonos Actions or Conditions. So I'm leaning towards just always return false.

              The only counter argument is the isPlaying, isStopped .. conditions which have some relation with 2 out of 19 or so HS devices this PI creates per player, but this requires a good bit of code for which I fail to see then benefit, or might actually still be wrong given it doesn't match a SINGLE HS device (dvRef)

              Dirk

              Comment


                #8
                To Spud and Dirk;

                It would be great if both plug-ins would filter correctly on actual devices used in Triggers, Conditions or Actions.

                For any triggers or Conditions that are plug-in specific and not related to a device, they should return false.

                It would be nice for events using Spud's plug-in pertaining to specific devices to show up in device filters, which it does not now.
                HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

                Comment


                  #9
                  Originally posted by rprade View Post
                  To Spud and Dirk;

                  It would be great if both plug-ins would filter correctly on actual devices used in Triggers, Conditions or Actions.

                  For any triggers or Conditions that are plug-in specific and not related to a device, they should return false.

                  It would be nice for events using Spud's plug-in pertaining to specific devices to show up in device filters, which it does not now.
                  As stated, my PI creates a ton of devices and you can use those to create conditions etc. On top of that there are SONOS ACTIONS which don't have devices and therefore this mechanism in my opinion should actually return false.

                  I guess the litmus test would be to use a condition/trigger that is a Sonos PI HS Device and see if the filtering works as designed.

                  Don't get me wrong, what you have now, is wrong, the PI should return false and therefore when you set your filters, the wrong events wouldn't show (or so I think ). I can post a test version for you to try.

                  Dirk

                  Comment


                    #10
                    Originally posted by rprade View Post
                    It would be nice for events using Spud's plug-in pertaining to specific devices to show up in device filters, which it does not now.
                    I have implemented those functions in version 3.0.0.31 of the EasyTrigger plugin so that now the device filter works with the Easy triggers and actions

                    Comment


                      #11
                      Originally posted by spud View Post
                      I have implemented those functions in version 3.0.0.31 of the EasyTrigger plugin so that now the device filter works with the Easy triggers and actions
                      Spud what exactly did you change? I don't really have any relation ship with the action/trigger data and the dvRef so my change is to always return false rather than true.

                      Dirk

                      Comment


                        #12
                        Originally posted by dcorsus View Post
                        Spud what exactly did you change? I don't really have any relation ship with the action/trigger data and the dvRef so my change is to always return false rather than true.

                        Dirk
                        I guess returning always false is fine for 95% of the plugins, but the EasyTrigger plugin add some triggers and actions that let you choose a device as a parameter, so for those I implemented the functions.

                        Comment


                          #13
                          Originally posted by dcorsus View Post
                          Spud what exactly did you change? I don't really have any relation ship with the action/trigger data and the dvRef so my change is to always return false rather than true.

                          Dirk
                          Have you thought about applying the same fix to this plug-in that Spud did to his? Let it return false, I think the devices would still return true. If you want to send me a build, I can try it and let you know if it breaks anything.
                          HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

                          Comment


                            #14
                            Originally posted by rprade View Post
                            Have you thought about applying the same fix to this plug-in that Spud did to his? Let it return false, I think the devices would still return true. If you want to send me a build, I can try it and let you know if it breaks anything.
                            Didn't I provide a test build for this?
                            If not, it's attached here.
                            Dirk
                            Attached Files

                            Comment


                              #15
                              Originally posted by dcorsus View Post
                              Didn't I provide a test build for this?
                              If not, it's attached here.
                              Dirk
                              If you did, I missed it. I'll try this one now and post back in a few.
                              HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

                              Comment

                              Working...
                              X