Announcement

Collapse
No announcement yet.

Need help with an Event for Lights to turn off with no motion after TV is OFF

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

    Need help with an Event for Lights to turn off with no motion after TV is OFF

    So, I have an event to turn the lights on when there is motion and the illuminance is a certain %. I have another event to dim the lights, if they are on, to 50% when the TV is on. I have another event to Turn the lights off when there is no motion and the TV isn't on. However, I am having trouble with once the TV is turned off, the lights stay at 50% and they don't turn off once there isn't motion in the room. Can someone help with this? I want the lights to go back to 100% once the TV is turned off and then they should turn off when there isn't motion. Click image for larger version

Name:	LIving Room Lights.png
Views:	182
Size:	353.4 KB
ID:	1347049

    #2
    Originally posted by pcgirl65 View Post
    So, I have an event to turn the lights on when there is motion and the illuminance is a certain %. I have another event to dim the lights, if they are on, to 50% when the TV is on. I have another event to Turn the lights off when there is no motion and the TV isn't on. However, I am having trouble with once the TV is turned off, the lights stay at 50% and they don't turn off once there isn't motion in the room. Can someone help with this? I want the lights to go back to 100% once the TV is turned off and then they should turn off when there isn't motion.
    What you want is a bit of a conundrum, because you need to know if there is motion or has been motion less than 2 minutes ago. Your Off Event is looking for there to be No Motion for 2 minutes and for both lights to be On.

    Click image for larger version  Name:	image_84214.png Views:	0 Size:	157.6 KB ID:	1347060

    One fix would be to change the last two Conditions to look for the lights to be "Not Equal to" Off. This would turn the lights Off as soon as the TV is Off and if there has been No Motion for 2 minutes. That is not what you wanted, so the next best thing is to leave that Event as is and create another Event. This Event will run when the TV is turned Off and if both lights are at some level between Off and On.

    Click image for larger version  Name:	capture.png Views:	0 Size:	61.0 KB ID:	1347061

    The result is that this Event will run as soon as the wattage is set to less than 10 as long as the lights are at your dim level. Of course your
    "Living Room Lights Off Event will run immediately after the two lights are set to On, if there has been no motion for at least 2 minutes, turning both lights Off.

    You could make the whole thing a little more predictable with a Virtual Device for room occupancy. I use a Virtual Device for room occupancy as well as one for the TV. I will post examples of that next.




    Randy Prade
    Aurora, CO
    Prades.net

    PHLocation - Pushover - EasyTrigger - UltraECM3 - Ultra1Wire3 - Arduino

    Comment


      #3
      Here are my Events to control the TV virtual Device

      Click image for larger version  Name:	capture.png Views:	0 Size:	72.3 KB ID:	1347065

      And here are my Living Room Occupancy Events, since my Kitchen is more or less attached to the Living Room, I look at both sensors. In our house we use a rather liberal timeout of 15 minutes, before an area is deemed Vacant. You could change this to 2 minutes as in your examples, but for us that timing is way too tight. We have no desire to have lights go out immediately after we leave a room, usually we will turn them off manually (via Remote of HS Switch Scene). We also have no desire for the lights to go off on us if we are in the room but not moving sufficiently to trigger motion. The 15 minute timeout works great, still cleaning up for us if we forget to turn the lights Off but not leaving us in the dark when we are not sufficiently active.

      Click image for larger version  Name:	capture1.png Views:	0 Size:	87.1 KB ID:	1347066

      Then you can use these Virtual Devices in your Events. You could add Conditions looking at the lights in the first Event to prevent the lights from going to 50% unless they are already On, or you could also look at room occupancy. The Virtual Devices give you so much more flexibility and predictability.

      Click image for larger version  Name:	capture2.png Views:	0 Size:	85.6 KB ID:	1347067
      Click image for larger version  Name:	capture3.png Views:	0 Size:	39.5 KB ID:	1347068
      Randy Prade
      Aurora, CO
      Prades.net

      PHLocation - Pushover - EasyTrigger - UltraECM3 - Ultra1Wire3 - Arduino

      Comment


        #4
        Wow! I am having a hard time understanding using virtual devices instead of just using the actual triggers that you have set in events to set the virtual devices?

        Comment


          #5
          Also, do Events not run on a True False reasoning? Like for example, if I have a light go on between sunrise and 11:00pm, would it not turn the light off after 11:00pm because the Event isn't true anymore? Coming from Hubitat where they use Rule Machine. This is how it works. So in this instance, if the rule isn't True, then the light shouldn't be on and it will turn it off.

          Comment


            #6
            Originally posted by pcgirl65 View Post
            Also, do Events not run on a True False reasoning? Like for example, if I have a light go on between sunrise and 11:00pm, would it not turn the light off after 11:00pm because the Event isn't true anymore? Coming from Hubitat where they use Rule Machine. This is how it works. So in this instance, if the rule isn't True, then the light shouldn't be on and it will turn it off.
            No. There is True or False reasoning, but when an Event is not TRUE, it simply does not run. If you have an Event to turn the light On at Sunrise, you would need another Event to turn it Off at 11:00 PM. There are any number of ways to get there, but you still need one Event with an On Action and another with the Off Action.

            Randy Prade
            Aurora, CO
            Prades.net

            PHLocation - Pushover - EasyTrigger - UltraECM3 - Ultra1Wire3 - Arduino

            Comment


              #7
              Originally posted by pcgirl65 View Post
              Wow! I am having a hard time understanding using virtual devices instead of just using the actual triggers that you have set in events to set the virtual devices?
              I understand that it might be difficult to wrap your mind around the logic, but once you understand it, things become a lot easier. While you can certainly use the wattage of your TV as a Trigger or Condition, the Occupancy of a room becomes a little more problematic. Personally I find it easier to have a Status Virtual Device for our TVs and appliances and use it various Events as needed. The Occupancy Virtual Device lets you set up rules for what determines Occupancy. While a Motion sensor may be at No Motion for a period of time, the room may still be occupied. Using a Virtual Device gives you the logic in an Event such as your TV lighting to determine whether someone is in the room or not, where a Motion sensor has essentially 3 states
              :
              1. Motion detected
              2. Motion ended, but not long enough ago to deem the room vacant
              3. Motion ended long enough ago to determine the room is vacant
              That 2nd state is something that is difficult to account for in an Event, but much easier with a Virtual Device.
              Randy Prade
              Aurora, CO
              Prades.net

              PHLocation - Pushover - EasyTrigger - UltraECM3 - Ultra1Wire3 - Arduino

              Comment


                #8
                So this seemed to be working well until last night. For some reason the lights were on at 2:20 am. It looks like they didn't go off after there was motion detected at around 9:17pm. The TV was off all night and nobody was up after this time. Doesn't seem to be any indication of the motion being detected as off in the logs.

                Comment


                  #9
                  Can you post screenshots of your Events?
                  Randy Prade
                  Aurora, CO
                  Prades.net

                  PHLocation - Pushover - EasyTrigger - UltraECM3 - Ultra1Wire3 - Arduino

                  Comment


                    #10
                    Here you go.....

                    Click image for larger version

