Jump to content

Recommended Posts

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.

 

Link to post
Share on other sites
  • Replies 2.7k
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Note. The first ~2000 posts of this thread is mainly about EventRunner3 that is for the HC2. EventRunner3 is not developed further, but bugs are fixed as they are reported. For HC3, the version i

I've been playing with the HC3 a bit  (I don't own a HC3 but a friend has allowed me to remotely login to do testing - I'm very grateful for that). ...and I have made some progress with EventRunn

Here is another "style" of coding when using the EventRunner framework. @julesmartens needed help to code an alarm system. It's a bit complicated because he needs "full" and "ring" protection dur

Posted Images

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?

image.png.acd2cfab94557c6e0f0c14d2d54de677.png

 

The scene auto-updates when you restart if there is a new version. Maybe that’s what happened?

Link to post
Share on other sites
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")

 

Link to post
Share on other sites
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.

Link to post
Share on other sites
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.

 

Link to post
Share on other sites

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

 

Link to post
Share on other sites
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 by jgab
Link to post
Share on other sites

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] 

 

Link to post
Share on other sites
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 by jgab
Link to post
Share on other sites

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)

image.thumb.png.ec18738d63b6848f17ad5b4cd53bee2b.png

 

i'll be appreciated with any help, what i've missed:)?

Link to post
Share on other sites
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. 

 

Link to post
Share on other sites
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)

image.thumb.png.ec18738d63b6848f17ad5b4cd53bee2b.png

 

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.

Link to post
Share on other sites
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

 

Link to post
Share on other sites
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.

Link to post
Share on other sites
3 minutes ago, jompa68 said:

Update .version also

 

Done.... now! :-) 

Link to post
Share on other sites

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:25Error 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 by domin12
Link to post
Share on other sites

sorry, you have missed to update evenrunner3.lua with new version. Patching is looping

@jgab

Edited by jompa68
Link to post
Share on other sites
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.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...