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

  • Topic Author
  • Posted
    2 hours ago, ChristianSogaard said:

    i see..

     

    Using 1861 instead of LastPerson - gives me the trigger but also the QA Crash 

    1: tryArm works in other rules (the Pointer show the Error is there, right?).

    Please login or register to see this code.

    Please login or register to see this attachment.

     

    If I want to use LastPerson, then lastPerson need to get the ID from the PeopleMap right?

    Like ... ask(PeopleMap[LastPerson].id

    But this gives me - Runtime: table is 'nil' for array reference

    I guess this because that LastPerson starts with being noting -> var.LastPerson = "" 

    So i tried var.LastPerson = 2120 - the Runtime: table is 'nil' for array reference goes away - one down ;-)

     

    Please login or register to see this code.

    returns 2 for Admin user, when House is empty, that is correct but i need the mobile phone ID associated to the USER, right?.

     

    Jan you do message the iPhone with the user ID - not Phone ID - but it seems i cant do this with Ask - is that right?

    Please login or register to see this code.

     

    No, it needs to be the device of type iOS...

     

    Here is a function that returns the last device used by a userId

    Please login or register to see this code.

    So, if I call userDevice(2) where 2 is the id of the admin it returns 923 that is the last iOS device used by user id 2.

    923 is then usable in ask.

    So, in the PeopleMap add another field .phone that is the userDevice(userId) for each user.

    The you can do ask(PeopleMap[2120].phone:msg = ...

    Posted
    22 minutes ago, jgab said:

    No, it needs to be the device of type iOS...

     

    Here is a function that returns the last device used by a userId

    Please login or register to see this code.

    So, if I call userDevice(2) where 2 is the id of the admin it returns 923 that is the last iOS device used by user id 2.

    923 is then usable in ask.

    So, in the PeopleMap add another field .phone that is the userDevice(userId) for each user.

    The you can do ask(PeopleMap[2120].phone:msg = ...

     

    I added the phone field in Peoplemap - this works -with

    Please login or register to see this code.

    thank you :-)

     

    This works

    Please login or register to see this code.

     

    This dont

    Please login or register to see this code.

    [Rule:2:1]>> [Rule:2:HouseIsEmpty & ask(PeopleMap[LastPerson].phone,'Vil du aktivere alarm?', 'Tryk yes at aktivere alarm?', 10) => 0:tryArm] Runtime: ./include/vm.lua:256: attempt to index a boolean value (upvalue 'env') prop
    HouseIsEmpty & ask(PeopleMap[LastPerson].phone,'Vil du aktivere alarm?', 'Tryk yes at aktivere alarm?', 10) => 0:tryArm

                                                                                                                                                                                                  ^

    Is it because that tryArm waits to see if ARM Success and ASK waits for timeout ?

     

    Posted
    3 hours ago, jgab said:

    No, if it's "scrolled out of the console" it's lost.

    I could probably come up with a special log buffer for errors so one could list them...

    thanks

    Posted

    @jgab How do you use the "levelIncrease" function in a rule? 

  • Topic Author
  • Posted (edited)
    20 minutes ago, javene said:

    @jgab How do you use the "levelIncrease" function in a rule? 

    Some dimmers have methods for level increase, level decrease, and level stop. Typically fibaro's dimmers support it.

    This means that they start to dim up or down according to some predefined value.

    In my QA ChildrenOfHue, the Hue devices mapped to QAs also support level commands if they are dimmable.

    I don't know how it's with other Hue plugins/QAs.

     

    In ER5 that is mapped to prop functions

    <ID>:levelIncrease

    <ID>:levelDecrease

    <ID>:levelStop

     

    Ex. rules to use a fibaro keyfob to dim up using key 1 and dim down with key 2 would look like

    Please login or register to see this code.

     

    or with less rules

    Please login or register to see this code.

     

    Edited by jgab
    Posted

    How would you set the time for the levelincrease, if you want it to dim up over 1 hour, from 0% to 100 %? 

     

     

  • Topic Author
  • Posted (edited)
    14 minutes ago, javene said:

    How would you set the time for the levelincrease, if you want it to dim up over 1 hour, from 0% to 100 %? 

    Well, you don't. Level commands have a pre-set speed depending on device.

     

    In ER5 you can use the :dim command instead

     

    <id>:dim = { time, direction, steps, curve, startValue, stopValue }

     

    Ex.

    Please login or register to see this code.

    dims up lamp during 30min in steps of 5s, using linear curve, starting at 0 going to 99.

     

    The different curves are 

    • linear, 
    • inQuad
    • inOutQuad
    • outInExpo
    • inExpo
    • outExpo
    • inOutExpo

    See 

     

     

    Edited by jgab
    • Like 1
  • Topic Author
  • Posted
    18 hours ago, ChristianSogaard said:

     

    I added the phone field in Peoplemap - this works -with

    Please login or register to see this code.

    thank you :-)

     

    This works

    Please login or register to see this code.

     

    This dont

    Please login or register to see this code.

    [Rule:2:1]>> [Rule:2:HouseIsEmpty & ask(PeopleMap[LastPerson].phone,'Vil du aktivere alarm?', 'Tryk yes at aktivere alarm?', 10) => 0:tryArm] Runtime: ./include/vm.lua:256: attempt to index a boolean value (upvalue 'env') prop
    HouseIsEmpty & ask(PeopleMap[LastPerson].phone,'Vil du aktivere alarm?', 'Tryk yes at aktivere alarm?', 10) => 0:tryArm

                                                                                                                                                                                                  ^

    Is it because that tryArm waits to see if ARM Success and ASK waits for timeout ?

     

    Help me, your first rule works and your last don't - but they are the same or?

    Please login or register to see this code.

     

    Posted
    1 minute ago, jgab said:

    Help me, your first rule works and your last don't - but they are the same or?

    Please login or register to see this code.

     

    The action is different

     

    works

    => log('vil du aktiverer PUSH')")

     

    Dont work in whole rule - 

    => 1:tryArm")

     

    1:tryArm") works in simple rule

  • Topic Author
  • Posted
    18 minutes ago, ChristianSogaard said:

    The action is different

     

    works

    => log('vil du aktiverer PUSH')")

     

    Dont work in whole rule - 

    => 1:tryArm")

     

    1:tryArm") works in simple rule

    Thanks, that's a bug - a bit deep - functions waiting in some cases causes problem for functions coming afterwards because they don't restore stuff in an expected way... anyway, I have an idea how to fix it... back soon...

  • Topic Author
  • Posted
    13 minutes ago, jgab said:

    Thanks, that's a bug - a bit deep - functions waiting in some cases causes problem for functions coming afterwards because they don't restore stuff in an expected way... anyway, I have an idea how to fix it... back soon...

     

    Ok, pushed v0.86 that fixes a bug with asynchronous functions.

    Also there are some experimental code to try to detect if multiple version of the same QA is running - something that @ChristianSogaard and @Neo Andersson may have run into recently.

    The QA will log a message and disable itself it that happens...

    • Thanks 1
    Posted (edited)
    16 minutes ago, jgab said:

     

    Ok, pushed v0.86 that fixes a bug with asynchronous functions.

    Also there are some experimental code to try to detect if multiple version of the same QA is running - something that @ChristianSogaard and @Neo Andersson may have run into recently.

    The QA will log a message and disable itself it that happens...

    Thank you Jan

     

    confirming the 0.86 helped at 

    rule("HouseIsEmpty & ask(PeopleMap[LastPerson].phone,'Vil du aktivere alarm?', 'Tryk yes at aktivere alarm?', 10) => 1:tryArm")

    Edited by ChristianSogaard
    Typo
    Posted (edited)
    19 minutes ago, jgab said:

     

    Ok, pushed v0.86 that fixes a bug with asynchronous functions.

    Also there are some experimental code to try to detect if multiple version of the same QA is running - something that @ChristianSogaard and @Neo Andersson may have run into recently.

    The QA will log a message and disable itself it that happens...

     

    Hi Jan

     

    For me the multiple version of the same QA is running happed twice. For both cases i have been played with ZeroBraneStudie. (and I do that rarely)

    Perhaps @Neo Andersson can verify if he also is using it.

     

    Edited by ChristianSogaard
    Typo
    Posted
    1 hour ago, ChristianSogaard said:

     

    Hi Jan

     

    For me the multiple version of the same QA is running happed twice. For both cases i have been played with ZeroBraneStudie. (and I do that rarely)

    Perhaps @Neo Andersson can verify if he also is using it.

     

    No, i am not usin ZeroBrain

    Posted
    1 hour ago, jgab said:

     

    Ok, pushed v0.86 that fixes a bug with asynchronous functions.

    Also there are some experimental code to try to detect if multiple version of the same QA is running - something that @ChristianSogaard and @Neo Andersson may have run into recently.

    The QA will log a message and disable itself it that happens...

    @jgabJan, should it log a message into debug window, or onto UI?

    I am asking, becasue sometimes when some warning or error is logged out into debug window, and there is too much time elapsed until I notice it, it is impossible to find out, what happened, as the context of the error message  scrolles out of visible scope of the debug window

  • Topic Author
  • Posted
    13 minutes ago, Neo Andersson said:

    @jgabJan, should it log a message into debug window, or onto UI?

    I am asking, becasue sometimes when some warning or error is logged out into debug window, and there is too much time elapsed until I notice it, it is impossible to find out, what happened, as the context of the error message  scrolles out of visible scope of the debug window

    In the console for now. I'm working on a way to persist errors better. 
    In this case the QA should become disabled so it would/should stop there...

    Posted
    2 minutes ago, jgab said:

    In the console for now. I'm working on a way to persist errors better. 
    In this case the QA should become disabled so it would/should stop there...

    Well, disabling a QA for me will casue some troubles i think. I am running ER5 on several customer's systems. I decided to do so, for testing purposes, and to help you to find bugs. You know if i am testing it only on my own system, it is nothing, because my system doesn't really change in time. It is a ready, running system, so if there is no error at the beginning there will be no error in the future probably. Thats why i am running the system on several customer's houses.

    Posted

    Where or how to see that a QA is running twice?

    I never have seen it before.

  • Topic Author
  • Posted
    38 minutes ago, Sjakie said:

    Where or how to see that a QA is running twice?

    I never have seen it before.

    It's very rare - like winning on the lottery :) 

    • Like 1
    Posted

    Hi Jang, 

     

    Im trying to make a rule that makes the lights go down smoothly but i cant seem to get the hang of it, and i dont know if its possible, But what i want to to establish is a rule that takes the current value of the dimmer and then in a span of around 3h gets it down to a set value of 10% What i really wanna establish is for it during evening to dim all the lights from their current value without it being really noticeable. My other approach would be to set different drops during these time but i would much prefer to make it smoother. I tried this but it did not workrule("@18:30 => vardagsrum_hangande_lampa:dim = {03:30, 'down', 5, 'Linear', nil, 10}") Any ideas for how this can be done or should i just stick to the set values? 

     
     

    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...