Announcement

Collapse
No announcement yet.

UDC problem

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

  • UDC problem

    I can't get this to trigger...any suggestions?

    dim ntime as date = TimeValue(DateTime.Now)
    if (ntime >= TimeValue("10:30 pm") AndAlso ntime <= TimeValue("8:30 am") AndAlso hs.isoffbyname ("Virtual DisableNightLights")) then
    blradar.PluginFunction("ControlDevice", new Object(){"Den Fireplace Spot", "dim", 70})
    blradar.PluginFunction("NewDelayedEventForNoEcho",New Object(){"BLRadar Den Sensor","Den Fireplace Spotff",5,""})
    end if

  • #2
    What errors do you get?
    Cheers,
    Bob
    Web site | Help Desk | Feature Requests | Message Board

    Comment


    • #3
      I don't get an error message. It just doesn't trigger the action. If I remove the if...then, it works. So there's something that's making the if statement to evaluate to false. I tried also removing the device status and just checking the time and it still didn't work.

      Comment


      • #4
        Can you try this code and see if it makes a difference

        Code:
        dim ntime as date = TimeValue(DateTime.Now)
        if ((ntime >= TimeValue("10:30 pm") AndAlso ntime <= TimeValue("11:59 pm")) OrElse (ntime >= TimeValue("12:00 am") AndAlso ntime <= TimeValue("8:30 am"))) AndAlso hs.isoffbyname ("Virtual DisableNightLights") then
            blradar.PluginFunction("ControlDevice", new Object(){"Den Fireplace Spot", "dim", 70})
            blradar.PluginFunction("NewDelayedEventForNoEcho",New Object(){"BLRadar Den Sensor","Den Fireplace Spotff",5,""})
        end if
        The time has to be between 10:30 PM and 8:30 AM and the device status is OFF
        Cheers,
        Bob
        Web site | Help Desk | Feature Requests | Message Board

        Comment


        • #5
          That solved my problem. Thanks.

          Comment

          Working...
          X