Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


Recommended Posts

Hey Gap

I have another problem

It worked in ER4-3.fqa version

But in ER4-6.fqa it is an error

Example rule

 

 

  rule([[$PresentState=='Home' & officedeskLight:isOn =>
    || 22:00..23:00 >> officedeskLight:color={0,255,0,0}
    || 23:01..00:00 >> officedeskLight:color={0,119,155,0}
    || 00:01..01:00 >> officedeskLight:color={129,70,0,0}
    || 01:01..02:00 >> officedeskLight:color={215,0,255,0}
   ]])

rule("officemotion:breached & 22:00..02:00 =>  officedeskLight:value=50") 
rule("officemotion:breached & 02:10..04:00 =>  officedeskLight:value=20") 
rule([[$PresentState=='Home' & trueFor(officetimer,officemotion:safe) & 22:00..04:00 => officedeskLight: value=5]]) 
rule("@04:00   =>  officedeskLight:off")   

 

 

 Error

 

[DEBUG] 05.04.2020 23:22:32: [ERROR] in 'Rule:78[exitlamp:isOn =>...]': {"msg":"Error executing instruction:'["%prop",1,"isOn"]'","src":"Rule:78[exitlamp:isOn =>...]","ERR":true,"err":"EventRunner4.lua:2084: attempt to compare string with number"}
[DEBUG] 05.04.2020 23:22:32: [ERROR] in 'Rule:79[exitlamp:isOn =>...]': {"msg":"Error executing instruction:'["%prop",1,"isOn"]'","src":"Rule:79[exitlamp:isOn =>...]","ERR":true,"err":"EventRunner4.lua:2084: attempt to compare string with number"}
[DEBUG] 05.04.2020 23:22:32: [ERROR] in 'Rule:78[exitlamp:isOn =>...]': {"msg":"Error executing instruction:'["%prop",1,"isOn"]'","src":"Rule:78[exitlamp:isOn =>...]","ERR":true,"err":"EventRunner4.lua:2084: attempt to compare string with number"}
[DEBUG] 05.04.2020 23:22:32: [ERROR] in 'Rule:79[exitlamp:isOn =>...]': {"msg":"Error executing instruction:'["%prop",1,"isOn"]'","src":"Rule:79[exitlamp:isOn =>...]","ERR":true,"err":"EventRunner4.lua:2084: attempt to compare string with number"}

 

 

 

The device is fibaro RGBW

 

============

 

Second rule error

 

