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.

How to return a light to original status in program

Featured Replies

Posted

I created a program that would notify me that the garage door has been opened by flashing the hall lights on/off once time. The problem is, if the hall light is already on it remains off because the programs final command is set the light to fast off. What do I need to include in the program to have the light return to its original state, even if the light was on 100% or dimmed?

 

I use the following code:

 

If - garage sensor is off

Then - set hall switch to fast on

set hall switch to fast off

Else - (blank)

 

Thanks

This would take a variable and a series of programs to accomplish for just On and Off. To capture the Dim state of the light would currently take MANY programs. UDI is working on the next generation firmware that WILL allow us to capture the current dim state and reset it later. That ability is due out early this year I believe. Once we have that capability, it should be a simple change to the programs below to include the dim level. For capturing the On/Off state and resetting, here is the flow:

 

Define an integer Variable: 1.HallLightsOn

 

If Control Garage Sensor is switched Off

Then 
  Run Program Flash1 (If Path)

 

 

Program: Flash1 (Disabled)

If Status Hall Switch is On

Then
  i.HallLightsOn = 1
  Run Program Flash2 (If Path)

Else
  i.HallLighsOn = 0
  Run Program Flash2 (If Path)

 

Program: Flash2

If i.HallLightsOn=1

Then
  Set HallLights FastOff
  Wait 1
  Set HallLights FastOn

Else
  Set HallLights FastOn
  Wait 1
  Set HallLights FastOff

 

Don't forget to set Flash1 as DISABLED or you could end up with a continuously flashing hallway.

Hope this helps.

 

-Xathros

This will work, but you can also remove the If test from the flash2 program and just have flash1 run the then path or else path based on the check that is already occurring.

Good point.

 

-Xathros

I would do something similar but slightly different.

 

If

status hall is not off

and

control garage sensor is switched off

Then

set hall light off

wait 1 second

set hall light on

Else

- -

 

If

status

status hall is off

and control garage sensor is switched off

Then

set hall light on

wait 1 second

set hall light off

Else

- --

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.