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


All-in-One Scene: How to do it Better


cag014

Recommended Posts

Guest Benrive
12 hours ago, cag014 said:

Agree.

Since you probably made some changes on the code, so to reduce your efforts for an update, please change marked lines in your QuickApp code

function QuickApp:updateStatus() 
    local val,vTime=0,0
    for i=1,#jUser do 
    val,vTime=fibaro.getGlobalVariable(jGlobal[i])
    self:updateView(jLbl.id[i], "text", jLbl.icon[i]..jLbl.fColor[i]..jUser[i].."</font>")
    self:updateView(jBtn[i], "text", jStatus[tonumber(val)+1]..os.date("  (%d %b %H:%M)", vTime)) 
    end
end
 
No changes in other lines in the code
Let me know if it's OK

 

Perfect.... 

 

Please login or register to see this image.

/monthly_2022_03/image.png.bd5a48d09cb0a2524cd98b2347dbca4a.png" />

 

Update: 

 

I am doing tests and I have put a condition, so that the color of the name matches the state. I feel powerful. hahahaha

??

 

Red = 0 Leave Home

Orange =  1 Coming Home

Green = 2 In Home

 

image.png.1a061365c7e4770c95e203f12c41f788.png

 

The new lines, I don't know if it's the most effective way, but it works and I'm happy.

 

function QuickApp:updateStatus() 
    local val,vTime=0,0
    for i=1,#jUser do 
    val,vTime=fibaro.getGlobalVariable(jGlobal[i])
        if fibaro.getGlobalVariable(jGlobal[i])=="0" then
            self:updateView(jLbl.id[i], "text", jLbl.icon[i]..jLbl.fColor[1]..jUser[i].."</font>")
        end
        if fibaro.getGlobalVariable(jGlobal[i])=="1" then
            self:updateView(jLbl.id[i], "text", jLbl.icon[i]..jLbl.fColor[2]..jUser[i].."</font>")
        end
        if fibaro.getGlobalVariable(jGlobal[i])=="2" then  
            self:updateView(jLbl.id[i], "text", jLbl.icon[i]..jLbl.fColor[3]..jUser[i].."</font>")
        end
    self:updateView(jBtn[i], "text", jStatus[tonumber(val)+1]..os.date("  (%d %b %H:%M)", vTime)) 
    end
end

 

Edited by Benrive
Link to comment
Share on other sites

Guest Benrive

Hi @cag014,

 

I had to change many things, but I think I have achieved it.

I had the biggest problem in the states, because they are different devices and have different label states.

 

I've also included a new state [5], "Update State" , for when the button is pressed it appears until the new state changes.

 

The variables are 2 door locks and a water tank (which notifies me when it is full).

please take a look

 

Please login or register to see this code.

 

Please login or register to see this attachment.

 

Please login or register to see this image.

/monthly_2022_03/image.png.ca91f410bcf61f035f6945c781c4b524.png" />

Edited by Benrive
Link to comment
Share on other sites

Guest Benrive

Hello @cag014,

 

I'm trying to substitute truAct for trueActstate on some lines to simplify them.

I want to replace this for example:

 

functional version.

Please login or register to see this code.

 

New version witch use trueActstate , 

Please login or register to see this code.

 

I have tried, following the examples of AOQ Avancer User , to place State before and also after trueActState , but in both I get an error.

This is the error that jumps me using as I have put now.

 

Please login or register to see this attachment.

Link to comment
Share on other sites

Guest Benrive

Edited in previous post

 

 