Name:	screencapture-192-168-1-15-8000-Events-2019-12-23-14_18_11.png
Views:	97
Size:	135.8 KB
ID:	1349231

                    Comment


                      #11
                      Which of the last 3 events ran at 2:20AM? The first one turns the lights Off, the next two set the lights to On and the last one sets them to about 1/2.
                      Randy Prade
                      Aurora, CO
                      Prades.net

                      PHLocation - Pushover - EasyTrigger - UltraECM3 - Ultra1Wire3 - Arduino

                      Comment


                        #12
                        Well that is the thing. None of them ran at 2:20am. The lights were on all night. They didn't turn off until my hubby came down at 2:20am and turned them off using Alexa. Nobody was watching TV that day so it was just lights on with motion and off when no motion.

                        Comment


                          #13
                          I misunderstood. Then the first Event should have turned them Off. If both lights were on (not at some dim level) and if the TV was consuming less than 10 watts, the event should have run and turned them off. There are several things that could cause that event to not run. 1) if either light was not On or 2) the wattage device is no longer updating when the TV is Off. I suspect the latter. Most energy devices will continually update and would trigger that event, but yours may not change at all when the TV is off. Later this morning, when I am at my computer I will create a better event that can account for that as well.

                          You can identify if that is the problem by looking at the value and time stamp on the TV wattage device. If it stops being updated or if the value remains constant, it will not trigger the Event.
                          Randy Prade
                          Aurora, CO
                          Prades.net

                          PHLocation - Pushover - EasyTrigger - UltraECM3 - Ultra1Wire3 - Arduino

                          Comment


                            #14
                            It looks like the wattage is updating a lot. Seems to update about every 2 minutes and it is always changing slightly. See in the logs.

                            Click image for larger version

Name:	screencapture-192-168-1-15-8000-EventLog-2019-12-24-08_39_59.png
Views:	85
Size:	296.3 KB
ID:	1349408

                            I actually went in yesterday and changed some of the parameters so that it wouldn't update so much. Don't know if the constant updating puts a strain on the system.

                            Comment


                              #15
                              OK, that rules out the Trigger. It is behaving as I expect it to and will be a reliable and repeated trigger. Is there a possibility that one of the two lights was not On? The Event is structured such that both must be On. If either is less than On (Off or dimmed) the Event won’t run. We can change the structure of the Event to accommodate for that. Do you have the Easy Trigger plug-in-in?

                              As far as a strain on the system, IMO every 120 seconds is ideal. It is frequent enough to be useful, but not so frequent as to significantly impact the Z-Wave network.
                              Randy Prade
                              Aurora, CO
                              Prades.net

                              PHLocation - Pushover - EasyTrigger - UltraECM3 - Ultra1Wire3 - Arduino

                              Comment

                              Working...
                              X