PLEG not taking fractions

I have a little problem with my PLEG. I am using iphonelocator for my logic. I have set a device property Mdistance1, which gives me the distance of my phone to my house. I am using this in a condition,

Mcomhome (Mdirection == 75) and Mdistance1 < 1

I have tried setting (Mdirection == 75) and Mdistance1 < 0.5 as i would like to have this as below 1 mile, but i get an error message, invalid expression operator, looks as if PLEG cannot handle fractions ? (At least in this case)

Try this …
I will incorporate into my next release.

Lightning quick response… I uploaded it, reloaded Vera…

sorry did not work

Maybe i need brackets ?

Are you sure you restarted Vera ?

I wrote a test case for my parser … I used
A < 0.8
And it worked correctly.

I pressed reload, and refreshed my browser. I will unplu my Vera now, but i never had to do that.

I unplugged my Vera, waited 15 seconds and plugged it back in. Same error

Lighting PLEG
Device ID: 2212013-10-24 22:41:11.488 PLC Version: 5.2
Triggers
Name Description Last Trigger State
HallmotionOn Hall Motion Sensor is tripped 2013-10-24 22:11:37.557 false
Night1 Day or Night indicates Night time. 2013-10-24 18:33:02.128 true
Vacation1 MultiSwitch Switch 8 is turned on 0 false
On3 Front door lights is turned on 2013-10-24 20:07:31.404 false
Patio_door_opened Patio door armed is tripped 0 false
MotionOn2 Front Door Motion Sensor is tripped 2013-10-24 20:21:15.217 false
MotionFDarmed Front Door Motion Sensor armed is tripped 2013-10-24 14:32:47.498 false
Mikehome ()Mike is present 2013-10-24 18:44:28.945 true
PingMike Ping Mike is Tripped 2013-10-24 22:13:18.201 false
Porchdooropen Porch door is tripped 2013-10-24 22:11:37.927 false
PingJust Ping Justine is Tripped 2013-10-24 21:41:48.181 false
Justhome (
)Justine?s iPhone is present 2013-10-24 20:27:42.167 true
Schedules
Name Type Time Days Random On Delay Off After Type Off Time Off Days Random Off Delay State Last Schedule
Dark Weekly +00:05:00t 1,2,3,4,5,6,7 None Weekly -00:20:00r 1,2,3,4,5,6,7 None true 2013-10-24 17:48:02.100
Device Properties
Name Device Name Device Variable Last Change Value
Mdistance1 ()Mike Distance 2013-10-24 21:22:27.779 0.011
Jdistance (
)Justine?s iPhone Distance 2013-10-24 21:37:45.326 0.006
WE11 Weekend 2013-10-21 00:00:00.163 0
Mdirection ()Mike IconCode 2013-10-24 22:39:52.167 50
Jdirection (
)Justine?s iPhone IconCode 2013-10-24 22:40:15.211 50
Conditions
Name Expression Last True State
BothOff Not On3 2013-10-24 20:23:30.978 true
AutoOn1 Night1 and MotionOn2 and BothOff 2013-10-24 20:07:30.770 false
BothAutoOn (On3 and (AutoOn1; On3 < 1:00)) 2013-10-24 20:07:31.437 false
AutoOff1 (MotionOn2; Now > 1:30) or (Not Night1) 2013-10-24 20:23:30.124 true
LastTrip BothAutoOn and MotionOn2 2013-10-24 20:07:31.442 false
AutoOn2 Night1 and HallmotionOn 2013-10-24 22:11:37.569 false
LastTripHall AutoOn2 and HallmotionOn 2013-10-24 22:11:37.578 false
AutoOff2 (AutoOn2 and (LastTripHall; Now > 1:30)) or (Not Night1) 2013-10-24 22:13:45.137 false
GardenOn (((19:00:00;NOW) and WE11==0) or ((17:00:00;NOW) and WE11==1)) and Night1 and NOT Vacation1 2013-10-24 19:00:54.123 true
GardenOff (WE11==0 and (22:25:00;NOW)) or (WE11==1 and (22:55:00;NOW)) 2013-10-24 22:39:45.591 true
Patiodoor Patio_door_opened 0 false
FDmotion MotionFDarmed 2013-10-24 14:32:47.559 false
Mikeaway Mdistance1 > 1 2013-10-24 06:36:07.068 false
Jgoingaway (Jdirection == 25) 2013-10-24 12:01:14.497 false
Mhome Mikehome and PingMike 2013-10-24 22:13:18.236 false
Jhome Justhome and PingJust 2013-10-24 21:41:48.215 false
Mcomhome (Mdirection == 75) and Mdistance1 < 0.8 2013-10-24 18:29:26.076 null
Jcomhome (Jdirection == 75) and Jdistance < 0.8 2013-10-24 14:48:20.304 null
Jmute Jhome; NOW > 180 2013-10-24 21:45:45.181 true
Mmute Mhome; NOW > 180 2013-10-24 22:39:45.604 true
Mcomdark (Mcomhome or Jcomhome) and Dark 2013-10-24 18:29:26.122 null
Porchopen Porchdooropen @ 2 > 1:00 2013-10-24 21:15:07.329 false
Junmute Porchopen and Justhome 2013-10-24 21:15:07.334 false
Munmute Porchopen and Mikehome 2013-10-24 21:15:07.338 false
AutoAway (NOT Mikehome) and (NOT Justhome) 2013-10-24 12:01:14.357 false
AutoAway5m AutoAway and (AutoAway; NOW > 5:00) 2013-10-24 12:06:47.150 false
Mhomelights ((Mcomhome;Mhome < 30:00) or (Jcomhome;Jhome < 30:00)) and Dark 2013-10-24 18:44:57.338 false
AutoHome Mcomhome or Jcomhome 2013-10-24 18:29:26.159 null
Justaway Jdistance > 1 2013-10-24 12:01:14.263 false
Actions
Actions for Condition: AutoOn1
Immediate
Device Action Arguments
Front door lights SetLoadLevelTarget newLoadlevelTarget=100
Actions for Condition: AutoOff1
Immediate
Device Action Arguments
Front door lights SetLoadLevelTarget newLoadlevelTarget=0
Actions for Condition: AutoOn2
Immediate
Device Action Arguments
Blue Lights SetTarget newTargetValue=1
Actions for Condition: AutoOff2
Immediate
Device Action Arguments
Blue Lights SetTarget newTargetValue=0
Actions for Condition: GardenOn
Immediate
Device Action Arguments
Brick lights SetTarget newTargetValue=1
Uplighters SetTarget newTargetValue=1
Water feature lights SetTarget newTargetValue=1
Actions for Condition: GardenOff
Immediate
Device Action Arguments
Uplighters SetTarget newTargetValue=0
Water feature lights SetTarget newTargetValue=0
Brick lights SetTarget newTargetValue=0
Actions for Condition: Patiodoor
Immediate
Device Action Arguments
Lighting PLEG RunScene SceneNameOrNumber=63
Actions for Condition: Mcomhome
Immediate
Device Action Arguments
MultiSwitch 2 SetStatus3 newStatus3=1
Actions for Condition: FDmotion
Immediate
Device Action Arguments
Lighting PLEG RunScene SceneNameOrNumber=88
Actions for Condition: Jmute
Immediate
Device Action Arguments
()Justine?s iPhone SetMute newMuteStatus=1
Actions for Condition: Mmute
Immediate
Device Action Arguments
(
)Mike SetMute newMuteStatus=1
Actions for Condition: Mcomdark
Immediate
Device Action Arguments
Front door lights SetLoadLevelTarget newLoadlevelTarget=100
Delay 01:30
Device Action Arguments
Porch light SetLoadLevelTarget newLoadlevelTarget=100
Actions for Condition: Junmute
Immediate
Device Action Arguments
()Justine?s iPhone SetMute newMuteStatus=0
Delay 02:45
Device Action Arguments
(
)Justine?s iPhone SetMute newMuteStatus=0
Delay 03:00
Device Action Arguments
()Justine?s iPhone ForceRefresh PresentStatus=0
(
)Justine?s iPhone SetMute newMuteStatus=0
Delay 05:45
Device Action Arguments
()Justine?s iPhone SetMute newMuteStatus=0
Delay 06:00
Device Action Arguments
(
)Justine?s iPhone ForceRefresh PresentStatus=0
Delay 09:45
Device Action Arguments
()Justine?s iPhone SetMute newMuteStatus=0
Delay 10:00
Device Action Arguments
(
)Justine?s iPhone ForceRefresh PresentStatus=0
Delay 02:00
Device Action Arguments
()Justine?s iPhone ForceRefresh newDebugMode=0
Delay 10:10
Device Action Arguments
(
)Justine?s iPhone ForceRefresh newDebugMode=0
Delay 06:10
Device Action Arguments
()Justine?s iPhone ForceRefresh newDebugMode=0
Delay 02:10
Device Action Arguments
(
)Justine?s iPhone ForceRefresh newDebugMode=0
Delay 03:20
Device Action Arguments
()Justine?s iPhone ForceRefresh newDebugMode=0
Delay 03:50
Device Action Arguments
(
)Justine?s iPhone ForceRefresh newDebugMode=0
Delay 05:50
Device Action Arguments
()Justine?s iPhone ForceRefresh newDebugMode=0
Delay 05:55
Device Action Arguments
(
)Justine?s iPhone ForceRefresh newDebugMode=0
Delay 06:30
Device Action Arguments
()Justine?s iPhone ForceRefresh newDebugMode=0
Actions for Condition: Munmute
Delay 02:45
Device Action Arguments
(
)Mike SetMute newMuteStatus=0
Delay 03:00
Device Action Arguments
()Mike ForceRefresh PresentStatus=0
Delay 05:45
Device Action Arguments
(
)Mike SetMute newMuteStatus=0
Delay 06:00
Device Action Arguments
()Mike ForceRefresh PresentStatus=0
Delay 09:45
Device Action Arguments
(
)Mike SetMute newMuteStatus=0
Delay 10:00
Device Action Arguments
(*)Mike ForceRefresh PresentStatus=0
Actions for Condition: AutoAway5m
Immediate
Device Action Arguments
Lighting PLEG RunScene SceneNameOrNumber=84
MultiSwitch 2 SetStatus5 newStatus5=1
MultiSwitch 2 SetStatus6 newStatus6=0
Actions for Condition: AutoHome
Immediate
Device Action Arguments
Lighting PLEG RunScene SceneNameOrNumber=85
MultiSwitch 2 SetStatus5 newStatus5=0
MultiSwitch 2 SetStatus6 newStatus6=1
Actions for Condition: Mhomelights
Immediate
Device Action Arguments
Front door lights SetLoadLevelTarget newLoadlevelTarget=0
Porch light SetLoadLevelTarget newLoadlevelTarget=0
Actions for Condition: Mhome
Immediate
Device Action Arguments
MultiSwitch 2 SetStatus8 newStatus8=1
MultiSwitch 2 SetStatus7 newStatus7=0
MultiSwitch 2 SetStatus3 newStatus3=0
Actions for Condition: Jhome
Immediate
Device Action Arguments
MultiSwitch 2 SetStatus2 newStatus2=1
MultiSwitch 2 SetStatus1 newStatus1=0
MultiSwitch 2 SetStatus4 newStatus4=0
Actions for Condition: Jcomhome
Immediate
Device Action Arguments
MultiSwitch 2 SetStatus4 newStatus4=1
Actions for Condition: Justaway
Immediate
Device Action Arguments
MultiSwitch 2 SetStatus2 newStatus2=0
MultiSwitch 2 SetStatus1 newStatus1=1
Actions for Condition: Mikeaway
Immediate
Device Action Arguments
MultiSwitch 2 SetStatus7 newStatus7=1
MultiSwitch 2 SetStatus8 newStatus8=0

