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

8 hours ago, cag014 said:

I'm using local variables

global4local= {true,gVarName="localTank",varArray={acInd="init:0",iDoor="init:0",rclr=0,gclr=0,bclr=0}}

Setting variables where is needed and using setColor command

"setColor,&rclr,&gclr,&bclr,0"

 

By the way have RGBW device which changes random color every hour (just for fun) like that

"setColor,?random(10,255)?,?random(10,255)?,?random(10,255)?,0"

TNX @cag014, nice solution.

8 hours ago, cag014 said:

By the way have RGBW device which changes random color every hour (just for fun) like that

"setColor,?random(10,255)?,?random(10,255)?,?random(10,255)?,0"

Funny application ?

Link to comment
Share on other sites

Hi cag,

 

I have a question for you.

I have a Fibaro Single Switch, and I want to use the This Year energy data in a global varriable. How can I do this?

 

What is the code, what I need?

 

Thanks!

Please login or register to see this attachment.

Edited by SmartLifeSystems
Link to comment
Share on other sites

13 hours ago, Rover said:

Yes, setColor works. I have used that already for a long time. And it also in the action set of RGBW 2.

But I want also set a color (red, green, blue, white) without changing the existing values of the other colors. Therefor is setB, setG, etc.

So the question is: how to change one color, leaving the other colors untouched, using setColor?

I have found that {"`BlueIn`",{trigAll=true, trigAct={{"`Blue`", "setValue,255"},{"`Blue`", "setValue,0","30"}}, }}, has the desired behaviour of setB.

  • Like 1
