more G-Labs products

Author Topic: Multiple Wizard Trigger Statements not working, What am I doing wrong?  (Read 911 times)

January 09, 2016, 04:51:37 PM
Read 911 times

mrrrl2

  • *
  • Information
  • Newbie
  • Posts: 6
Trying to turn on lights when the garage door opens and it's between Sunset and Sunrise. I have a tilt sensor on the garage door and it works great by itself. But trying to add time checking I get no where. I am on r511.

Sensor (Works by itself)

HomeAutomation.ZWave/11     Garage Door    Status.Level     GreaterThan     0

Adding

HomeAutomation.HomeGenie/Scheduler   Scheduler.Time   Equals   @FromSunetToSunrise

Also tried

HomeAutomation.HomeGenie/Scheduler    Scheduler.CronEvent  GreaterThan    @Sunset

With both

when condition evaluation switches to "true"

and

when condition evaluation returns "true"

and many different combinations.

I understand that these are logical AND statements, meaning both conditions must be true for the whole to return a true.

Example

Logical AND (&&)

The following code shows examples of the && (logical AND) operator.

a1 = true  && true      // t && t returns true
a2 = true  && false     // t && f returns false
a3 = false && true      // f && t returns false
a4 = false && (3 == 4)  // f && f returns false
a5 = "Cat" && "Dog"     // t && t returns "Dog"
a6 = false && "Cat"     // f && t returns false
a7 = "Cat" && false     // t && f returns false

Thanks

January 12, 2016, 12:54:15 AM
Reply #1

MichelvB

  • *
  • Information
  • Newbie
  • Posts: 5
Hi mrrrl2,

I am at a level "AHP" programming. So at the moment I can only do some Wizard programming. I will tell you how I did it. I have X10 and I want the lights in te garden go on when there is motion in the dark. I want to be able to override that when i go in the garden when it is dark and I don't want te lights go off automaticly.

I use SolarAltitude, so you have to setup that first to the place you live.

First I use a dummy light (i know it must be easyer to do, but like this I understand it). The dummy light is "A3" and I named it daylight.
Setup the lamp A3 with Scheduled On/Off
 Turn on: @SolarAltitude.morning.Sunrise.start
 Turn off: @SolarAltitude.Evening.Sunset.start
So A3 is on when it is daylight and is off when it is dark. You can also use a time (cron) instead of sunrise/sunset
I use A3 to override, I will explain later.

My motion sensor is "O7"

The trigger code for light on is:when condition returns "true"
#0001 HomeAutomation.X10/O7  Movement Garden  Status.Level  Equals  1
#0002 HomeAutomation.X10/A3  Daylight  Status.Level  Equals  0
So if there is movement and it is dark the lights wil go on.

Overriding is easy. Just do A3 On and the motion sensor will not do anything anymore.

I hope this helps.


January 12, 2016, 01:13:08 AM
Reply #2

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Hi mrrrl2,

the condition in the picture is correct but you're using the wrong property name which should be

Scheduler.TimeEvent
or
Scheduler.CronEvent (alias of the previous)

Scheduler.Time is to check the time (e.g. 14:30) not an event.

Cheers,
g.

January 12, 2016, 01:54:59 AM
Reply #3

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
I just made a test and it turns out there's a bug!
Event name resolution will not work if the event is a composite event (using parentesys, and/or operators).
This is the case of @FromSunriseToSunset and @FromSunsetToSunrise.
I now fixed the bug, so it will be available with next update.
If you want to make it work now, you can use the expression instead of the event name.
For example @FromSunsetToSunrise is something like:
(* 19-23 * * *):(30-59 18 * * *):(* 0-5 * * *):(0-30 6 * * *)
You can copy from the Scheduler page the entry matching your timezone.
The only issue with this temporary work-around is that the time range is fixed and won't follow the sunrise/sunset change with time.