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.

(IL)LOGIC?

Featured Replies

Posted

Eisy v5.8.0

I have a logic problem!  A program sets a state variable to 0 or 1 depending on sunset and luminance.  A second program turns lights on or off, depending on the value of that variable.  It works very well on gloomy days…until 32 minutes before sunset, which was at 5:27 p.m.

At 4:44 p.m. it correctly emailed me that “lux level dropped to 13 lux. Eisy turned on selected lights.”  And then at 4:55 p.m. (35-3=32 minutes before sunset) it illogically emailed me that “lux level increased to 13 lux. Eisy turned off selected lights.”  Lux level did not increase, and at 13 lux, Eisy should have turned lights on, not off.

This happens frequently on gloomy (but not on bright) days.  Obviously, I’m missing something here.  Can someone please correct my logic?

Den Low Lux 15 Variable - [ID 000A][Parent 001D]
If
        From     8:05:00AM
        To      Sunset  - 35 minutes (same day)
    And 'Den Temp and Lux' Luminance <= 15 lux
Then
        // Wait for both conditions to test
        Wait  3 minutes 
        $Den_Low_Lux  = 1
Else
        // Wait for both conditions to test
        Wait  3 minutes 
        $Den_Low_Lux  = 0
 

Den Low Lux 15 Send - [ID 0019][Parent 001D]
If
        $Den_Low_Lux is 1
Then
        Set 'LR1' On
        Set 'LR2' On
        Set 'BR' On
        Set 'Bar' On
        Send Notification to 'Notification List' content 'Den Low Lux Email'
        Resource 'Den Low Lux Message'
        Wait  15 minutes 
        // …to prevent rapid switching
Else
        Set 'LR1' Off
        Set 'LR2' Off
        Set 'BR' Off
        Set 'Bar' Off
        Send Notification to 'Notification List' content 'Den Low Lux Ended Email'
        Resource 'Den Low Lux Ended Message'
        Wait  15 minutes 
        // …to prevent rapid switching

 

Edited by GHenry
formatting

Solved by dbwarner5

Go to solution

I fixed this problem by splitting the first program into 2. One program detects dark as <= 15 lux while the second program detects light as > 25 lux. (And removing any Else clauses)

For me, this prevented the little cloud rolling by near sunset from causing the it's-dark....wait no it's light flip-flopping.

Edited by gviliunas

  • Solution

I think your programs are running correctly, just the logic is wrong, @gviliunas points out the easist way to fix. 

What is happening is that at sunset -35 minutes, the first program goes false, running the ELSE. So 3 minutes go by and then the lux variable changes to 0. 

This triggers the ELSE in the second program which turns off the lights, regardless of what the LUX value actually is, because the variable turned to 0 in the first program. 

It seems like you expect the lux value to overrule the time condition, which wont happen. If either are false, the first program will turn false due to the AND. 

After you think thru this a bit, feel free to post your changes and others can comment if you are still having problems accomplishing what you want.

 

 

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.