Jump to content
View in the app

A better way to browse. Learn more.

Universal Devices Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Do you think in terms of Events or Things?

Featured Replies

Posted

I have several Things that turn on in relation to sunset.  Porch lights, landscape lights, hall lights, pool lights, etc.  Some of these Things turn off at a certain time, some when we go to bed, some in relation to sunrise.

Should I program in terms of Events:

     Program 1:  at sunset, turn on all the Things

     Program 2:  at bedtime, turn off some Things

     Program 3:  at time x, turn off some Things

     Program 4:  at sunrise, turn off some Things

 

Or should I program in terms of Things:

     Program 1:  from sunset to bedtime, turn on some Things, otherwise turn those Things off.

     Program 2:  from sunset to time x, turn on some Things, otherwise turn those Things off.

     Program 3:  from sunset to sunrise, turn on some Things, otherwise turn those Things off.

 

Both will work, but I wonder which approach is "better".

 

People seem to think in terms of "things" -- and as long as the conditions and actions associated with "things" are relatively simple, the "thing" approach offered by the ISY's programming language works just fine.

If you have non-simple things -- lots of other conditions, or where the "then" or "else" clause has waits embedded in them, etc, then you quickly find that ISY's programming language just makes your head explode.  In those cases, programming in terms of "events" is almost always easier, and almost always results in fewer "surprises" (aka bugs).  At least in my experience -- I suspect this varies based on how one learned logic and coding, and may even vary depending on how individual brains are wired...

As a rule, I think of events, in that the programming model is event programming. However, the exception to this is I think of things first in the divisions I have created for my devices: Outdoor, Mainfloor, Backyard, Master BR, Basement, etc. I tend to group programs in these categories as well (at least logically, if not physically). So I have a set of programs that control outdoor lighting (minus the "backyard"): one that runs at sunset, one that runs at bedtime, one that runs in the morning, etc. But I may have another group of programs for my Master BR that run at bedtime and/or morning - I don't try to combine those with the outdoor lighting programs that run on the same event.

Edited by Goose66

I am not sure that I think either way, and not sure I even understand the difference.  My personal approach is to minimize number and size of programs, in that order.

Best approach is what fits your way of thinking and is easiest to understand after time has passed and you need to go back and look at your programs.

When creating programs, I consider triggers as either events or devices. What happens usually occurs to devices and/or scenes. There are variations, but I don't consider any of them  as things. But how you think is really personal. I don't see how it matters.

  • Author

I purposely avoided the use of the term Device in my question and used Things instead.  I suppose I could used the term Scenes, but it needs to be understood that the Scene that would get turned on at a certain event is not necessarily (and probably isn't ) the same Scene that gets turned off at some other Event.

 

Guest
This topic is now closed to further replies.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.