Edited by Benrive
Link to comment
Share on other sites

  • Topic Author
  • 14 hours ago, Benrive said:

     

     

    Please login or register to see this attachment.

    You have an extra Curve bracket (before if) , should be

    Please login or register to see this code.

    Link to comment
    Share on other sites

    Guest Benrive
    7 hours ago, cag014 said:

    You have an extra Curve bracket (before if) , should be

    Please login or register to see this code.

    ok,ok

    What a fool I am, and I was checking him several times

    Link to comment
    Share on other sites

    Guest Benrive

    ´Hi @cag014,

     

    Is it possible to group global variables? For example, I want that when all variables GPSxxx = 0 ( Leave home ), the door lock is closed if it is not closed.

     

     

    I have almost all the lines with a per person condition, when you can't really tell who is the one who opens the door.

    To simplify and have a condition when all are = 0 or 2

    Link to comment
    Share on other sites

  • Topic Author
  • 13 hours ago, Benrive said:

    ´Hi @cag014,

     

    Is it possible to group global variables? For example, I want that when all variables GPSxxx = 0 ( Leave home ), the door lock is closed if it is not closed.

     

     

    I have almost all the lines with a per person condition, when you can't really tell who is the one who opens the door.

    To simplify and have a condition when all are = 0 or 2

    No, but you have several options to simplify the line

    1 - check every XXX minutes if all users left home (the `ddor` and lock action just as an example)

    {3,"$timeLoop",{state="inLoop", timeLoopAct={"`door`","lock",  "if {&GPSSofia:value=0 and &GPSBenja:value=0 and &GPSMariAsun:value=0}"}}},

     

    2- Since you already have QuickApp to update GPS data, you can define global which sums the value of all users in QA and use it in AOQ line

     

    In Presence QuickApp update this global value like following:

     

    function QuickApp:updateStatus() 

        local val,vTime,total=0,0,0

        for i=1,#jUser do 

        val,vTime=fibaro.getGlobalVariable(jGlobal[i])

        total=total+val

        self:updateView(jLbl.id[i], "text", jLbl.icon[i]..jLbl.fColor[i]..jUser[i].."</font>")

        self:updateView(jBtn[i], "text", jStatus[tonumber(val)+1]..os.date("  (%d %b %H:%M)", vTime)) 

        end

        fibaro.setGlobalVariable("GPSAll", tostring(total))

    end

     

    Now you can use the global in jM line

    {"&GPSAll",{state="0", trueAct={"`door`","lock"}}},

     

    Note:

    when all users at home the GPSAll value =6 

     

     

     

    On 3/30/2022 at 11:05 AM, Benrive said:

    Hi @cag014,

     

    I had to change many things, but I think I have achieved it.

    I had the biggest problem in the states, because they are different devices and have different label states.

     

    I've also included a new state [5], "Update State" , for when the button is pressed it appears until the new state changes.

     

    The variables are 2 door locks and a water tank (which notifies me when it is full).

    please take a look

    Looks OK, is it works properly?

    Edited by cag014
    Link to comment
    Share on other sites

    Guest Benrive
    7 hours ago, cag014 said:

    Now you can use the global in jM line

    {"&GPSAll",{state="0", trueAct={"`door`","lock"}}},

     

    Sure, what an easy way to find out. There is nothing like the imagination to not mess up sometimes

    Thank's

    Link to comment
    Share on other sites

    Guest Benrive
    8 hours ago, cag014 said:

    No, but you have several options to simplify the line

    1 - check every XXX minutes if all users left home (the `ddor` and lock action just as an example)

    {3,"$timeLoop",{state="inLoop", timeLoopAct={"`door`","lock",  "if {&GPSSofia:value=0 and &GPSBenja:value=0 and &GPSMariAsun:value=0}"}}},

     

    2- Since you already have QuickApp to update GPS data, you can define global which sums the value of all users in QA and use it in AOQ line

     

    In Presence QuickApp update this global value like following:

     

    function QuickApp:updateStatus() 

        local val,vTime,total=0,0,0

        for i=1,#jUser do 

        val,vTime=fibaro.getGlobalVariable(jGlobal[i])

        total=total+val

        self:updateView(jLbl.id[i], "text", jLbl.icon[i]..jLbl.fColor[i]..jUser[i].."</font>")

        self:updateView(jBtn[i], "text", jStatus[tonumber(val)+1]..os.date("  (%d %b %H:%M)", vTime)) 

        end

        fibaro.setGlobalVariable("GPSAll", tostring(total))

    end

     

    Now you can use the global in jM line

    {"&GPSAll",{state="0", trueAct={"`door`","lock"}}},

     

    Note:

    when all users at home the GPSAll value =6 

     

     

     

    Looks OK, is it works properly?

     

    I think Yes, It looks good, when you press until the update is done, see how it says "Updating" in the label of the button.

     

    I pass you the file with all the modifications and added the part of GPS All.
    Now I'm thinking that this same variable could activate the alarm mode.

     

    Look how it turned out in the end

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

  • Topic Author
  • To all All-in-One users...

    Fibaro has released a new beta version that supports Zigbee devices on HC3

    For a while I have worked on the AOQ to make a necessary changes to support Zigbee.

    The new version will be released in few days, so

    Go and order Zigbee devices, they are cheaper that Z-wave and work fine on the system.

    • Like 1
    Link to comment
    Share on other sites

    Guest Benrive
    3 hours ago, cag014 said:

    To all All-in-One users...

    Fibaro has released a new beta version that supports Zigbee devices on HC3

    For a while I have worked on the AOQ to make a necessary changes to support Zigbee.

    The new version will be released in few days, so

    Go and order Zigbee devices, they are cheaper that Z-wave and work fine on the system.


    oh my good!!!. 
     

    It's great news, I was looking forward to it as there are some devices I'm looking forward to trying such as Aqara cube.
     

    Link to comment
    Share on other sites

    Hi

    If I use HC2 All in One ver. 7.2 dan I get the line.

     Item ID debugTag not found in the system.

    Please login or register to see this code.

    Thanks

    Link to comment
    Share on other sites

  • Topic Author
  • 2 hours ago, parip69 said:

    Hi

    If I use HC2 All in One ver. 7.2 dan I get the line.

     Item ID debugTag not found in the system.

    Please login or register to see this code.

    Thanks

    debug command is not available in AOS (as you can see in user guides...) debugTag is not available in HC2

    It supported for AOQ (debug, trace, error and etc...)

     

    I am about to release a new version of AOS, do you think "debug" command is necessary?

     

    Edited by cag014
    Link to comment
    Share on other sites

    Not necessary, but you can write some things into the consoles when testing and see the condition of the lines immediately.?????

     

    If the effort is too great then you save yourself the work it is such a great achievement what you have done there.

    Edited by parip69
    Link to comment
    Share on other sites

    Guest Benrive
    On 4/2/2022 at 1:53 PM, cag014 said:

    To all All-in-One users...

    Fibaro has released a new beta version that supports Zigbee devices on HC3

    For a while I have worked on the AOQ to make a necessary changes to support Zigbee.

    The new version will be released in few days, so

    Go and order Zigbee devices, they are cheaper that Z-wave and work fine on the system.

    Hi All,

     

    Everyone makes problems, but few people read. Look how strange it is that there are only 2 of us.
    Amazing

    Link to comment
    Share on other sites

  • Topic Author
  • 22 hours ago, parip69 said:

    Not necessary, but you can write some things into the consoles when testing and see the condition of the lines immediately.?????

     

    If the effort is too great then you save yourself the work it is such a great achievement what you have done there.

    New version will include same debugging levels like HC3 (debug, trace, error, warning )

    Please login or register to see this spoiler.

     

    Link to comment
    Share on other sites

    Guest Benrive
    21 hours ago, cag014 said:

    New version will include same debugging levels like HC3 (debug, trace, error, warning )

    Please login or register to see this spoiler.

    Link to comment
    Share on other sites

  • Topic Author
  • 5 hours ago, Benrive said:

    Hello @cag014.

     

    This is getting interesting... counting down the days for the new version ( And Zigbee release )

     

    Do you have anything in mind to be able to have a beta version of Zwave Monitor in HC3?

    I use this scene, which simply tells me the HOPS, but gives little more information.
    I have very thick walls and sometimes the nodes go from HOPS 1 to 4 for no apparent reason.

     

    Scene:

    -- File    : RoutingInfo-V3.lua
    -- Version : 0.1.1 -  {11.03.2021}
    -- (C) {jwi} 

    What version you have on HC3 ?

    The latest release 5.102.xx (beta) should accept Zigbee devices.

     

    Once I'll release the new version for Zigbee, will convert Z-wave monitor for HC3

    Link to comment
    Share on other sites

    Guest Benrive
    13 minutes ago, cag014 said:

    What version you have on HC3 ?

    The latest release 5.102.xx (beta) should accept Zigbee devices.

     

    Once I'll release the new version for Zigbee, will convert Z-wave monitor for HC3

     

     5.101.19  

     

    But I have no pending updates?
    Do you know if the Aqara Cube device is supported?

    I want my daughters to hallucinate with it.

    Please login or register to see this attachment.

    16 minutes ago, cag014 said:

    Once I'll release the new version for Zigbee, will convert Z-wave monitor for HC3

    This is great news, for those of us who have some network coverage problems

    Thank's 

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