---season
rule([[@{00:00,catch} =>        
    || month('dec-jan') >> post(#SEA{value='Winter'}); log('Set GV into %s',$SeasonState)
    || month('apr-may') >>  post(#SEA{value='Spring'}); log('Set GV into %s',$SeasonState)
    || month('jun-sep') >>  post(#SEA{value='Summer'}); log('Set GV into %s',$SeasonState)
    || month('oct-nov') >>  post(#SEA{value='Autumn'}); log('Set GV into %s',$SeasonState)
    ]])
rule("#SEA{value='$val'} => $SeasonState=val")

 

 

error 

 

[ERROR] in 'Rule:1[@{00:00,catch} => $Month = Months[os.date('*t').month];  log('Set GV into %s',$M...]': {"msg":"Error executing instruction:'["%var",0,"Months","script"]'","src":"Rule:1[@{00:00,catch} => $Month = Months[os.date('*t').month];  log('Set GV into %s',$M...]","ERR":true,"err":"EventRunner4.lua:1966: attempt to index global '_ENV' (a nil value)"}
[DEBUG] 05.04.2020 23:21:39: [ERROR] in 'Rule:2[@{00:00,catch} => $WeekDay = weekdays[os.date('*t').wday];  log('Set GV into %s'...]': {"msg":"Error executing instruction:'["%var",0,"weekdays","script"]'","src":"Rule:2[@{00:00,catch} => $WeekDay = weekdays[os.date('*t').wday];  log('Set GV into %s'...]","ERR":true,"err":"EventRunner4.lua:1966: attempt to index global '_ENV' (a nil value)"}
[DEBUG] 05.04.2020 23:21:39: Set GV into Spring

 

 

==================================

Third rule error

 

rule("Livingbath_door:safe => wait(00:00:10); post(#livingbathIn)")
rule("#livingbathIn => Livingvent:on ")
rule("Livingbath_door:breached =>wait(00:03); post(#livingbathOut)") 
rule("#livingbathOut => Livingvent:off ")

 

 

 

Error

wait (00:00:20) <= not running

 

 

============================

 

4th rule error

 

 

 

rule("rm.Philiocolorbutton2:central.keyId=='1' & ch.KidLight:isOff  =>  ch.KidLight:on") 
 rule("rm.Philiocolorbutton2:central.keyId=='1' & ch.KidLight:isOn  =>  ch.KidLight:off") 

 

 

 

ch.KidLight:isOn  <= Status value reflection

 

 

 

I need advice

 

 

 

 

 

 

 

 

Edited by minsad79
Link to comment
Share on other sites

Do you have the next versi

Please login or register to see this image.

/monthly_2020_04/4.PNG.422ff27c62ac59f1726a51725b69e186.PNG" />on of the quick app?

Link to comment
Share on other sites

Hi. jgab

I use 0.1 fix9  version. 

 
rule("button1:central.keyAttribute=='Pressed' => bedroomLight:value=50")
rule which above is not working.
 
I think set value command is not woking. bedroomLight:on , bedroomLight:off are working properly.
 
Sorry I did wrong. everything working fine.
 
Edited by luke-js
Link to comment
Share on other sites

Guest kallecux

Hi @jgab!

 

If i use this rule:

rule("@@00:00:10 => fibaro.call(353,'publish','hc3/dachterrasse/erdfeuchtigkeit',Dachterrasse.Erdfeuchtigkeit:value)")

 

i get this in the debug console:

[17.04.2020] [18:04:20] [DEBUG] [QUICKAPP284]: [D] fibaro.call(353,"publish","hc3\/dachterrasse\/erdfeuchtigkeit",64.814814814815) => nil

 

it seems, that there i a conversion, so i can't handle the string i my publish method. 

 

Greetings - Karl Heinz 

 

P.S: I use ER4 Fix7 on HC3 :-)

Edited by kallecux
Link to comment
Share on other sites

  • Topic Author
  • On 4/17/2020 at 6:07 PM, kallecux said:

    Hi @jgab!

     

    If i use this rule:

    rule("@@00:00:10 => fibaro.call(353,'publish','hc3/dachterrasse/erdfeuchtigkeit',Dachterrasse.Erdfeuchtigkeit:value)")

     

    i get this in the debug console:

    [17.04.2020] [18:04:20] [DEBUG] [QUICKAPP284]: [D] fibaro.call(353,"publish","hc3\/dachterrasse\/erdfeuchtigkeit",64.814814814815) => nil

     

    it seems, that there i a conversion, so i can't handle the string i my publish method. 

     

    Greetings - Karl Heinz 

     

    P.S: I use ER4 Fix7 on HC3 :-)

     

    Hi,

    Isn't it just the way the log console prints the string with forward dashes in it? If you print the value in the receiving QA 353 does it look normal?

    QAs tend to do some funny conversion of arguments that are strings but look like other datatypes.

    Ex try this:

    Please login or register to see this code.

    The string with forward slashes when logged in the console have \/ (the onAction.. log) but when printed looks normal.

    However, the other values are converted to numbers, booleans, and tables - a bit unexpected...

     

    Link to comment
    Share on other sites

    Guest kallecux

    Pardon, you are right! 

     

    In QA 353 i get this:

    [22.04.2020] [16:04:04] [DEBUG] [QUICKAPP353]: hc3/dachterrasse/erdfeutigkeit

    [22.04.2020] [16:04:04] [DEBUG] [QUICKAPP353]: 60.3704

     

    but then QA 353 crashed:

     

    [22.04.2020] [16:04:04] [DEBUG] [QUICKAPP353]: No matching overload found, candidates: unsigned short publish(Client&,std::string const&,std::string const&) unsigned short publish(Client&,std::string const&,std::string const&,luabind::object)

    [22.04.2020] [16:04:04] [ERROR] [QUICKAPP353]: QuickApp crashed

    [22.04.2020] [16:04:04] [ERROR] [QUICKAPP353]: Unknown error occurred: handleJsonRpc

     

    Solution: the 2. parameter has to be converted via tostring() 

    Edited by kallecux
    Link to comment
    Share on other sites

  • Topic Author
  • 30 minutes ago, kallecux said:

    Pardon, you are right! 

     

    In QA 353 i get this:

    [22.04.2020] [16:04:04] [DEBUG] [QUICKAPP353]: hc3/dachterrasse/erdfeutigkeit

    [22.04.2020] [16:04:04] [DEBUG] [QUICKAPP353]: 60.3704

     

    but then QA 353 crashed:

     

    [22.04.2020] [16:04:04] [DEBUG] [QUICKAPP353]: No matching overload found, candidates: unsigned short publish(Client&,std::string const&,std::string const&) unsigned short publish(Client&,std::string const&,std::string const&,luabind::object)

    [22.04.2020] [16:04:04] [ERROR] [QUICKAPP353]: QuickApp crashed

    [22.04.2020] [16:04:04] [ERROR] [QUICKAPP353]: Unknown error occurred: handleJsonRpc

     

    Solution: the 2. parameter has to be converted via tostring() 

    I guess publish is the MQTT public command?

    The error you get is because the arguments are wrong to publish - so I would add some code to print the args and their types before you call publish.

    Link to comment
    Share on other sites

    Hi gab

    Rules below

    rule ("rm.Philiocolorbutton2: central.keyId == '1' & ch.KidLight: isOff => ch.KidLight: on")
      rule ("rm.Philiocolorbutton2: central.keyId == '1' & ch.KidLight: isOn => ch.KidLight: off")
     
    The isOn or isOff rule does not apply

    Are there? Modified version

     

    P.S: I use ER4 Fix9 on HC3 

    Edited by minsad79
    Link to comment
    Share on other sites

    Guest kallecux

    Hi @jgab!

     

    Are you planning to incorporate MQTT functionality into ER4?

     

    I had already read something about this in your posts, but the EventRunner4.lua is still in version 0.1 fix7 on the github.

     

    Best regards
    Karl Heinz

     

    P.S: ... that was probably a superfluous question, because the integration of fibaro is sufficient ... right?

    Edited by kallecux
    Link to comment
    Share on other sites

  • Topic Author
  • 37 minutes ago, kallecux said:

    Hi @jgab!

     

    Are you planning to incorporate MQTT functionality into ER4?

     

    I had already read something about this in your posts, but the EventRunner4.lua is still in version 0.1 fix7 on the github.

     

    Best regards
    Karl Heinz

     

    P.S: ... that was probably a superfluous question, because the integration of fibaro is sufficient ... right?

    Well, I have had some thinking how mqtt could be easier to use from ER rules...

    I have  been busy working the SDK/emulator but its slowly starting to come together so I will turn my attention to ER4.

    Link to comment
    Share on other sites

    Jan,

    I try to add a value or is that not posible?

     

    Util.defTriggerVar('keuken') -- Define 'keuken' as a trigger variable

     

    Rule.eval([[@13:06 => 
            keuken = eetkamer.humidity:value
            log('keuken handmatig setA :%s%%',keuken); post(#keukenInfo);
            log('TRIGGER:%s',tjson(env.event))
                ]])

    What am I doing wrong?

    Thanks in advance,

    //Sjakie

    Link to comment
    Share on other sites

  • Topic Author
  • 6 minutes ago, Sjakie said:

    Jan,

    I try to add a value or is that not posible?

     

    Util.defTriggerVar('keuken') -- Define 'keuken' as a trigger variable

     

    Rule.eval([[@13:06 => 
            keuken = eetkamer.humidity:value
            log('keuken handmatig setA :%s%%',keuken); post(#keukenInfo);
            log('TRIGGER:%s',tjson(env.event))
                ]])

    What am I doing wrong?

    Thanks in advance,

    //Sjakie

     A missing ';' at the end of like

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

    Jan, sorry should have seen that by myself, error message distracted me.

    Here I  do something wrong too I am recalculate the setting Wind given in Km/h into Beaufort:

     

    Util.defTriggerVar('Wind') -- Define 'Wind' as a trigger variable

    rule("#keukenInfo => Wind = api.get('/weather').Wind") -- Update 'Wind' every call #keukeninfo


    the error is in the notation ==> or ==< I think

     

    Rule.eval([[#buitenInfo & Wind == <0.2 => Beaufort = 0; log('TRIGGER:%s',tjson(env.event)); log2('orange','windstil - zee als spiegel')]]
    Rule.eval([[#buitenInfo & Wind == >0.3 & Wind <1.5 => Beaufort = 1; log('TRIGGER:%s',tjson(env.event)); log2('orange','zwakke wind flauw en stil - kleine golfjes') ]]

    Please advice,

    //Sjakie
     

    Link to comment
    Share on other sites

    Hi jgab

    Is there a way to run the profile in HC3 er?

    Edited by minsad79
    Link to comment
    Share on other sites

  • Topic Author
  • 1 minute ago, minsad79 said:

    Hi jgab

     

    Is there a working version of the profile in HC3 er?

    to set and get current profile? (no not yet, next version)

    Edited by jgab
    Link to comment
    Share on other sites

    8 minutes ago, jgab said:

    현재 프로필을 설정하고 얻으려면? (아직, 다음 버전은 아닙니다)

    Please login or register to see this attachment.

     

     

     

    I want to set the profile of the image to work

    Home, away?

    Link to comment
    Share on other sites

  • Topic Author
  • 2 hours ago, minsad79 said:

    Please login or register to see this attachment.

     

     

     

    I want to set the profile of the image to work

    Home, away?

     

    I don't think I understand.

     

    Do you want to start and stop the QA EventRunner4?

    Do you want to start and stop specific rules in EventRunner4?

    Do you want to activate/deactivate specific profiles from rules in EventRunner4?

    Link to comment
    Share on other sites

    39 minutes ago, jgab said:

     

    I don't think I understand.

     

    Do you want to start and stop the QA EventRunner4?

    Do you want to start and stop specific rules in EventRunner4?

    Do you want to activate/deactivate specific profiles from rules in EventRunner4?

     

    Do you want to activate/deactivate specific profiles from rules in EventRunner4? <=== 

     

    For example

    All lights off when leaving home

    I want to create a profile like the one above

    Link to comment
    Share on other sites

    Hello Jan,

     

    Since months we are using your color scene to change color of our outside lights.

    When I was in Dubai I saw a kind of cascade with water fotain jumping form one spray head to another.

    Can you propose someting simular with HUE?

    lamp1>>red lamp2>>yellow>> lamp3>>blue>>lamp4>>green>>lamp5>>pink>>lamp6>>white>>

    lamp1>>white lamp2>>red>> lamp3>>yellow>>lamp4>>blue>>lamp5>>green>>lamp6>>pink>>

    lamp1>>pink>>lamp2>>white lamp3>>red>> lamp4>>yellow>>lamp5>>blue>>lamp6>>green>>

    lamp1>>green>>lamp2>>pink>>lamp3>>white lamp4>>red>> lamp5>>yellow>>lamp6>>blue>>

    and so one

    I used till now

      -- Every 10s, pick a new value from colorParams, wrap around at end of table.
      colorShow = Rule.eval([[@@00:00:10  =>
           oprit.spotbeeld:value=colorParams[colorIndex];
        colorIndex=(colorIndex % size(colorParams))+1
        ]]).disable()

     colorParams={  -- Table of color values
        {bri=245, hue=45573, sat=231, transitiontime=2, col=337},--blauw

    }

    Thanks in advanced and much obliged.

     

    //Sjakie

    Link to comment
    Share on other sites

  • Topic Author
  • New version of EventRunner4.

    Please login or register to see this attachment.

     v0.2 fix1

    There are some changes in the structure of events. The previous version tried to mimic the structure of sourceTriggers on the HC2. 

    This version is more like the HC3.

    Ex.

    HC2. {type='property', deviceID=88, propertyName='value', value=1}

    HC3. {type='device', id=88, property='value', value=1}

     

    These are the events supported currently

       

    Please login or register to see this code.

    There should be  no difference if you use eventscript syntax.

    Please login or register to see this code.

    However, if you access the fields in the event be aware

    Please login or register to see this code.

    the label() function to access and get triggers from the UI buttons are gone.

    Instead there is a 'UI' event posted when a slider/button is pressed (see list above)

    and there are some new functions to manipulate the QA and profiles

    Please login or register to see this code.

    To trigger on ex. profile change, add a trigger on the event

    Please login or register to see this code.

    Stay tuned...
        

    Edited by jgab
    Link to comment
    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...