Sjakie 40 Share Posted July 30, 2019 Sorry Jan, rule("phoneID=447") error>>call global nil value 447 and 470 are listed in IOS Fibaro both have error Please advice. My compliments about the version 3.0 It showed a lot of errors I never have seen before still surprised it was still working. Quote Link to post Share on other sites
jgab 901 Author Share Posted July 30, 2019 1 hour ago, Sjakie said: Hello Jan, Please can you explain?? This rule gave error index field I was checking the rule the debug window refreshed(full) and error gone, without edit anything. Is it your magic hand? The scene auto-updates when you restart if there is a new version. Maybe that’s what happened? Quote Link to post Share on other sites
jompa68 121 Share Posted July 30, 2019 1 hour ago, jgab said: for -> trueFor Great, that works. What about this? rule("for(00:08,#VirtualSensor{deviceID=pirSensor.wc,value='$value'} & value=='0') => log('Fläkten av i WC');Wc.Fan:off").start() rule("for(00:05,#VirtualSensor{deviceID=pirSensor.hallNere,value='$value'} & value=='0') => Hall.Taklampa:off") Quote Link to post Share on other sites
jgab 901 Author Share Posted July 30, 2019 16 minutes ago, jompa68 said: Great, that works. What about this? rule("for(00:08,#VirtualSensor{deviceID=pirSensor.wc,value='$value'} & value=='0') => log('Fläkten av i WC');Wc.Fan:off").start() rule("for(00:05,#VirtualSensor{deviceID=pirSensor.hallNere,value='$value'} & value=='0') => Hall.Taklampa:off") Sorry, seems to have accidently removed support for #event triggers inside nested expressions (the trueFor in this case) I'll fix it tomorrow morning. Quote Link to post Share on other sites
jgab 901 Author Share Posted July 31, 2019 7 hours ago, jompa68 said: Great, that works. What about this? rule("for(00:08,#VirtualSensor{deviceID=pirSensor.wc,value='$value'} & value=='0') => log('Fläkten av i WC');Wc.Fan:off").start() rule("for(00:05,#VirtualSensor{deviceID=pirSensor.hallNere,value='$value'} & value=='0') => Hall.Taklampa:off") I fixed #event triggers in nested expressions so it behaves as the old version. (v3.0 B8) rule("trueFor(00:08,#VirtualSensor{deviceID=pirSensor.wc,value='$value'} & value=='0') => log('Fläkten av i WC');Wc.Fan:off").start() the .start() is unnecessary as the condition will always be false as there is no #VirtualSensor event available that have triggered the rule. Quote Link to post Share on other sites
jompa68 121 Share Posted July 31, 2019 Looks like "osDate" have been adjusted, this is not working anymore and osdate does not fit in BankDays={} for k,v in pairs(_BankDays) do BankDays[osDate('%x',v)]=k -- remap table from <holiday>=<epoch> to <month/day/year>=<holiday> end Quote Link to post Share on other sites
jgab 901 Author Share Posted July 31, 2019 (edited) 2 minutes ago, jompa68 said: Looks like "osDate" have been adjusted, this is not working anymore and osdate does not fit in BankDays={} for k,v in pairs(_BankDays) do BankDays[osDate('%x',v)]=k -- remap table from <holiday>=<epoch> to <month/day/year>=<holiday> end osDate has gone and you just use os.date (on ZBS I patch os.date and os.time to work with simulated time) (In ER rules you can use osdate()) Edited July 31, 2019 by jgab Quote Link to post Share on other sites
jompa68 121 Share Posted July 31, 2019 and this? rule([[812:access.status=='Unlock' || $UHASPresentState=='Hemma' => lampSim:off]]) [31mWed/Jul/31,08:27:14:[21:1] Error in '812:access.status=='Unlock' || $UHASPresentState=='Hemma' => lampSim:off': EventRunnerSub3.lua:1736: Parser error char 59 ('=>') in expression '812:access.status=='Unlock' || $UHASPresentState=='Hemma' => lampSim:off' (EventRunnerSub3.lua:1488: attempt to index a nil value)[0m [31mWed/Jul/31,08:27:14:[21:1] Quote Link to post Share on other sites
jgab 901 Author Share Posted July 31, 2019 (edited) 5 minutes ago, jompa68 said: and this? rule([[812:access.status=='Unlock' || $UHASPresentState=='Hemma' => lampSim:off]]) [31mWed/Jul/31,08:27:14:[21:1] Error in '812:access.status=='Unlock' || $UHASPresentState=='Hemma' => lampSim:off': EventRunnerSub3.lua:1736: Parser error char 59 ('=>') in expression '812:access.status=='Unlock' || $UHASPresentState=='Hemma' => lampSim:off' (EventRunnerSub3.lua:1488: attempt to index a nil value)[0m [31mWed/Jul/31,08:27:14:[21:1] OR is single '|' rule([[812:access.status=='Unlock' | $UHASPresentState=='Hemma' => lampSim:off]]) The old parser was a bit more "forgiving"... for "test1 || test2" it generated "test1 OR false OR test2"... Edited July 31, 2019 by jgab Quote Link to post Share on other sites
jompa68 121 Share Posted July 31, 2019 Ah, ofcourse. so now all 138 rules have status "OK" and seems to be running. Quote Link to post Share on other sites
domin12 8 Share Posted July 31, 2019 Hey, Recently I do not have time to update the ER, but I see that the time has come and I started to do it today, unfortunately I encountered a problem with this: [DEBUG] 08:33:36: 2019-07-31 08: 33: 36.335398 [fatal] Unknown exception: /opt/fibaro/scenes/392.lua:2986: attempt to call global 'eventConsumer' (zero value) i'll be appreciated with any help, what i've missed:)? Quote Link to post Share on other sites
jgab 901 Author Share Posted July 31, 2019 Just now, jompa68 said: Ah, ofcourse. so now all 138 rules have status "OK" and seems to be running. Great! @Sjakie, you and @FrankT have helped me kill a lot of bugs the last 24 hours. Thanks! There are of course more bugs to be uncovered but I feel the code is improving. Quote Link to post Share on other sites
jgab 901 Author Share Posted July 31, 2019 4 minutes ago, domin12 said: Hey, Recently I do not have time to update the ER, but I see that the time has come and I started to do it today, unfortunately I encountered a problem with this: [DEBUG] 08:33:36: 2019-07-31 08: 33: 36.335398 [fatal] Unknown exception: /opt/fibaro/scenes/392.lua:2986: attempt to call global 'eventConsumer' (zero value) i'll be appreciated with any help, what i've missed:)? My bad, made a quick fix this morning that made eventConsumer disappear - I pushed a new version B9, or just remove the 'local' infront of 'function eventConsumer()' in the upper part of the scene where it's declared. Quote Link to post Share on other sites
domin12 8 Share Posted July 31, 2019 6 minut temu, jgab napisał: My bad, made a quick fix this morning that made eventConsumer disappear - I pushed a new version B9, or just remove the 'local' infront of 'function eventConsumer()' in the upper part of the scene where it's declared. 1 pass , another to resolve ? : [DEBUG] 08:51:22: 2019-07-31 08:51:22.671862 [ fatal] Unknown exception: /opt/fibaro/FibaroSceneAPI.lua:146: Assertion failed: Expected string Quote Link to post Share on other sites
jgab 901 Author Share Posted July 31, 2019 14 minutes ago, domin12 said: 1 pass , another to resolve ? : [DEBUG] 08:51:22: 2019-07-31 08:51:22.671862 [ fatal] Unknown exception: /opt/fibaro/FibaroSceneAPI.lua:146: Assertion failed: Expected string Ugh, I should not push changes without testing on the HC2. I pushed a new version v3.0 B10. local l = _getGlobal(nil,mb) if l and l ~= "" and l:sub(1,3) ~= '<@>' then -- Something in the mailbox _setGlobal(nil,mb,"") -- clear mailbox If you want to patch your existing code it's inside eventConsumer. The calls to _getGlobal and _setGlobal should have a nil as first argument. Quote Link to post Share on other sites
jgab 901 Author Share Posted July 31, 2019 3 minutes ago, jompa68 said: Update .version also Done.... now! Quote Link to post Share on other sites
domin12 8 Share Posted July 31, 2019 (edited) Thats resolve the problem, and getting new one , sorry guys , but to many new post to find solution quickly, what is change , this rule previously working fine : [DEBUG] 09:17:25: Error in '#location{user='[email protected]',place='away'} => $placeDominik = '%s',$pozDominik': /opt/fibaro/scenes/392.lua:1720: Parser error char 77 (',') in expression '#location{user='[email protected]',place='away'} => $placeDominik = '%s',$pozDominik' (/opt/fibaro/scenes/392.lua:1472: attempt to index field '?' (a nil value)) Edited July 31, 2019 by domin12 Quote Link to post Share on other sites
jompa68 121 Share Posted July 31, 2019 (edited) sorry, you have missed to update evenrunner3.lua with new version. Patching is looping @jgab Edited July 31, 2019 by jompa68 Quote Link to post Share on other sites
jgab 901 Author Share Posted July 31, 2019 10 minutes ago, jompa68 said: sorry, you have missed to update evenrunner3.lua with new version. Patching is looping @jgab Yes, didn't check it in. Done now. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.