Announcement

Collapse
No announcement yet.

Dimmer default levels

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

    Dimmer default levels

    Randy,

    In a post yesterday in the HS3 scripting forum you noted among other things:

    • Set default levels for Day, Twilight, Night and Deep Night (asleep) when they are turned on
    • Control them with motion, using the above defaults


    I can make some guesses how you are doing this, but would you mind sharing more details? Thanks.

    John

    #2
    I don't know how randy does it but I have virtual devices that hold the set points then call them up via a script,
    Night can be manually triggered or when no motion in the house after say 9pm
    Day time is first motion after 6am
    Or do it on time basis.


    Sent from my iPhone using Tapatalk

    Comment


      #3
      Sure. I posted on this in April here, but I have since added the "asleep" level and the scenes with the new switches. There are some additional details in that post.

      For this post I will use one of the bathrooms as an example, but we use this same system on quite a few dimmers.

      First we built some schedules using Spud's Easy trigger. We use that scheduling because they are easily configurable, can be loaded by an event and can be tied to Sunrise/Sunset. It is also easy to look at them graphically to see if they are correct. We have three basic schedules
      • Daytime - 30 minutes after sunrise until 30 minutes after sunset
      • Twilight - 30 minutes before sunrise/sunset until 30 minutes after sunrise/sunset
      • Night - 30 minutes after sunset until 30 minutes before sunrise
      We also have a "House asleep" virtual device triggered by schedule when we are not at home or by one of several methods we have of telling the house to go to sleep. we usually use one of the two MiniMotes by the bed. It is really nice to stumble into the bathroom in the middle of the night and be greeted by a light ramping up to a low level.

      We have a "Dimmer Default" virtual device for each light that uses this structure. I create a default level event that calls the other 4 actual defaults, for ease of event construction and editing. I call the master event from any method where I want to set the default level. Here is the master event:





      Then there are four level setting events:

      Day




      Twilight




      Night (awake)




      Night (asleep)




      You can see that each of the level setting events also turn the Dimmer Default virtual device off. This is so we can make local changes after the level is set without the default level overriding our setting.

      Then there is an event to reset the Dimmer Default virtual default device when we turn the lights off




      Since we are using HSWD100+ we also have a couple of "Scenes". A single tap of the top paddle when the light is at the default level (any level between 1-98%) will turn the light On




      A single tap of the top paddle when the light is On will return to the default level




      If we turn the lights on manually it invokes the default level




      If it is turned on by motion the defauld level is used




      The levels we set are dependent on the type of lighting, the room, etc. There are also some rooms that have additional events that will change the level of lighting that is at its defult levels as the day transitions into a new schedule. If we have our track lights in the living room on in the daytime, they will drop a little at twilight and a little more at night. The "House to Sleep" event will turn them off. there are some other rooms that do the same thing. You can also see that motion controls follow a schedule and we have a different schedule for the basement than the upstairs.

      It is a bit of work to set up, but it has high approval from the most important member of our household (not me). The way the events are structured and scheduled makes tweaking them very easy.
      HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

      Comment


        #4
        Randy, assuming instant status of some sort either hybrid or actual is needed for this to work?

        Comment


          #5
          Originally posted by waynehead99 View Post
          Randy, assuming instant status of some sort either hybrid or actual is needed for this to work?
          Yes, the events need to know the status of the device, but it is not critical. The pseudo instant status of Jasco dimmers works fine, because it reports within a very short period. The only time I could see you getting into trouble is that the Dimmer Default virtual device will not reset until the control reports its status as Off. The motion event needs to know the light has been off for 30 seconds as well - this is to keep the lights from turning back on if you turn them off as you are leaving the room. The rest of the events other than the scenes, do not evaluate the status of the device. If you have scenes then you have instant status.
          HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

          Comment


            #6
            Thanks for the detailed explanation Randy. I'm sure this will help many users get new ideas how to accomplish things. You're the King of Event creation! I doubt anyone exercises HS3's many flexible features as much as you do.

            I personally need to get over trying to keep the number of events low and just organize them in different groupings so they are easier to follow, update and copy. I just loaded EasyTrigger a few days ago to get around the inability to check if a counter is less than a given value, and thought the scheduling feature would have good uses. Now you provided me with practical examples.

            Thanks again,
            John

            Comment


              #7
              Dimmer default levels

              I have over 800 events and no issues. The event engine had an overhaul a few months ago to make it truly multi threaded and that made a difference in its efficiency.

              Each event gets evaluated to determine if it needs to fire, but I have never seen an issue. It is pretty robust and solid. Build away! I have slowly transitioned some stuff to scripting just because of my laziness in building events. I can build one event that runs a script to do multiple things based off different conditions, or in some cases I have built scripts that don't require events at all to run (detecting motion around the house and automate "house modes" easier, and inserting data into a SQL database to do graphs)

              Comment


                #8
                Originally posted by rprade View Post
                There are also some rooms that have additional events that will change the level of lighting that is at its defult levels as the day transitions into a new schedule. If we have our track lights in the living room on in the daytime, they will drop a little at twilight and a little more at night.
                Randy, Thank you for posting the detail of how you accomplished automating your lighting, this is exactly what I was wanting to do as well so this is very helpful! I just purchased Spuds Easy Trigger plugin.
                Would you mind sharing how you are able to do the last part where you change the dim level as the day transitions? I'm wondering how you deal with situations where someone turns on a light, then maybe adjusts the dim level, will the events transition to the next default dim level or will they hold at the user set level?
                I'm thinking that there might be a way to use Spuds Easy Trigger to compare two device values to get the delta between the default dim level and what it was increased/decreased to and apply the delta to the transitioned default dim level? That might have to be done in a script?
                HS4 4.2.6.0 &HSTouch Designer 3.0.80
                Plugin's:
                BLBackup, BLOccupied, BLShutdown, EasyTrigger, Ecobee, Nest, AK Bond
                EnvisaLink DSC, PHLocation, Pushover, SONOS, Blue Iris, UltraRachio3,
                weatherXML, Jon00 Alexa Helper, Network Monitor, MyQ, Z-Wave

                Comment


                  #9
                  Originally posted by The Profit View Post
                  Randy, Thank you for posting the detail of how you accomplished automating your lighting, this is exactly what I was wanting to do as well so this is very helpful! I just purchased Spuds Easy Trigger plugin.
                  Would you mind sharing how you are able to do the last part where you change the dim level as the day transitions? I'm wondering how you deal with situations where someone turns on a light, then maybe adjusts the dim level, will the events transition to the next default dim level or will they hold at the user set level?
                  The events are simple:

                  IF The time enters the InteriorTwiLevel time range
                  AND IF Living Room Track lights are not equal to Off
                  THEN Run Event Living Room Track Lights Default Level

                  I'm thinking that there might be a way to use Spuds Easy Trigger to compare two device values to get the delta between the default dim level and what it was increased/decreased to and apply the delta to the transitioned default dim level? That might have to be done in a script?
                  Yes, that is a good idea. You could use set device to expression with Easy Trigger. Use your lights as the device, then the replacement variable for the lights as part of the expression, like Spud's example here. Something along the lines of the above trigger and condition


                  IF The time enters the InteriorTwiLevel time range
                  AND IF Living Room Track lights are not equal to Off
                  THEN Set Living Room Track lights to ($$DVR:6649:*80/100)

                  The RefID of 6649 would be the Living Room Track lights and the expression would drop the dim level by 20%. You could use whatever percentage works for you dimming the lights by the same percentage, regardless of their level. If they are at 40% they would drop to 32%, if at 80% they would drop to 64%.

                  I think I may build some new events using that logic and experiment with the expression. I'll post some screenshots if I get it working the way I want. It may be a little difficult to get it to track at all levels, since the actual brightness of LED lights does not change in a linear fashion as the dim level changes. I'll bet if I set the expressions based upon the nominal levels we use it will be adequate at higher and lower starting points as well.
                  HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

                  Comment


                    #10
                    Dimmer default levels

                    Originally posted by rprade View Post
                    I think I may build some new events using that logic and experiment with the expression. I'll post some screenshots if I get it working the way I want. It may be a little difficult to get it to track at all levels, since the actual brightness of LED lights does not change in a linear fashion as the dim level changes. I'll bet if I set the expressions based upon the nominal levels we use it will be adequate at higher and lower starting points as well.

                    Hey Randy, It's been a little while since this post so I thought I would ping you to see if you have had a chance to test out the new logic? I'd be interested in looking at your screenshots when you have some time.

                    Also, because you are really good at events, I was wondering if you might be able to help me with one? I have Homeseer installed at work, we have business hours and holidays off, so I've used Easy Trigger to set up Schedules, however the holidays off don't always fall on weekdays and are exceptions to the rule. I've used "Group Conditions" as a way to test the date as a holiday but I'm trying to figure out a way for the group conditions to be future proof or something that I don't have to update every year. Is there a way to test what day a specific date falls on and adjust a date to either to a day before or a day after depending on if it falls on a Sat or a Sunday? Then update and use those dates as conditions?




                    Sent from my iPad using Tapatalk
                    HS4 4.2.6.0 &HSTouch Designer 3.0.80
                    Plugin's:
                    BLBackup, BLOccupied, BLShutdown, EasyTrigger, Ecobee, Nest, AK Bond
                    EnvisaLink DSC, PHLocation, Pushover, SONOS, Blue Iris, UltraRachio3,
                    weatherXML, Jon00 Alexa Helper, Network Monitor, MyQ, Z-Wave

                    Comment


                      #11
                      Originally posted by The Profit View Post
                      I have Homeseer installed at work, we have business hours and holidays off, so I've used Easy Trigger to set up Schedules, however the holidays off don't always fall on weekdays and are exceptions to the rule. I've used "Group Conditions" as a way to test the date as a holiday but I'm trying to figure out a way for the group conditions to be future proof or something that I don't have to update every year. Is there a way to test what day a specific date falls on and adjust a date to either to a day before or a day after depending on if it falls on a Sat or a Sunday? Then update and use those dates as conditions?




                      Sent from my iPad using Tapatalk
                      Sorry, I missed this post when you made it.

                      We use three virtual devices for holidays, one for the actual holiday, a second one for work holidays (including compensation for observed date), and a third for a work holiday tomorrow. The work holiday devices are used for scheduling. The virtual device for "holiday tomorrow" is set the day before so we can adjust the "house to sleep", heating and hot water schedules.

                      Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	61.9 KB
