Announcement

Collapse
No announcement yet.

Event trigger

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

    Event trigger

    I have set up the following events so that when the zone player in the bathroom is playing and somebody switches on the shower, the volume is increased to compensate for the noise. When the shower is switched off again the bathroom zone player lowers the volume again. For some reason I can't get it to fire.

    I can confirm that the bathroom zone player is playing and when the shower is switched on the current exceeds 40 amps. ( this is visible looking at the device value, this updates every 5 seconds)

    Surely the event should be triggered. I have watched the volume on the sonos controller but no change !

    Help appreciated Click image for larger version

Name:	ImageUploadedByTapatalk1417196022.817204.jpg
Views:	1
Size:	54.8 KB
ID:	1207036

    Cheers


    Cheers

    Steve
    Steve

    #2
    Originally posted by Stevieboy View Post
    I have set up the following events so that when the zone player in the bathroom is playing and somebody switches on the shower, the volume is increased to compensate for the noise. When the shower is switched off again the bathroom zone player lowers the volume again. For some reason I can't get it to fire.

    I can confirm that the bathroom zone player is playing and when the shower is switched on the current exceeds 40 amps. ( this is visible looking at the device value, this updates every 5 seconds)

    Surely the event should be triggered. I have watched the volume on the sonos controller but no change !

    Help appreciated [ATTACH]42597[/ATTACH]

    Cheers


    Cheers

    Steve
    I see two conditions, what is your trigger? Events fire off because some state changed. You are using a Sonos condition isPlaying. An event is something like "becomes xyz" ...
    So it would read something like if "Sandalwood AMPS" becomes bigger than xyz (I assume this is the shower heater(??)" and Sonos IsPlaying then .....

    Dirk

    Comment


      #3
      Thanks Dirk

      The condition is " ISplaying" and the trigger would be the Sandalwood amp increasing to 40 plus amps. You are correct, this would be the shower heater to trigger the event.

      I take it I have missed the obvious here !


      Cheers

      Steve
      Steve

      Comment


        #4
        I think I see the error of my ways. Like this ?Click image for larger version

Name:	ImageUploadedByTapatalk1417198033.434177.jpg
Views:	1
Size:	132.1 KB
ID:	1175340


        Cheers

        Steve
        Steve

        Comment


          #5
          Originally posted by Stevieboy View Post
          I think I see the error of my ways. Like this ?[ATTACH]42598[/ATTACH]


          Cheers

          Steve
          Indeed, the only problem is, I think this event is going to fire each time the amp reading changes, not sure you can have an event where it changes at least x amps, so it clearly is the power being turned on or off and not just some minor fluctuation. I assume when the heater is off, the reading is zero. If so, perhaps that's how you structure your trigger.

          Dirk

          Comment


            #6
            Event trigger

            Thanks Dirk, easy when you know how.

            Yes, that's a valid point. I have just tried it and it works fine.

            The only problem is that the current is taken at source on the electricity meter, this ticks along at about 4/5 amps, unless oven is switched on etc. shower takes it over the 40 amp mark hence the reason it's set it up like this.

            Not sure of any other way to do it !


            Edit - just checked log and you are correct, it fires the decrease volume event every time the amps fluctuate :-(



            Cheers

            Steve
            Steve

            Comment


              #7
              Originally posted by Stevieboy View Post
              Thanks Dirk, easy when you know how.

              Yes, that's a valid point. I have just tried it and it works fine.

              The only problem is that the current is taken at source on the electricity meter, this ticks along at about 4/5 amps, unless oven is switched on etc. shower takes it over the 40 amp mark hence the reason it's set it up like this.

              Not sure of any other way to do it !


              Edit - just checked log and you are correct, it fires the decrease volume event every time the amps fluctuate :-(



              Cheers

              Steve
              You need something like a "latch", some flag (variable) you set when your reading crosses the 40amp mark and only call Sonos when the flag wasn't set, as soon as it is set you would ignore any fluctuation above 40 amp (same for when you go below 40 amp)

              Dirk

              Comment


                #8
                Hi Dirk,

                Thanks, this seems to do the trick :-)Click image for larger version

Name:	ImageUploadedByTapatalk1417269608.353810.jpg
Views:	1
Size:	194.9 KB
ID:	1175350


                Cheers

                Steve
                Steve

                Comment


                  #9
                  On a different note, I am trying to simplify some of my events. please forgive me if this has been covered before!

                  I note that this one does not unlink master bedroom player from the rest of the zones, I think originally I listed all zones to unlink individually in the event and it worked.

                  I just want to play radio station on master bedroom only with other players unlinked.

                  Is the event in snapshot correctly set up to do this ?Click image for larger version

Name:	ImageUploadedByTapatalk1417270061.715368.jpg
Views:	1
Size:	127.3 KB
ID:	1175351


                  Cheers

                  Steve
                  Steve

                  Comment


                    #10
                    Originally posted by Stevieboy View Post
                    On a different note, I am trying to simplify some of my events. please forgive me if this has been covered before!

                    I note that this one does not unlink master bedroom player from the rest of the zones, I think originally I listed all zones to unlink individually in the event and it worked.

                    I just want to play radio station on master bedroom only with other players unlinked.

                    Is the event in snapshot correctly set up to do this ?[ATTACH]42609[/ATTACH]


                    Cheers

                    Steve
                    I suspect you will get in trouble when the bedroom player is the master of the group and other players are linked TO the bedroom player. In that case the unlink command will not do anything. The event will only work when the bedroom player is slave in a group and another player is master.

                    Dirk

                    Comment


                      #11
                      Originally posted by dcorsus View Post
                      I suspect you will get in trouble when the bedroom player is the master of the group and other players are linked TO the bedroom player. In that case the unlink command will not do anything. The event will only work when the bedroom player is slave in a group and another player is master.

                      Dirk

                      Thanks Dirk

                      I was under the impression that the master bedroom player was the master ( in this event). I understand between Master and slave but always thought that the player you have "asked" to play music is the the master and other that you ask to link to it are slaves ????

                      Silly, question but how do you know which one is master ?

                      Cheers


                      Cheers

                      Steve
                      Steve

                      Comment


                        #12
                        Originally posted by Stevieboy View Post
                        I was under the impression that the master bedroom player was the master ( in this event). I understand between Master and slave but always thought that the player you have "asked" to play music is the the master and other that you ask to link to it are slaves ????
                        This event doesn't show anything about who is master or not, it just shows that you want to remove a slave from a group (Unlink) and that will only work if the player was a slave. I'm currently looking at whether I can change the code to do different (and the right things) irrespective of being slave or master.

                        Originally posted by Stevieboy View Post
                        Silly, question but how do you know which one is master ?
                        you don't know -- unless you remember how you created the grouping. The master is the player you used (think your controller screen, that group button) to click on "group" and than added all other players to it.

                        Comment


                          #13
                          Thanks Dirk,

                          So this event appears to be correct ?


                          It drops all slaves players and just plays on the Master bedroom player. Good example about the group button. Gives me a better understanding about how to group/drop zones. Click image for larger version

Name:	ImageUploadedByTapatalk1417282790.331870.jpg
Views:	1
Size:	182.1 KB
ID:	1175354


                          Cheers

                          Steve
                          Steve

                          Comment


                            #14
                            Originally posted by Stevieboy View Post
                            Thanks Dirk,

                            So this event appears to be correct ?


                            It drops all slaves players and just plays on the Master bedroom player. Good example about the group button. Gives me a better understanding about how to group/drop zones. [ATTACH]42617[/ATTACH]


                            Cheers

                            Steve
                            This would be correct but not sure you're going to be happy (all the time) with the result. If you had some other grouping going on in the house, this will mess everything up. I'll try to post an update this weekend.

                            Dirk

                            Comment


                              #15
                              Thanks Dirk,

                              I look forward to it. Still my favourite PI after all this time. Am just trying to improve on some of my events that I setup a while ago and make HS a bit more self sufficient and fine tuned!

                              Look forward to the update :-)


                              Cheers

                              Steve
                              Steve

                              Comment

                              Working...
                              X