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.

Different Way to do the Same Thing - Program Help

Featured Replies

Posted

I currently have the following two programs.  All variables are integer variables.  And for what I need it has to be "Status 'Thermostat' is On" and can not be "Control 'Thermostat' is Switched On".

 

CoolDiscrepancy

If
        Status  'Thermostats' is On
    And $Temperature <= $Outside

Then
        $Discrepancy += 1

Else
   - No Actions - (To add one, press 'Action')
CoolCount

If
        Status  'Thermostat' is On

Then
        $CoolOn += 1

Else
   - No Actions - (To add one, press 'Action')

 

Another way I thought of doing this is the following

CoolCount

If
        Status  'Thermostat' is On

Then
        $CoolOn += 1
        Run Program 'CoolDiscrepancy' (If)

Else
   - No Actions - (To add one, press 'Action')
CoolDiscrepency

If
        $Temperature <= $Outside

Then
        $Discrepancy += 1

Else
   - No Actions - (To add one, press 'Action')
Is there a benefit in having the ISY only having to wait for the change of status of a device for one program instead of two?  Does it make much difference in which way I implement this?  Is there a better way to do it, maybe with just one program? 

 

The short answer is "yes." The long answer is ask 10 programmers to .... B)

I don't see a way to do this in a single program, but this assumes I have accurately recognized WHAT you are trying to do from your programs.  If your current programs do what you want, the benefits of alternative methods will be mostly in the mind.  I doubt that there will be a perceptible functional benefit.

 

I am curious...what do you want those variables to become if either of those conditions are false?

Edited by oberkc

  • Author

I am curious...what do you want those variables to become if either of those conditions are false?

 

I don't want anything to happen it they are false.

Thanks for the input.  My biggest question/concern was wondering if it made a difference that two programs were checking status instead of one (i.e. processing power of the ISY)  If it were only these two programs, no big deal but as I approach 300 programs or so having more and more programs checking status may put an undue load on the ISY processor and simplifying some programming may be better.

How many programs do you think might be running simultaneously? 

 

Your second program might be a better solution if this were truly a problem, but I doubt that you will notice any difference.I have never perceived this to be a problem.

I agree with oberkc. Lengthy and processor intensive programs running concurrently are more of a concern than the number of programs that are sitting idly by awaiting execution.

I don't believe that a program containing a "status" uses any more processor sitting idle than any other program.

 

I suppose if the "status" object (ie your thermostat) were constantly changing, then the program would be constantly getting triggered.  But I doubt the status of your thermostat changes very often, right.  It isn't like it is going on/off/on/off/on/off 

 

Here you have 3 programs that get triggered when the status changes from on to off or vice versa.  3 programs getting triggered simultaneous is no big deal.

Edited by apostolakisl

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.