ID:	1187058

                      The Holiday Tomorrow (schedule) device is set by events. The first event moves tomorrow to today (schedule) at midnight, then clears the holiday tomorrow (schedule) device and the holiday today device.

                      Click image for larger version

Name:	Capture1.png
Views:	1
Size:	34.1 KB
ID:	1187053

                      Then 15 seconds later a second event sets holiday tomorrow by running a group of holiday check events. Another set of events sets the Holiday Today device, this device is just to use for announcements, etc. and is set to actual holidays, no matter whether they are observed at work or not. That device has nothing to do with any household management scheduling.

                      Click image for larger version

Name:	Capture2.PNG
Views:	1
Size:	73.0 KB
ID:	1187054

                      We determine which holidays are observed by activating actions using the Then action and disable the ones we don't by using the Never action. Each of the called events determines if tomorrow is going to be an observed work holiday. Here is New Year's for an example:

                      Click image for larger version

Name:	Capture3.PNG
Views:	1
Size:	54.8 KB
ID:	1187055

                      While there are scripts out there that can do this, I prefer the Event structure. Each holiday event has similar logic to move weekend holidays to the correct weekday for observation.

                      We use Easy Trigger to load schedules based on a normal day, a work holiday day or a vacation day. We use three shift based work day schedules, a non-work schedule and a vacation schedule. That schedule is set in a pair of virtual devices, one for the schedule and another to look at when returning to schedule after a holiday.

                      Click image for larger version

