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

I see all my HUE switches with the LIST button as you descriped - like..

Sensor id:53, name:Living room switch, type:ZLLSwitch

 

None of my zdb5100 switches is showed with the List button

They are not HUE switches, it navtive zvave switches - very cool ones though

 

Type is for sure - com.fibaro.remoteController

I dont know where to see the "Class" - perhaps its listed in the documentation.

Perhaps 

  • Generic Device Class Wall Controller
  • Specific Device Class Basic Wall Controller

Please login or register to see this link.

 

Link to comment
Share on other sites

  • Topic Author
  • Ok, sorry I thought it was a Hue device.

    The ZBS5100 is a standard Z-wave device so it should appear as a (or several) devices when you include it to the HC3. Doesn't it?

     

    With a block scene you should be able to connect the "Press" and "Hold" etc to actions on other devices like lights (or the Hue devices from my ChildrenOfHue)

     

    I do have a ZBS5400 at home that I'm playing with, that I think is similar to the 5100 - It works well as a remotecontrol/switch but I'm trying to come up with if there are some added functionality a separate QA could provide. You have ideas?

    Link to comment
    Share on other sites

    On 10/21/2020 at 1:06 PM, jgab said:

     

     

    Ok, I have "modernised" the

    Please login or register to see this link.

    The original idea was that the QA would emit custom event with names from the the calendar event title or special tags in the description. That way one could make block scenes that reacted to calendar events. However, due to how custom-events work, it's not a great idea as custom-events can "overwrite" themselves as they need to be predefined before we can emit them...

    Anyway, besides custom-events, the new QA publish the event at start and end of the calendar event - using the QA_toolbox pubs mechanism. ER4 scenes can subscribe to pubsub events.

    Please login or register to see this code.

    These rules subscribe to 'iCAL' events and then a rule that logs start events.

    The QA publish an event when the it starts and when it terminates. The 'status' key is either 'start' or 'end' depending on.

     

    The full event have this structure:

    Please login or register to see this code.

    endDate and startDate is unix.time for the start and end of the. event.

    You could match on the title or the. descr field to trigger actions in various ways...

     

    Hi @jgab,

     

    Can you help me? How can I add the timezone correction?

    I am In the GMTS+1.

     

    Please login or register to see this attachment.

    Edited by SmartLifeSystems
    Link to comment
    Share on other sites

    For sure

     

    I think the zdb5100 gives 10 devices per module.

     

    Mapping in the QA

    - switch XX1 uses HUE Light YY1

    - switch XX2 uses HUE Light YY2

     

    So I dont have to use one unique Scene per time i need to MAP a Switch switch to a light

     

    Functionality in the switch like...

    1 klik - turn on/off light - Turn On same level when it was set to as off.

    Double Klik - turn on 100%

    Tripple Klik -  Set NEXT HUE SCENE 

     

    Link to comment
    Share on other sites

    47 minutes ago, jgab said:

    Ok, sorry I thought it was a Hue device.

    The ZBS5100 is a standard Z-wave device so it should appear as a (or several) devices when you include it to the HC3. Doesn't it?

     

    With a block scene you should be able to connect the "Press" and "Hold" etc to actions on other devices like lights (or the Hue devices from my ChildrenOfHue)

     

    I do have a ZBS5400 at home that I'm playing with, that I think is similar to the 5100 - It works well as a remotecontrol/switch but I'm trying to come up with if there are some added functionality a separate QA could provide. You have ideas?

    For sure

     

    I think the zdb5100 gives 10 devices per module.

     

    Mapping in the QA

    - switch XX1 uses HUE Light YY1

    - switch XX2 uses HUE Light YY2

     

    So I dont have to use one unique Scene per time i need to MAP a Switch switch to a light

     

    Functionality in the switch like...

    1 klik - turn on/off light - Turn On same level when it was set to as off.

    Double Klik - turn on 100%

    Tripple Klik -  Set NEXT HUE SCENE 

    Link to comment
    Share on other sites

  • Topic Author
  • 19 minutes ago, SmartLifeSystems said:

     

    Hi @jgab,

     

    Can you help me? How can I add the timezone correction?

    I am In the GMTS+1.

     

    Please login or register to see this attachment.

    Well, it's tricky as different calendar uses different ways to express timezones.

    The current version (v0.9) that I just uploaded has a slider to adjust the timezone with +/- hours. Adjust it so the entries displayed show the right start time.

     

    Link to comment
    Share on other sites

  • Topic Author
  • 4 minutes ago, ChristianSogaard said:

    For sure

     

    I think the zdb5100 gives 10 devices per module.

     

    Mapping in the QA

    - switch XX1 uses HUE Light YY1

    - switch XX2 uses HUE Light YY2

     

    So I dont have to use one unique Scene per time i need to MAP a Switch switch to a light

     

    Functionality in the switch like...

    1 klik - turn on/off light - Turn On same level when it was set to as off.

    Double Klik - turn on 100%

    Tripple Klik -  Set NEXT HUE SCENE 

     

    In a block scene you can add the "Hold" attribute of a Matrix button to the startLevelIncrease command of the light. and stopLevelChange to the "Released". The new ChildrenOfHue supports startLevelIncrease,stopLevelChange, and startLevelDecrease for lights.

     

    What menas "SET NEXT SCENE" for the tripple click you mentioned?

     

    I have tried the Matrix with the ER4 rule QA that I have to make it glow with different colors and strength depending on time of day - can also assign different functions depending on day. Could be confusing unless colors are connected to functions.

    One could also imagine assigning functions to clicks on two buttons. Ex. if btn1 and btn2 is pressed within 2 seconds run a specific function. That way one would have 3*4 = 12 combinations... and one could further extend it with double and tripple clicks but it gets hard to remember.

    Also thinking of using the color pattern 2x2 on the device to show various kind of alerts/notifications.

    And it could be used as a keypad to enter a combination to disable the alarm.... 

    Link to comment
    Share on other sites

    50 minutes ago, jgab said:

    Well, it's tricky as different calendar uses different ways to express timezones.

    The current version (v0.9) that I just uploaded has a slider to adjust the timezone with +/- hours. Adjust it so the entries displayed show the right start time.

     

     

    Nice! Thank you!

    Link to comment
    Share on other sites

    20 minutes ago, jgab said:

     

    In a block scene you can add the "Hold" attribute of a Matrix button to the startLevelIncrease command of the light. and stopLevelChange to the "Released". The new ChildrenOfHue supports startLevelIncrease,stopLevelChange, and startLevelDecrease for lights.

     

    What menas "SET NEXT SCENE" for the tripple click you mentioned?

     

    I have tried the Matrix with the ER4 rule QA that I have to make it glow with different colors and strength depending on time of day - can also assign different functions depending on day. Could be confusing unless colors are connected to functions.

    One could also imagine assigning functions to clicks on two buttons. Ex. if btn1 and btn2 is pressed within 2 seconds run a specific function. That way one would have 3*4 = 12 combinations... and one could further extend it with double and tripple clicks but it gets hard to remember.

    Also thinking of using the color pattern 2x2 on the device to show various kind of alerts/notifications.

    And it could be used as a keypad to enter a combination to disable the alarm.... 

    The DIMMER function is really important to me -

    So as long you HOLD the button  - it DIMMS until "released" is detected. So I will for sure look into the startLevelIncrease you 

     

    What menas "SET NEXT SCENE" for the tripple click you mentioned?

     

    I mean SET NEXT COLOR - like switch between red, blue, green ...  ( my daughter uses this ;-)

     

    I dont think I can use Block diagram for this because its "pressed" and "released" is in the centralSceneEvent.

    I need attached code/ picture to use startLevelIncrease,stopLevelChange, and startLevelDecrease to support (HOLD the button  - it DIMMS until "released" is detected)

    Please login or register to see this attachment.

     

    Link to comment
    Share on other sites

  • Topic Author
  • 52 minutes ago, ChristianSogaard said:

     

     

    Please login or register to see this attachment.

     

    The 1394.0 is a Matrix button.

    The problem is of course that I need 2 blocks scenes. One for Hold and one for Released, And then another 2 for the dim down.

     

    In your Lua scene you can do

    Condition:

    Please login or register to see this code.

     

    and in the action part you could do something like:

    Please login or register to see this code.

     

     
     
    Edited by jgab
    • Like 1
    Link to comment
    Share on other sites

    11 minutes ago, jgab said:

     

    Please login or register to see this attachment.

     

    The 1394.0 is a Matrix button.

    The problem is of course that I need 2 blocks scenes. One for Hold and one for Released, And then another 2 for the dim down.

     

    In your Lua scene you can do

    Condition:

    Please login or register to see this code.

     

    and in the action part you could do something like:

    Please login or register to see this code.

     
     

     

    I so much need to get home from work so i can work with this 

    Can I use the Key Map in same rutine for?

    1 klik - turn on/off light - Turn On same level when it was set to as off.

    Double Klik - turn on 100%

    (Tripple Klik -  Set NEXT HUE COLOR) Nice to have

     

     

    Link to comment
    Share on other sites

  • Topic Author
  • 1 minute ago, ChristianSogaard said:

     

    I so much need to get home from work so i can work with this 

    Can I use the Key Map in same rutine for?

    1 klik - turn on/off light - Turn On same level when it was set to as off.

    Double Klik - turn on 100%

    (Tripple Klik -  Set NEXT HUE COLOR) Nice to have

     

     

    I made a change the previous post that allow to assign function+arguments to the different keyAttributes. If it works for next color I don't know but 100% for Pressed2 should work.

     

    ...but there should be ways to handle it.

    Link to comment
    Share on other sites

    2 hours ago, jgab said:

    I made a change the previous post that allow to assign function+arguments to the different keyAttributes. If it works for next color I don't know but 100% for Pressed2 should work.

     

    ...but there should be ways to handle it.

    I Home :-) trying to implement Children og HUE with Matrix

     

    No Success Yet.

     

    MY Scene ID is 119182383769_02SceneID.jpg.238ff05f5dd9e4cbc8932aff74e3f409.jpg

     

    Children of HUE is version 1.1 and its connected

    312075291_03ChildrenofHUE11.jpg.421667e35182f5a6e28a0b85151c589e.jpg

     

    The Code and My Matrix is 666 

    Please login or register to see this attachment.

     

    My Children of Hue Bulb ID is 687

     

    1567308800_06ChildrenID.jpg.d6c9638673b04a3582e6b3a8b37a0541.jpg

     

    My history should document data is transfered.

    Please login or register to see this attachment.

     

    The is NO reaction to the Bulb at all.

     

    Manual Bulb Control works

    image.png.dd4faec3d269a4da58d031421c1b8f8c.png 

     

    Any Idea ?

     

     

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

  • Topic Author
  • before fibaro.call(keyMap....

    add

    fibaro.debug(tag,"Calling ",keyMap[key.keyId].deviceID," Params:",json.encode(params))

    so we can make sure it tries to call the Hue device.

    What type id the 687? is it a com.fibaro.multilevelSwitch?

     

    I will check the HueDevice code later this evening to see if I can find anything strange there.

    Link to comment
    Share on other sites

    4 minutes ago, jgab said:

    before fibaro.call(keyMap....

    add

    fibaro.debug(tag,"Calling ",keyMap[key.keyId].deviceID," Params:",json.encode(params))

    so we can make sure it tries to call the Hue device.

    What type id the 687? is it a com.fibaro.multilevelSwitch?

     

    I will check the HueDevice code later this evening to see if I can find anything strange there.

    [09.11.2020] [17:02:34] [DEBUG] [SCENE119]: KeyId: 1 KeyAttr: Pressed
    [09.11.2020] [17:02:34] [DEBUG] [SCENE119]: Calling 687 Params: ["toggle"]

    687 is a  Multilevel switch

    Link to comment
    Share on other sites

    5 minutes ago, ChristianSogaard said:

    [09.11.2020] [17:02:34] [DEBUG] [SCENE119]: KeyId: 1 KeyAttr: Pressed
    [09.11.2020] [17:02:34] [DEBUG] [SCENE119]: Calling 687 Params: ["toggle"]

    687 is a  Multilevel switch

    I tried with another bulb - a com.fibaro.philipsHueLight, and that is working

    Link to comment
    Share on other sites

  • Topic Author
  • 16 minutes ago, ChristianSogaard said:

    I tried with another bulb - a com.fibaro.philipsHueLight, and that is working

    Yep, had a bug in white dimmable light.

    New version v1.3 here

     

    • Like 1
    Link to comment
    Share on other sites

    3 hours ago, jgab said:

    I made a change the previous post that allow to assign function+arguments to the different keyAttributes. If it works for next color I don't know but 100% for Pressed2 should work.

     

    ...but there should be ways to handle it.

    Amazing work ???

    Is there something i can adjust on so i can control how long time it takes to Dim from 100 to 0 and the other way

    Now it takes less than a sec to go from 100 to 0 - but 10 sec to go from 0 to 100 ?

    Link to comment
    Share on other sites

    29 minutes ago, jgab said:

    Yep, had a bug in white dimmable light.

    New version v1.3 here

     

    want to check .-) You posted the Main LUA code and not the Quick APP. Can i just overwrite the main LUA - and thats it?

    Link to comment
    Share on other sites

  • Topic Author
  • 1 minute ago, ChristianSogaard said:

    want to check .-) You posted the Main LUA code and not the Quick APP. Can i just overwrite the main LUA - and thats it?

    Yes, you can replace the main code in. your existing QA so you don't need to regenerate the child devices...

     

    I will look into the dimming issue, should be able to provide a quickVar variable to control the interval.

     

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