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.

best way to do this? outside event code

Featured Replies

Posted

on the quest for ir nirvana, I'm working on a couple of programs that will watch for certain ir events that get set via the rest interface though the lirc program running on the Pi.

 

If I hit the pause button 3 times in 5 seconds turn on a light

 

if I hit play button 3 times in 5 seconds set a scene Movie on

 

if I hit tivo tivo, make sure the tv is on (discrete on command), turn on the stereo, wait a few seconds and change the input to tivo

 

Currently I think I need 9 total programs just to monitor this stuff and react. Example of pause programs

 

Program 1 looks for a state variable to be greater than 0, this being set via the rest interface from the irexec program on the pi

 

If
       $sTivo_play_counter_ir > 0

Then
       $sTivo_play_ir += 1
       $sTivo_play_counter_ir  = 0
       $sTivo_any_ir  = 1

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

each time the play button is pressed the $sTivo_play_ir gets incremented, which
starts its 5 second countdown.  This watches for the control variable to increase
which means play was hit.

We also tell the system the basement is occupied

 

the wait program that resets the $sTivo_play_ir to 0 within a few seconds of the last hit of the button

 

If
       $sTivo_play_ir > 0

Then
       Wait  6 seconds
       $sTivo_play_ir  = 0

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

When the Tivo Play button is pressed, start timer to reset it to 0 within 6 seconds.

 

and finally the program that does the work

 

If
       $sTivo_play_ir is 3

Then
       Set Scene 'Movie_Basement' On
       $sTivo_play_ir  = 0

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

if tivo play is hit 3 times in 5 seconds, turn off some lights

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.