Link to comment
Share on other sites

  • Topic Author
  • 11 hours ago, Rover said:

    I have found that {"`BlueIn`",{trigAll=true, trigAct={{"`Blue`", "setValue,255"},{"`Blue`", "setValue,0","30"}}, }}, has the desired behaviour of setB.

    Good to know...

    14 hours ago, SmartLifeSystems said:

    Hi cag,

     

    I have a question for you.

    I have a Fibaro Single Switch, and I want to use the This Year energy data in a global varriable. How can I do this?

     

    What is the code, what I need?

     

    Thanks!

    Please login or register to see this attachment.

    Currently I'm on business trip...  will check that on Sunday..

    Link to comment
    Share on other sites

    Hi @cag014,

    Hoping you returned well from your business trip.

    Simple question: I want to set a Smart Implant out relais in the status On from start of AOQ. How to implement this with initAct or otherwise?

    Link to comment
    Share on other sites

  • Topic Author
  • 2 hours ago, Rover said:

    Hi @cag014,

    Hoping you returned well from your business trip.

    Simple question: I want to set a Smart Implant out relais in the status On from start of AOQ. How to implement this with initAct or otherwise?

    Yes, set initAct={....} and every time you start AOQ this command will be executed.

    Link to comment
    Share on other sites

    11 hours ago, cag014 said:

    Yes, set initAct={....} and every time you start AOQ this command will be executed.

    How does the complete jM line with initAct in it looks like?

    Link to comment
    Share on other sites

  • Topic Author
  • 5 hours ago, Rover said:

    How does the complete jM line with initAct in it looks like?

    The initAct={} has same format as trueAct={} or any other action.

    Since you probably don't have any specific device to set the jM line, so use $blank keyword

    {"$blank",{state="whatever", iniAct={"`sImplant`","<set relay command>"}}},

     

    • Thanks 1
    Link to comment
    Share on other sites

  • Topic Author
  • On 11/11/2021 at 9:58 PM, SmartLifeSystems said:

    Hi cag,

     

    I have a question for you.

    I have a Fibaro Single Switch, and I want to use the This Year energy data in a global varriable. How can I do this?

     

    What is the code, what I need?

     

    Thanks!

    Please login or register to see this attachment.

    OK here is the api command for device ID 83

    Please login or register to see this link.

    here is the response

    Please login or register to see this code.

     

    Just use your device ID and get the data you need from response and save in global variable. You need to create QA for that and to call it from AOQ.

    Another idea is to use

    Please login or register to see this link.

    in parallel to AOQ and you can write your own function as part of the

    Please login or register to see this link.

    code.

    Edited by cag014
    Link to comment
    Share on other sites

    8 hours ago, cag014 said:

    The initAct={} has same format as trueAct={} or any other action.

    Since you probably don't have any specific device to set the jM line, so use $blank keyword

    {"$blank",{state="whatever", iniAct={"`sImplant`","<set relay command>"}}},

     

    TNX @cag014, that is what I needed. Something to add in the guide?

    Link to comment
    Share on other sites

  • Topic Author
  • Just now, Rover said:

    TNX @cag014, that is what I needed. Something to add in the guide?

    OK.

    please pay attention it should be initAct ={} (my bad)

    Link to comment
    Share on other sites

  • Topic Author
  • @Rover

    Have used your AOQ "advertising", hope that's OK by you

     

    Link to comment
    Share on other sites

    3 hours ago, cag014 said:

    Have used your AOQ "advertising", hope that's OK by you

    Of course @cag014, AOQ cannot get enough advertising. ?

    Link to comment
    Share on other sites

    On 11/15/2021 at 2:36 PM, cag014 said:

    OK here is the api command for device ID 83

    Please login or register to see this link.

    here is the response

    Please login or register to see this code.

     

    Just use your device ID and get the data you need from response and save in global variable. You need to create QA for that and to call it from AOQ.

    Another idea is to use

    Please login or register to see this link.

    in parallel to AOQ and you can write your own function as part of the

    Please login or register to see this link.

    code.

     

     

    Hi cag,

     

    Thanks your answer, but how can I make this QA. I know the API address, but I can't make the QA programming. Can you help me?

    Link to comment
    Share on other sites

  • Topic Author
  • 22 hours ago, SmartLifeSystems said:

     

     

    Hi cag,

     

    Thanks your answer, but how can I make this QA. I know the API address, but I can't make the QA programming. Can you help me?

    Please let me know what parameter exactly you need to save as a global? (pls provide global name also)

    In addition what exactly you want to do in AOQ?

    Edited by cag014
    Link to comment
    Share on other sites

    6 hours ago, cag014 said:

    Please let me know what parameter exactly you need to save as a global? (pls provide global name also)

    In addition what exactly you want to do in AOQ?

     

    Hi,

     

    I would like to get the energy consumption data from the device and save as a global variable.

     

    The global variables name:

     

    - TodayEnergy

    - ThisWeekEnergy

    - ThisMonthEnergy

    - ThisYearEnergy

     

    Thank you very much!

    Link to comment
    Share on other sites

  • Topic Author
  • 4 hours ago, SmartLifeSystems said:

     

    Hi,

     

    I would like to get the energy consumption data from the device and save as a global variable.

     

    The global variables name:

     

    - TodayEnergy

    - ThisWeekEnergy

    - ThisMonthEnergy

    - ThisYearEnergy

     

    Thank you very much!

    DO you need that for one device only? Otherwise it might be a good idea to add device ID to variable name, like:

    TodayEneregy483 and etc.

    Another question - are you looking current or total energy? 

    I can create QA where you pass parameters : current or total and device ID. Is it good enough for you?

    Edited by cag014
    Link to comment
    Share on other sites

  • Topic Author
  • 7 hours ago, SmartLifeSystems said:

     

    Hi,

     

    I would like to get the energy consumption data from the device and save as a global variable.

     

    The global variables name:

     

    - TodayEnergy

    - ThisWeekEnergy

    - ThisMonthEnergy

    - ThisYearEnergy

     

    Thank you very much!

    OK, here is the first try...

    Create standard global variables as defined by you.

     -TodayEnergy

    - ThisWeekEnergy

    - ThisMonthEnergy

    - ThisYearEnergy

    download attached QA.

    At function QuickApp:onInit()

    Change variable devId to your device ID. (currently defined 83)

    devId=83
     

    Currently the QA updates the data every 15 minutes. To change that set wanted time interval in mSec. at following line:

    setInterval(function() self:getData(devId) end,   900000)
     
    Please ignore data in Advance tab, it always will be zero.
    The real data displayed on device UI as labels. There are two buttons (current and total) work same as at advance tab.

    Please login or register to see this spoiler.

     

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

    7 hours ago, cag014 said:

    Oké, itt az első próbálkozás...

    Hozzon létre szabványos globális változókat az Ön által meghatározottak szerint.

     -TodayEnergy

    - ThisWeekEnergy

    - This MonthEnergy

    - ThisYearEnergy

    töltse le a mellékelt minőségbiztosítást.

    QuickApp:onInit() függvénynél

    Módosítsa a devId változót az eszközazonosítóra. (jelenleg definiált 83)

    devId= 83
     

    Jelenleg a QA 15 percenként frissíti az adatokat. A kívánt időintervallum msec-ben történő módosításához. a következő sorban:

    setInterval( függvény () self:getData(devId)  end ,    900000 )
     
    Kérjük, hagyja figyelmen kívül az Advance lapon lévő adatokat, mert mindig nulla lesz.
    Az eszköz felhasználói felületén címkékként megjelenített valós adatok. Két gomb (aktuális és teljes) ugyanúgy működik, mint az előzetes lapon.

    Please login or register to see this spoiler.

     

     

    Ohhh I'am very happy! Working fine! Thank you very much!!!!

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