Help understanding strings in a condition

I know enough about scripting to be dangerous but not very effective. ;D I can’t seem to find what I need in the forums.

I’m getting the hang of PLEG but am having problems constructing the condition statement. Here is the scenario.

I have an alarm panel. I want to read the status variable ie: Ready, Not Ready, Armed…etc and then determine if I’m home. I have a Vswitch to do that with other code. What is the proper way to structure the syntax.

If I am not home (vswitch = 0) AND the alarm state is ‘Ready’ then arm the alarm.

Create an input trigger for the VSwitch: Away NameOfVSwitch, is turned on.

Create an input device property for the alarm status: AlarmStatus NameOfAlarm, Status

Write your condition: ArmAlarm Away and (AlarmStatus eq “Ready”)

Set the action for condition ArmAlarm to arm your alarm.

etc.

Followed you suggestions… no luck… I am using The Honeywell Vista Alarm plugin. PLEG shows me the DetailArmState as a string under devices. It doesn’t seem to read it properly when it evaluates the condition. I am either doing something wrong or there is another problem.

I’ve posted the reports and log result below.

STATUS:

Triggers
Name Description Last Trigger State
TestTrigger Test Trigger is turned on 2013-08-16 10:15:54.136 false

Schedules
Name Type Time Days Last Schedule

Device Properties
Name Device Name Device Variable Last Change Value
AlarmStatus Alarm System DetailedArmMode 0 false
AmIHome Is iPhone home? Status 2013-08-16 10:15:06.954 0

Conditions
Name Expression Last True State
TriggerArm TestTrigger == 1 AND (AlarmStatus eq “Disarmed”) 0 false

Actions

Actions for Condition: TriggerArm
Device Action Arguments
Light High SetTarget newTargetValue=1

Report:

Triggers
Name Description
TestTrigger Test Trigger is turned on

Schedules
Name Type Time Days

Device Properties
Name Device Name Device Variable
AlarmStatus Alarm System DetailedArmMode
AmIHome Is iPhone home? Status

Conditions
Name Expression
TriggerArm TestTrigger == 1 AND (AlarmStatus eq “Disarmed”)

Actions

Actions for Condition: TriggerArm
Device Action Arguments
Light High SetTarget newTargetValue=1

LOG

08/16/13 10:15:54.135 luup_log:180: PLEG:180:TriggerPropertyUpdate:Status <0x32682680>
50 08/16/13 10:15:54.136 luup_log:180: PLEG:180:TriggerPropertyUpdate:Name:TestTrigger State:true Device:181 <0x32682680>
50 08/16/13 10:15:54.136 luup_log:180: PLEG:180:EvalConditions:Multi Trigger:TestTrigger <0x32682680>
50 08/16/13 10:15:54.139 luup_log:180: PLEG:180:EvalConditions:Condition:TriggerArm Trigger:TestTrigger Result:false <0x32682680>
50 08/16/13 10:15:54.140 luup_log:180: PLEG:180:SaveDB:{{name =‘TriggerArm’, state = false, seq = 0},{name =‘TestTrigger’, state = true, seq = 1376662554.1363},{name =‘AlarmStatus’, state = false, seq = 0},{name =‘AmIHome’, state = ‘0’, seq = 1376662506.954},} <0x32682680>

I am using The Honeywell Vista Alarm plugin. PLEG shows me the DetailArmState as a string under devices.
I don't have this alarm or the plugin so I cannot see the actual variables. Are you saying that [b]DetailArmState[/b] on the [i]Advanced[/i] tab contains a string like [i]Ready, Armed[/i] etc?
Device Properties Name Device Name Device Variable Last Change Value AlarmStatus Alarm System DetailedArmMode 0 false
Your device property is [b]DetailedArmMode[/b] not [b]DetailedArmState[/b] as previously mentioned. The value of [b]0[/b] suggests that it is a [b]0/1[/b] variable rather than a named status. If so, you should be able to use it as a trigger rather than a property.