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 (edited)

    The idea, is that AOQ will support HC2 devices remotely... something like remote slave.

    I mean you'll be able to control devices in HC2 in HC3. (using API commands).

    I t will be something like that

    {"hc2:44|45","turnOn",""}

    Means turn ON device 44 at HC2 and 45 at HC3 or any other combination.

    I'm working on AOS and AOQ to support remote commands, it means HC2 will be able to control HC3 devices as well...

    By the way I'm going to use that to support  unlimited number of controllers (including HCL)

    for example

    trueAct={"hc21:44|hc22:78:hcl1:67|89","turnOn",""}

    Turn on

    device 44 at HC2 (1)

    device 78 at HC2 (2)

    device 67 at HCL (1)

    device 89 at HC3

     

    In this case you can keep your old controllers in any configuration you need and to use it as HUB for faraway devices...

    In my case I want to keep HC2 as basement controller... HC3 unable to control Z-wave devices down there.

    I hope Fibaro or someone else won't steal this idea from me...??

    Edited by cag014
    Posted

    Wow... I'll wait for that, will start just to add new devices to HC3.

    When you expect to release that blowing up idea?

     

  • Topic Author
  • Posted
    17 minutes ago, Rover said:

    @cag014,

     

    The intention is to give the HC2 to my son to automate his house too.

    But I am still curious in your idea of an alternative use of HC2.

    Splendid!

    TNX, cag014

    BTW you can add as much as needed time based actions (no limits at all)

    timeSlot="11:01~,13:02~,18:00~,~11:03,~23:00", and etc...

    Using condition field you can define in trueAct{} table different commands to execute

    {0, "$24clock",{state="value=0",timeSlot="11:01~,18:00~,~11:03",
          trueAct={{"Testaan","sendEmail[2]","Waterval aan","{$24clock:value=11:01",{"67","turnOn","","{$24clock:value=18:00}"}},
          falseAct={{"Testuit","sendEmail[2]","Waterval uit"}}}}

    Send true email at 11:01. Turn on device 67 at 18:00

    Posted

    Hi @cag014,

    In HC2 I often use local variables in order to do counting or arithmetic or create/modify tables.

    How can I do that in AOS?

    Posted
    1 hour ago, cag014 said:

    The idea, is that AOQ will support HC2 devices remotely... something like remote slave.

    I mean you'll be able to control devices in HC2 in HC3. (using API commands).

    I t will be something like that

    {"hc2:44|45","turnOn",""}

     

     

    In this case you can keep your old controllers in any configuration you need and to use it as HUB for faraway devices...

    In my case I want to keep HC2 as basement controller... HC3 unable to control Z-wave devices down there.

    I hope Fibaro or someone else won't steal this idea from me...??

     

    I'm in if you need someone to test it. Actually i'm stuck on migration to hc3 cause i can't control zwave device connected to a slave controller in garden...and i'm worried about hc3 zwave coverage. I have hc2 inside a small rack with external antenna so i don't know if hc3 will act as expected inside the same rack

     

     

  • Topic Author
  • Posted (edited)
    4 hours ago, Rover said:

    Hi @cag014,

    In HC2 I often use local variables in order to do counting or arithmetic or create/modify tables.

    How can I do that in AOS?

    You can use or set any variable in the system.

    Just add ampersand sign "&" before the variable name

    for example

    {0,"&varName",{state="value=test",trueAct={....., falseAct...

     

    Command to set variable

    {"varName","setGlobal","value"} - could be used in any action array (trueAct, falseAct, intiAct, timeoutAct, timeLoopAct)

    You can do calculation on anything in AOS, just include your formula in question marks ?2*3+3?

    for example

    {"varName","setGlobal","?20+@45>power?"}

    means set variable myVar to  20+power reading of device 45.

    AOS supports all Lua math library.

    for example

    {"varName","setGlobal","?max(20,@45>power)?"}

    means set variable myVar to maximum value between 20 and power reading of device 45.

    To use Lua math library, don’t put 'math.function' just instead of math.floor(10.3) use floor(10.3).

    See AOS Advanced User’s Guide

     

    Edited by cag014
    Posted
    4 minutes ago, cag014 said:

    You can use or set any variable in the system.

    Just add ampersand sign "&" before the variable name

    for example

    {0,"&varName",{state="value=test",trueAct={....., falseAct...

     

    Command to set variable

    {"varName","setGlobal","value"} - could be used in any action array (trueAct, falseAct, intiAct, timeoutAct, timeLoopAct)

    You can do calculation on anything in AOS, just include your formula in question marks ?2*3+3?

    for example

    {"varName","setGlobal","?20+@45>power?"}

    means set variable myVar to  20+power reading of device 45.

    AOS supports all Lua math library.

    for example

    {"varName","setGlobal","?max(20,@45>power)?"}

    means set variable myVar to maximum value between 20 and power reading of device 45.

    To use Lua math library, don’t put 'math.function' just instead of math.floor(10.3) use floor(10.3).

    See AOS Advanced User’s Guide

     

    So there are no local variables, just global variables?

    Do I have to declare these global variables in the Variable Panel?

  • Topic Author
  • Posted (edited)
    38 minutes ago, Rover said:

    So there are no local variables, just global variables?

    Do I have to declare these global variables in the Variable Panel?

    No, you can define local variables as well.

    See follow global definition

    global4local= {false,gVarName="",varArray={onState="init:off",my_Var="isOff"}}

    that's how it works

    global4local= {false, -- indicates if local variables  are stored in system global variable. Usually to keep latest local values if you restart the AOS.

    gVarName="", -- system global variable name to store local variables. Need to be defines in Variable panel.

    varArray={onState="init:off",my_Var="isOff"}} -- local variables definition. In case you variables are stores, but you need init default value when AOS restarted use "init:value". In this example variable onState will be set to value off on every AOS restart regardless what is store in system global variable.

     

    Note: if global4local set to false, every restart local variables will be set as defined in varArray

     

    Edited by cag014
    Posted

    So with use of global4local no need for setGlobal? How do you declare local variables?

  • Topic Author
  • Posted

    If you need to change variable value you need to use setGlobal...

    Declaration is (local variables are marked red)

    global4local= {false,gVarName="",varArray={onState="init:off",my_Var="isOff"}}

     

    See global variable in AOS code

    eMail       = {true,"2"}    -- if true, scene's alerts will emailed to user IDs list. To include more users use: eMail={true,"2,5,20"}
    popupNote   = false -- if true, scene's alert popup notification will send to all users
    pushNote    = {true,""}  -- if true, scene's alerts interactive push notification will send
    sms         = {false,"123456"} -- if true,scene's alerts SMS will send. Before use, update sendSms() function with your setup.
    deadNote    = true  -- if true, send auto-alert notification on dead Z-wave traffic occurrences.
    autoRestart = true -- in case the scene is failed, send notification and restart the scene automatically.
    wakeUpRate  = 10 --(minutes) wakeUp dead devices time rate. 0-disable
    timeDrift   = 0  --(seconds) system's time drift
    rstDeadRpt  = 24 --(hours) reset RPT and Dead data. 0-disable    
    alertRate   = 90 --(minutes) alert report repeat time rate. 0-disable   
    tblRefresh  = 60 --(seconds) table view refresh rate.    
    cnnLine     = 25 -- number of last commands in order of execution to display at bottum of the table. (0-60)
    dataRecord  = {values=10,commands=6} --number of last values and commands to display (1-20)
    global4local= {false,gVarName="",varArray={onState="init:off",my_Var="isOff"}}   
    global4rmd  = {false,gVarName="jRmd"}
    topActive   = 15 -- number (0-30) of top active slave devices to display at dropdown menu. 0-disable. Default 10
    topZwave    = 15 -- number (0-30) of top active master devices in table view. 0-disable. Default 10

     

    Posted

    What do I wrong?

     

    jM={
      {global4local= {false,gVarName="",varArray={GIAmoves="0",onState="init:off",my_Var="isOff"}}},

     

    Please login or register to see this image.

    /monthly_2020_08/afbeelding.png.5f8976f4a3e3584b32cd4a4f75be8fab.png" />

    Posted
    8 hours ago, Rover said:

    What do I wrong?

     

    jM={
      {global4local= {false,gVarName="",varArray={GIAmoves="0",onState="init:off",my_Var="isOff"}}},

     

    Please login or register to see this link.

    I discovered that global4local was already part of the code!

    Using this delivers indeed local variables. :-)

  • Topic Author
  • Posted (edited)
    4 minutes ago, Rover said:

    I discovered that global4local was already part of the code!

    Using this delivers indeed local variables. :-)

    So it works?

    Edited by cag014
    Posted
    2 minutes ago, cag014 said:

    So it works?

    Yes ?

    Posted

    Hi @cag014,

    Another question:

    Why timeSlot="00:00+random(0,120)~" is not accepted? ("Assertion failed: Expected string")

    How to implement randomseed($osTime) in AOS?

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

    Hi @cag014,

    Another question:

    Why timeSlot="00:00+random(0,120)~" is not accepted? ("Assertion failed: Expected string")

    How to implement randomseed($osTime) in AOS?

    Thanks for finding another bug... the math library causes an error!!!

    Let me know if it's important issue for you and I'll post fixed code... if not next release...

    Posted
    1 hour ago, cag014 said:

    Thanks for finding another bug... the math library causes an error!!!

    Let me know if it's important issue for you and I'll post fixed code... if not next release...

    Yes, it is important for me. If you have planned a new release within one month, then I can wait for the next release.

    Posted

    a=23,b=35,c=`a`|`b`,

    d=48,e=49,f=`d`|`e`,

    g=`d`|`f`,

    trueAct={"`g`","turnOff",""}

    Result is error: a or b or d or e is unknown alias.

    Posted

    trueAct={{"`device`","turnOff","","{&Huisstatus:value=Weg}"},{"Weg: Lichten Uit","sendEmail[2]","Weg: Alle Lichten Uit"}},

    Result is: device turnoff if condition=true, but always an e-mail.

    How can you make the e-mail also conditional with the same condition?

  • Topic Author
  • Posted

    Interesting question, but what kind of condition you think about with the email? if email equal/less/greater to what value?

    28 minutes ago, Rover said:

    a=23,b=35,c=`a`|`b`,

    d=48,e=49,f=`d`|`e`,

    g=`d`|`f`,

    trueAct={"`g`","turnOff",""}

    Result is error: a or b or d or e is unknown alias.

    Please elaborate more about that!?

    What exactly you need...?

    44 minutes ago, Rover said:

    Yes, it is important for me. If you have planned a new release within one month, then I can wait for the next release.

    Yes, I want to release new version next Sunday...

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