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


HC3 QuickApps coding - tips and tricks


jgab

Recommended Posts

  • Topic Author
  • You mean this?

     

    Link to comment
    Share on other sites

    40 minutes ago, jgab said:

    Try this.

    Please login or register to see this attachment.

    You can copy main and toolbox from the new QA to your old so you don't have to regenerate ids.

    Let me know if it works better.

    Jan in the HUE app we have a button switch on or off all.

    Can we have that to in the Children of Hue?

    Thanks in advance,

    //Sjakie

    Link to comment
    Share on other sites

  • Topic Author
  • 14 minutes ago, Sjakie said:

    Jan in the HUE app we have a button switch on or off all.

    Can we have that to in the Children of Hue?

    Thanks in advance,

    //Sjakie

    Try this version v.1.17 

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

    1 hour ago, jgab said:

    Try this.

    Please login or register to see this attachment.

    You can copy main and toolbox from the new QA to your old so you don't have to regenerate ids.

    Let me know if it works better.

    Thank you Jan for your work, and prioritizing my request - I will test ASAP and get back here with result

    Edited by ChristianSogaard
    P
    Link to comment
    Share on other sites

    8 minutes ago, ChristianSogaard said:

    Thank you Jan for your work, and prioritizing my request - I will test ASAP and get back here with result

    Hi Jan

    Amazing, I testet for both Zones and groups, and both are working with toggle, and dimm.

    Thank you for working on this - version 1.16 is thumbs up?

     

    Link to comment
    Share on other sites

  • Topic Author
  • 3 minutes ago, ChristianSogaard said:

    can we just update the mail and the toolbox?

    Yes, but you don't get the buttons.

    Add two buttons manually with 'onReleased' fields with 

    'allLightsOnClicked'

    resp.

    'allLightsOffClicked'

    to call the right QuickApp methods.

    • Thanks 1
    Link to comment
    Share on other sites

    4 minutes ago, jgab said:

    Yes, but you don't get the buttons.

    Add two buttons manually with 'onReleased' fields with 

    'allLightsOnClicked'

    resp.

    'allLightsOffClicked'

    to call the right QuickApp methods.

    I see :-)

    image.png.30d6f20347e8fe5374b36441c2e50c41.png

     

    I would actually prefer a Bulp Child Device representing all lights instead of the buttons ;-) but one solution dont excludes the other ? - I think there is a HUE group for all lights???

     

    Link to comment
    Share on other sites

  • Topic Author
  • 1 minute ago, ChristianSogaard said:

    I see :-)

    Please login or register to see this link.

     

    I would actually prefer a Bulp Child Device representing all lights instead of the buttons ;-) but one solution dont excludes the other ? - I think there is a HUE group for all lights???

     

    Yes, next version will generate a 0 group per default. Needs some more coding.

    • Thanks 1
    Link to comment
    Share on other sites

    On 5/24/2020 at 6:36 AM, jgab said:

    I posted this QA in another thread, but I repost here with maybe better explanation.

    It's a really simple QA. 

    Please login or register to see this attachment.

    • It's a QA of type "com.fibaro.binarySensor" (the blue person standing/running)
    • It can be configured to watch other sensors/doors/lights etc.
    • It's breached/on when any of the devices it's watching is breached/on
    • It's safe/off when all the devices it's watching is safe/off
    • Optionally, a delay can be configured that is the time that all devices need to be safe/off before it turns safe/off itself.

    Please login or register to see this attachment.

    In the example we have 4 rooms and 2 floors, and we make 7 copies of the DeviceSensor QA (Q1-Q7).

    We have made 4 DeviceSensor QAs ( Q1,Q2,Q3,Q4), one for each  room, watching 1-3 physical motion sensors each (S1-S8).

    We have med 2 DeviceSensors QAs (Q5,Q6), one for each floor, watching the room sensors.

    We have one DeviceSensor (Q7) covering the whole house by watching the floor sensors.

    All, except the house sensor, has a delay of 60s that their sensors need to be safe until they turn safe. (I would have put the floor delay to 0 too, they add up..)

    (You can divide your house/estate up in any logical divisions, with any number of levels in the hierarchy)

     

    Some use cases:

    • They behave like real binary sensors so we can easily use them in (block) scenes to tell if a room, floor or the whole house have any motion.
    • We can turn on lights in rooms when any sensor/door in room gets breached/opened
    • We can add delays until they become safe, turning off lights when a room, floor, or the whole house been safe for a while. etc.
    • We can create different hierarchies that share devices and DeviceSensor QAs. Ex. We could have a separate hierarchy for windows and doors to check if everything is closed when leaving, and if not on what floor and room....

     

    Very simple QA but quite useful. We could of course have made one QA/Scene that covers everything, but this makes it very flexible usage and allows for simple rewiring of the logic at anytime.

    Each QA is configured with two quickApp variables:

    • "devices" that is a list of device IDs to watch, Ex. "21 214 155"
    • "delay" that is the delay in seconds until the sensors should be considered safe.

    The QA can watch any device where the "value" property turns false/0 when it's safe/off. 

     

    P.S This is a sensor QA. One could do a similar binary switch QA that could a create a hierarchical switch structure allowing us to turn off/on rooms, floor, house...

    This is really Great.?

    A small comment

    The Binary Sensor dont work with the alarm, but you can change the QA to a door/windows sensor instead, and its gets recognized by the native HC3 alarm.

    Amazing work @jgab?

    Please login or register to see this image.

    /monthly_2021_01/image.png.c8d84c20d2fc3bf8cc9ba022ec443353.png" />

    image.png.62ed9bd2f35a87a712b169e682d7abd8.png

     

     

     

     

    Edited by ChristianSogaard
    P
    Link to comment
    Share on other sites

    Jan,

    Excellent!

    I miss all lights in the device list to use it in a rule?

    //Sjakie

    Link to comment
    Share on other sites

    Jan,

    Its looping Children of HUE 

    [14.01.2021] [17:56:57] [WARNING] [QUICKAPP1025]: Trying to update non-existing property - batteryLevel


    //Sjakie

     

    Link to comment
    Share on other sites

    Good morning Jan,

    Restore version 1.14

    [15.01.2021] [07:45:28] [ERROR] [QUICKAPP178]: {"value":"Connection refused","type":"errPoll"}
    [15.01.2021] [07:45:32] [ERROR] [QUICKAPP178]: {"value":"Connection reset by peer","type":"errPoll"}

    //Sjakie

     

     

    Link to comment
    Share on other sites

  • Topic Author
  • 2 hours ago, Sjakie said:

    Good morning Jan,

    Restore version 1.14

    [15.01.2021] [07:45:28] [ERROR] [QUICKAPP178]: {"value":"Connection refused","type":"errPoll"}
    [15.01.2021] [07:45:32] [ERROR] [QUICKAPP178]: {"value":"Connection reset by peer","type":"errPoll"}

    //Sjakie

    That is your Hue Hub that refuses connections from the HC3 QA.

    Do you have multiple clients using the Hue hub?

    11 hours ago, Sjakie said:

    Jan, Also after restart its looping directly!

    It's just a warning and should not cause errors and restart.

    However, it's annoying to have in the log so the next version will fix it.

    Link to comment
    Share on other sites

    Jan,

    HC2 only active for heating all others is stopped.

    HC3 gave every few seconds the warning I wast able to stop it it slow down the HC3. Now its the same speed as before

    Np I am back on older version.

    //Sjakie

    Link to comment
    Share on other sites

    On 1/14/2021 at 11:27 AM, ChristianSogaard said:

    This is really Great.?

    A small comment

    The Binary Sensor dont work with the alarm, but you can change the QA to a door/windows sensor instead, and its gets recognized by the native HC3 alarm.

    Amazing work @jgab?

    Please login or register to see this link.

    Please login or register to see this link.

     

     

     

     

     

    a bit modified @jgab QA:

    - now it's a motion sensor

    - added parameter devicesDW for windows and doors because I want to have different behaviour: generate motion only during opening/closing of windows/doors (for default value: n/a)

     

    Please login or register to see this attachment.

     

    Edited by petrkl12
    • Like 2
    Link to comment
    Share on other sites

    Jan,

    Overview HC3:

    6 QA with 160, 186, 267,4, 106, 240 rules

    35 HUE light bulbs

    Children for HUE

    Open Weather with API calls

    HC2 only heating all other scenes on manual.

     

    Yesterday evening No physical light in bath room according debug fibaro.call light on.

    I joined the last two QA's, check for errors in debug (only one humidity calculation need to  be solved later) and did a restart to start fresh.

    Night, no action of night protocol in the morning also no action and I performed  a restart.

     

    Because previous you mentioned HUE but I am with 35 pieces far below their 50 bulbs.

    During migration HC3 was running without big isues other I shoild stop continuing migration.

    Any tip or hint what to check or what to do?

    Option back to HC2 and scratch HC3?

    Your opinion is very much appriciated,

    //Sjakie

     

     

     

     

    Link to comment
    Share on other sites

    11 hours ago, petrkl12 said:

     

    a bit modified @jgab QA:

    - now it's a motion sensor

    - added parameter devicesDW for windows and doors because I want to have different behaviour: generate motion only during opening/closing of windows/doors (for default value: n/a)

     

    Please login or register to see this attachment.

     

    cool - I actually wanted a motion sensor in the first place, but couldent see how to create it, thank you @petrkl12 & @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...