Name:	Capture4.PNG
Views:	1
Size:	39.0 KB
ID:	1187057

                      Events look at the value of Today's Schedule to load preconfigured Easy Trigger schedules into the appropriate master schedule. Here is an example of how lighting schedules are loaded:

                      Click image for larger version

Name:	Capture5.PNG
Views:	1
Size:	101.3 KB
ID:	1187056

                      We use similar sorts of Event clusters for heating, hot water, and power management. If any virtual device is changed that might affect scheduling, the events are run again to reevaluate the proper schedule loading. Many of those events are much more granular than lighting, making the events a lot more sophisticated. The heating and hot water setbacks vary among different work schedules and non-work, bathroom heat is set and power management is affected by scheduling. The above should give you a basic idea of how we handle scheduling.
                      HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

                      Comment


                        #12
                        Awesome write up Randy, thanks!!! As a newb, this is a great learning tool.

                        I have a couple of basic questions that would help if you have time. What is the typical trigger for the bathroom lights to turn on (I assume motion)?

                        How is the light typically turned off? By switch or by the DBSRLightsByMotion timer? Do you have another event that once the timer hits a couple minutes, turns the light off?

                        Thanks!

                        Comment


                          #13
                          Dimmer default levels

                          Originally posted by rprade View Post
                          The events are simple:
                          Yes, that is a good idea. You could use set device to expression with Easy Trigger. Use your lights as the device, then the replacement variable for the lights as part of the expression, like Spud's example here. Something along the lines of the above trigger and condition

                          IF The time enters the InteriorTwiLevel time range
                          AND IF Living Room Track lights are not equal to Off
                          THEN Set Living Room Track lights to ($$DVR:6649:*80/100)

                          The RefID of 6649 would be the Living Room Track lights and the expression would drop the dim level by 20%. You could use whatever percentage works for you dimming the lights by the same percentage, regardless of their level. If they are at 40% they would drop to 32%, if at 80% they would drop to 64%.

                          I think I may build some new events using that logic and experiment with the expression. I'll post some screenshots if I get it working the way I want. It may be a little difficult to get it to track at all levels, since the actual brightness of LED lights does not change in a linear fashion as the dim level changes. I'll bet if I set the expressions based upon the nominal levels we use it will be adequate at higher and lower starting points as well.
                          Hello Randy,

                          I have implemented the same logic for the Dimmer Default levels in my system as you have and have started to think about your solution above for when someone adjusts the dim level and then you enter a new default time frame. I agree with your solution with one change and wanted to see what you think about it.
                          The expression only works if you are decreasing the dim level, what if you are in the InteriorNightLevel moving to InteriorTwiLevel? In this case you would be increasing the dim level. Solution maybe to add another condition:

                          If time enters InteriorTwiLevel time range
                          And If the time is before sunset
                          Then Set Device ?? to expression Round($$DVR:###: * 78/100,0) Expression lowering dim level.

                          If time enters InteriorTwiLevel time range
                          And If the time is before sunrise
                          Then Set Device ?? to expression Round($$DVR:###: * 120/100,0) - Expression increasing dim level.
                          Last edited by The Profit; February 16, 2017, 05:26 PM.
                          HS4 4.2.6.0 &HSTouch Designer 3.0.80
                          Plugin's:
                          BLBackup, BLOccupied, BLShutdown, EasyTrigger, Ecobee, Nest, AK Bond
                          EnvisaLink DSC, PHLocation, Pushover, SONOS, Blue Iris, UltraRachio3,
                          weatherXML, Jon00 Alexa Helper, Network Monitor, MyQ, Z-Wave

                          Comment


                            #14
                            I wrote a script that kinda does this, but in my own way and without virtual devices.

                            The docs:
                            Code:
                            ' Define events for a single tap of the switch (use the controller scene). When that's tapped, call a method
                            ' like dimNursery (seen below).
                            ' In that method, you can define various TimeFrame(s). These TimeFrame(s) determine a low and high lighting level
                            ' for certain hours of the day. They should be defined from earliest -> latest. You can use the funcions sunrise & sunset 
                            ' that take integer parameters for offsets that correspond to that time of the day.
                            ' When the switch is off, it'll toggle the light to the low level. When tapped again it'll toggle it to the high level.
                            ' Tapped again it'll go to the lower level. During this time you still have the ability to dim up/down. When in-between levels
                            ' and the light is tapped, the script will toggle the lights based on the current level.
                            ' And you can do it all w/o the need of virtual devices. Yay!
                            Script is available at https://github.com/holmes/homeseer/b...ipts/lights.vb

                            Comment


                              #15
                              Dimmer Default Levels

                              Originally posted by rprade View Post
                              The events are simple:

                              IF The time enters the InteriorTwiLevel time range
                              AND IF Living Room Track lights are not equal to Off
                              THEN Run Event Living Room Track Lights Default Level

                              Yes, that is a good idea. You could use set device to expression with Easy Trigger. Use your lights as the device, then the replacement variable for the lights as part of the expression, like Spud's example here. Something along the lines of the above trigger and condition


                              IF The time enters the InteriorTwiLevel time range
                              AND IF Living Room Track lights are not equal to Off
                              THEN Set Living Room Track lights to ($$DVR:6649:*80/100)

                              The RefID of 6649 would be the Living Room Track lights and the expression would drop the dim level by 20%. You could use whatever percentage works for you dimming the lights by the same percentage, regardless of their level. If they are at 40% they would drop to 32%, if at 80% they would drop to 64%.

                              I think I may build some new events using that logic and experiment with the expression. I'll post some screenshots if I get it working the way I want. It may be a little difficult to get it to track at all levels, since the actual brightness of LED lights does not change in a linear fashion as the dim level changes. I'll bet if I set the expressions based upon the nominal levels we use it will be adequate at higher and lower starting points as well.
                              Hey Randy,
                              I haven't had a lot of time to work on implementing the dimmer default levels until recently, but I was wondering if you wouldn't mind taking a look at the changes I made to the events and let me know what you think.

                              The first thing I did was mirror your events to the letter to make sure it was working the same as yours do, however I had something that I noticed didn't work as I expected. When I turned the light on, it would ramp up to the last level that the switch was set at first before it would run the first event, "DS Bathroom Lights turned ON". That makes sense as it's not "set to" a specific dim level until it reaches a specific dim level. So I changed it to "If the Central Scene had it's value set to Scene 001 Key Pressed". Once I did that, it worked perfectly. I'm wondering...were you having this same issue?

                              The second thing I noticed was that every time of day event (Day, Twilight, Night awake & night asleep) set the Lighting Dimmer Defaults virtual device to off as the last task. That was causing the lights to not adjust as the day progressed, so I changed how the Lighting Dimmer Default virtual device is used. The virtual device stays set to "Enabled" unless someone adjusts the light dim level or if they top tap after the light is set to default and turn it ON (100%). I've attached screenshots below of all events to see if I might have inadvertently changed it in a way that I won't realize all of the benefits your events intended.
                              Thank you for all your help!
                              Attached Files
                              HS4 4.2.6.0 &HSTouch Designer 3.0.80
                              Plugin's:
                              BLBackup, BLOccupied, BLShutdown, EasyTrigger, Ecobee, Nest, AK Bond
                              EnvisaLink DSC, PHLocation, Pushover, SONOS, Blue Iris, UltraRachio3,
                              weatherXML, Jon00 Alexa Helper, Network Monitor, MyQ, Z-Wave

                              Comment

                              Working...
                              X