This is my status printout. Maybe there is something else causing the error ?

Oooops. Found it. Somehow my download directory had changed, and i uploaded a very similar named file, must have been a previous patch. I am trying again with the proper one now.
Sorry about that

This is so embarrassing. After uploading the right file its working fine.

If you downloaded the L_ProgramLogicCEE.lua from a previous patch … you may have files
out of sync.

You can login to Vera:
cd to /etc/cmh-ludl

Remove any new files from today.
Restart Vera … this should refetch the deleted files that came from the APP store.
Them re-install my patch.

[quote=“RichardTSchaefer, post:8, topic:177503”]If you downloaded the L_ProgramLogicCEE.lua from a previous patch … you may have files
out of sync.

You can login to Vera:
cd to /etc/cmh-ludl

Remove any new files from today.
Restart Vera … this should refetch the deleted files that came from the APP store.
Them re-install my patch.[/quote]

What i had done i had reuploaded the L_ProgramLogicCEE.lua patch in error, thereafter the L_ProgramLogicCCP.lua. This was when i posted i had uploaded the wrong file.
Now i have deleted the L_ProgramLogicCEE.lua, restarted Vera, and had the Lua startup failure. Then i also deleted L_ProgramLogicCCP.lua, and had the error with the fractions. Uploaded the L_ProgramLogicCCP.lua again and L_ProgramLogicCEE.lua and everything starts up without errors. But i am not sure if PLEG is working 100%. I have a glitch which i have posted here:

[url=http://forum.micasaverde.com/index.php/topic,17084.msg133263.html#msg133263]http://forum.micasaverde.com/index.php/topic,17084.msg133263.html#msg133263[/url]

which might be linked ? When i posted that i did not think about it, maybe i should have posted that here. I have other actions not firing 100%, but at the moment i am checking this as it could be my logic rather than PLEG

You should NOT have uploaded L_ProgramLogicCEE.lua … I have no idea how old that patch is or what it is compatible with.

You might try to go through the Plugin Update process … I am not sure if that will fetch any files … since the Version has not changed.

I have gone through the update process, ended up with the fraction error, so i uploaded the file from this thread. Now i have the startup Lua failure, The other file i uploaded (L_ProgramLogicCEE.lua) was the patch for that, from thread :

[url=http://forum.micasaverde.com/index.php/topic,17063.msg131902.html#msg131902]http://forum.micasaverde.com/index.php/topic,17063.msg131902.html#msg131902[/url]

OK, That file is still valid … it was made since my last release.

I have uploaded that again, and have no errors now. Just that one condition (the one mentioned in the other thread, link a few posts above) is giving me trouble. My logic is simple and taken from another thread, and i am sure its ok. So why is it not firing all the time, but sometimes it does ? Doesnt make sense.