Announcement

Collapse
No announcement yet.

Need logic Help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Need logic Help

    Ok, I have a Motion detector that controlls my office stuff...including my WinAmp music...

    It works FINE with all my lights...but if I errantly send a PLAY to WinAmp and it is already playing, it restarts the song which is anoying...

    I have a "flag" that I set when WinAmp is playing that SHOULD catch that, but I am having a logic issue....

    I have a "Motion" script that turns on lights and WinAmp IF WinAmpFlag is currently Off (it then Sets WinAmpFlag ON) This script also clears any timed event set for shutdown...

    I have a ""NoMotion" script that starts a timer for 10 Min and then shuts stuff down and resets WinAmpFlag...any motion in that time period SHOULD reset everything

    I need something more, either another flag or another script to work things smoothly... but I am not sure what...

    Do I need to set a Seperate script for the music, that only trips when it is not playing, but doesn't set the flag... I just can't see the logic today (not enough/too much coffee)

    #2
    I have something similar that I use with iTunes: if no motion for 5 minutes - stop, if motion - start playing. This seems to work fine without a lot of additional logic. Usually the motion sensor triggers a least once every 5 minutes when I am working at the computer. I used winamp years ago and I seem to remember having to use pause and resume rather than start and stop. Sorry, but I can't offer much more help.

    Steve Q
    HomeSeer Version: HS3 Pro Edition 3.0.0.368, Operating System: Microsoft Windows 10 - Home, Number of Devices: 373, Number of Events: 666, Enabled Plug-Ins
    2.0.83.0: BLRF, 2.0.10.0: BLUSBUIRT, 3.0.0.75: HSTouch Server, 3.0.0.58: mcsXap, 3.0.0.11: NetCAM, 3.0.0.36: X10, 3.0.1.25: Z-Wave,Alexa,HomeKit

    Comment


      #3
      What is the trigger for your "No motion" script ?

      Comment


        #4
        The trigger for the "No Motion" is when the IR returns to "Normal" from "Alert" I then wait 10 min before turning the lights off....Any motion durring that time starts everything over...

        Comment


          #5
          Originally posted by rsisson View Post
          The trigger for the "No Motion" is when the IR returns to "Normal" from "Alert" I then wait 10 min before turning the lights off....Any motion durring that time starts everything over...
          What you need to do is start the timer at the same time you turn the light and music on; while also resetting delayed off actions each time motion is picked up.

          ie, upon motion detected do:

          Clear all delayed off actions
          turn lights ON (optional : only if lights are off)
          Start music only if music is playing flag is OFF
          Set music is playing flag ON
          Set delayed off actions

          Your delayed (10 min.) off actions :

          turn lights OFF
          turn music OFF
          set music is playing flag OFF

          Comment

          Working...
          X