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
  • 8 minutes ago, ChristianSogaard said:

    No - getting this

    [11.11.2020] [14:21:01] [DEBUG] [QUICKAPP812]: Can't install groups:20-Skrivebord

    .

    .

    [11.11.2020] [14:21:02] [DEBUG] [QUICKAPP812]: Can't install groups:24-Spisebord

     

    From the List UI

    [11.11.2020] [14:22:53] [DEBUG] [QUICKAPP812]: Group id:20, name:Skrivebord, type:Zone
    [11.11.2020] [14:22:53] [DEBUG] [QUICKAPP812]: Group id:13, name:Viktualierum, type:Room
    [11.11.2020] [14:22:53] [DEBUG] [QUICKAPP812]: Group id:22, name:Arbejdsværelse, type:Room
    [11.11.2020] [14:22:53] [DEBUG] [QUICKAPP812]: Group id:25, name:Test, type:Room
    [11.11.2020] [14:22:53] [DEBUG] [QUICKAPP812]: Group id:24, name:Spisebord, type:Zone

    Can you try 1.9 that I uploaded. I found out how to do a zone (never noticed that option before in the Hue app) and I managed to install my new Zone.

    • Like 1
    Link to comment
    Share on other sites

    5 minutes ago, jgab said:

    Can you try 1.9 that I uploaded. I found out how to do a zone (never noticed that option before in the Hue app) and I managed to install my new Zone.

    Zones installed Successfully as groups

    • Installed groups:20-Skrivebord
    • Installed groups:24-Spisebord

     

    ? I'll test later when I home if its actually turns on the light - but I would expect that - Zones is like having a group in a group. Nice Feature ;-)

    Link to comment
    Share on other sites

    3 hours ago, jgab said:

    Can you try 1.9 that I uploaded. I found out how to do a zone (never noticed that option before in the Hue app) and I managed to install my new Zone.

    I Uploaded ver 1.9 - redeployed all Bulbs "toggle" is working for Bulbs in my office - 

    Dimming dont work at all 

     

    [11.11.2020] [15:58:42] [DEBUG] [SCENE119]: Calling 904 Params: ["stopLevelChange"]
    [11.11.2020] [15:58:59] [DEBUG] [SCENE119]: KeyId: 1 KeyAttr: HeldDown
    [11.11.2020] [15:58:59] [DEBUG] [SCENE119]: Calling 883 Params: ["startLevelIncrease"]
    [11.11.2020] [15:59:02] [DEBUG] [SCENE119]: KeyId: 1 KeyAttr: Released
    [11.11.2020] [15:59:02] [DEBUG] [SCENE119]: Calling 883 Params: ["stopLevelChange"]
    [11.11.2020] [15:59:05] [DEBUG] [SCENE119]: KeyId: 2 KeyAttr: HeldDown
    [11.11.2020] [15:59:05] [DEBUG] [SCENE119]: Calling 904 Params: ["startLevelIncrease"]
    [11.11.2020] [15:59:08] [DEBUG] [SCENE119]: KeyId: 2 KeyAttr: Released
    [11.11.2020] [15:59:08] [DEBUG] [SCENE119]: Calling 904 Params: ["stopLevelChange"]
    [11.11.2020] [15:59:09] [DEBUG] [SCENE119]: KeyId: 2 KeyAttr: Pressed2
    [11.11.2020] [15:59:09] [DEBUG] [SCENE119]: Calling 904 Params: ["setValue",99]
    [11.11.2020] [15:59:14] [DEBUG] [SCENE119]: KeyId: 2 KeyAttr: Pressed
    [11.11.2020] [15:59:14] [DEBUG] [SCENE119]: Calling 904 Params: ["toggle"]
    [11.11.2020] [15:59:16] [DEBUG] [SCENE119]: KeyId: 2 KeyAttr: Pressed
    [11.11.2020] [15:59:16] [DEBUG] [SCENE119]: Calling 904 Params: ["toggle"]

     

    Using this

    Please login or register to see this code.

     

    Edited by ChristianSogaard
    Link to comment
    Share on other sites

  • Topic Author
  • I see that you have a short time between hold down and release - are you sure you have time to see the dimming effect. Hold it down for 10s and see if you notice.

    Please login or register to see this code.

     

    The toggle is strange as I have no problem with any of my devices (toggle is just alternating turnOn/turnOff)

    If you look at the QA log - do you see "onAction toggle <child deviceID>"   when you press the toggle button?

    Link to comment
    Share on other sites

    11 minutes ago, jgab said:

    I see that you have a short time between hold down and release - are you sure you have time to see the dimming effect. Hold it down for 10s and see if you notice.

    Please login or register to see this code.

     

    The toggle is strange as I have no problem with any of my devices (toggle is just alternating turnOn/turnOff)

    If you look at the QA log - do you see "onAction toggle <child deviceID>"   when you press the toggle button?

    I'm sorry - Toggel IS WORKING - for all Bulbs. I change my text twice and didn't check the meaning before submit??

     

    What i tried to say - Dimming is NOT work for any bulbs

    Here trying for 10 Sec

    [11.11.2020] [17:26:54] [DEBUG] [SCENE119]: KeyId: 2 KeyAttr: HeldDown
    [11.11.2020] [17:26:54] [DEBUG] [SCENE119]: Calling 904 Params: ["startLevelIncrease"]
    [11.11.2020] [17:27:03] [DEBUG] [SCENE119]: KeyId: 2 KeyAttr: Released
    [11.11.2020] [17:27:03] [DEBUG] [SCENE119]: Calling 904 Params: ["stopLevelChange"]

    Link to comment
    Share on other sites

    6 minutes ago, ChristianSogaard said:

    I'm sorry - Toggel IS WORKING - for all Bulbs. I change my text twice and didn't check the meaning before submit??

     

    What i tried to say - Dimming is NOT work for any bulbs

    Here trying for 10 Sec

    [11.11.2020] [17:26:54] [DEBUG] [SCENE119]: KeyId: 2 KeyAttr: HeldDown
    [11.11.2020] [17:26:54] [DEBUG] [SCENE119]: Calling 904 Params: ["startLevelIncrease"]
    [11.11.2020] [17:27:03] [DEBUG] [SCENE119]: KeyId: 2 KeyAttr: Released
    [11.11.2020] [17:27:03] [DEBUG] [SCENE119]: Calling 904 Params: ["stopLevelChange"]

    To precise the Dimming Behavior

    if a Bulb is turned ON - holding for 10 sec - Nothing Happens

    if a Bulb is turned OFF - holding for 10 sec - Light turns ON 100% efter 2-3 sec, No dimming 

     

     

    Link to comment
    Share on other sites

    2 hours ago, ChristianSogaard said:

    To precise the Dimming Behavior

    if a Bulb is turned ON - holding for 10 sec - Nothing Happens

    if a Bulb is turned OFF - holding for 10 sec - Light turns ON 100% efter 2-3 sec, No dimming 

     

     

    Is there anything I can do to make it easier for you to debug? - or if its my setup that is f.... up. Where to start? - Should I try setting up a new HUE GW in parallel with a few bulbs ?

     

    Link to comment
    Share on other sites

  • Topic Author
  • 14 hours ago, ChristianSogaard said:

    Is there anything I can do to make it easier for you to debug? - or if its my setup that is f.... up. Where to start? - Should I try setting up a new HUE GW in parallel with a few bulbs ?

     

    When dimming up and the bulb is turned off it starts by turning on the light and then starts to dim

    When dimming down and the light is already off, nothing is done. So it needs to be ON to dim down.

     

    Somehow your bulbs don't like the dim command. I send a set brightness to the Hue bridge (bri=X)  for the lamp and set the transition time to the time it should take to reach that brightness level. The bridge is then expected to handle the "dimming". It works for all my lamps Extended, temperature, and white dimming light - and it's really smooth.

    To stop the dimming a bri_inc=0 is sent to the bridge that stops any transition.

     

    So, is it correct that it's only your color temperature lights that don't work?

    Can it be that they are of a version that doesn't support brightness transition commands?

    If so, I could make a version (the code is already there) that dim the old way by setting new brightness values in a loop. It's not as smooth but it will work.

    Edited by jgab
    Link to comment
    Share on other sites

    3 hours ago, jgab said:

    When dimming up and the bulb is turned off it starts by turning on the light and then starts to dim

    When dimming down and the light is already off, nothing is done. So it needs to be ON to dim down.

     

    Somehow your bulbs don't like the dim command. I send a set brightness to the Hue bridge (bri=X)  for the lamp and set the transition time to the time it should take to dim. The bridge is then expected to handle the dimming. It works for all my lamps Extended, temperature, and white dimming light - and it's really smooth.

    To stop the dimming a bri_inc=0 is sent to the bridge that stops any transition.

     

    So, is it correct that it's only your color temperature lights that don't work?

    Can it be that they are of a version that doesn't support brightness transition commands?

    If so, I could make a version (the code is already there) that dim the old way by setting new brightness values in a loop. It's not as smooth but it will work.

     

    So I tried structure my testing.

    Dim dont work - I saw dim was working "non linear" before introduction the dimstep variable.

    In V1.9 - i cant get it working at all.

     

    The LWB006 Bulb is really buggy, i can just replace it. Dim and double klik is more important imo?.

     

     

    Please login or register to see this image.

    /monthly_2020_11/image.png.fa3e565783a437a07a4b2d60a3904b50.png" />

     

    Edited by ChristianSogaard
    Link to comment
    Share on other sites

    1 hour ago, ChristianSogaard said:

     

    So I tried structure my testing.

    Dim dont work - I saw dim was working "non linear" before introduction the dimstep variable.

    In V1.9 - i cant get it working at all.

     

    The LWB006 Bulb is really buggy, i can just replace it. Dim and double klik is more important imo?.

     

     

    Please login or register to see this link.

     

     

    I went down and bought a second Hue Starter Kit - and installed a second ChildrenOfHue Ver1.9 instance connected to the new gateway with One bulb connected - (ambiance and Color) com.fibaro.philipsHueLight / LCT015

    Please login or register to see this image.

    /monthly_2020_11/image.png.4370681f9cd65f73fca91f1a850c7587.png" />

    Ready for some more testing :-) 

    For new Gateway with one Bulb - (ambiance and Color) com.fibaro.philipsHueLight / LCT015

    • DoubleClick Dont work. 
    • Dim Dont work
    • Toggle works fine

     

     

    Link to comment
    Share on other sites

  • Topic Author
  • 4 hours ago, ChristianSogaard said:

     

    Please login or register to see this link.

     

     

    Ok, lets debug.

     

    Create a scene with this code. Uncomment one test at the time and note the debug out and how the lamps behaves.

     

    Please login or register to see this code.

     

    You could maybe trigger the scene with some button so you can be in the room where the bulb is located?
     

    Edit: update with you new bulb IDs

    Edited by jgab
    Added setValue 99 and 25 to test the setValue function
    Link to comment
    Share on other sites

  • Topic Author
  • 12 minutes ago, ChristianSogaard said:

     

    I went down and bought a second Hue Starter Kit - and installed a second ChildrenOfHue Ver1.9 instance connected to the new gateway with One bulb connected - (ambiance and Color) com.fibaro.philipsHueLight / LCT015

    Please login or register to see this link.

    Ready for some more testing :-) 

    For new Gateway with one Bulb - (ambiance and Color) com.fibaro.philipsHueLight / LCT015

    • DoubleClick Dont work. 
    • Dim Dont work
    • Toggle works fine

     

    The LCT015 is a "Extended color light" - I have 8 of these and they have always worked for me.

    I suspect the double-click is from the scene? and it should set the brightness to max? It could be something with the scene.

    Dim maybe also something with the scene... Try the test scene and see how the light reacts to the different commands sent to the QA/child device.

    Link to comment
    Share on other sites

  • Topic Author
  • 38 minutes ago, jgab said:

     

    Ok, lets debug.

    Edit: update with you new bulb IDs

     

    Oh, and the dim step variable is gone now and replaced with 'dimtime'.

    It's the time in seconds for a full dim sequence from 0 to max or reversed. Default is 10

     

     

    Link to comment
    Share on other sites

    2 hours ago, jgab said:

     

    Ok, lets debug.

     

    Create a scene with this code. Uncomment one test at the time and note the debug out and how the lamps behaves.

     

    Please login or register to see this code.

     

    You could maybe trigger the scene with some button so you can be in the room where the bulb is located?
     

    Edit: update with you new bulb IDs

     

    I started testing - Are this error expected ` because the test stops here on fist Bulb

    Will fill in results in a MAtrix - just want to be sure that "bad argument" is ok?

     

    [12.11.2020] [15:20:24] [DEBUG] [SCENE121]: Testing device 923
    [12.11.2020] [15:20:24] [DEBUG] [SCENE121]: Turning off device
    [12.11.2020] [15:20:25] [DEBUG] [QUICKAPP920]: onAction: {"actionName":"turnOff","args":[],"deviceId":923}
    [12.11.2020] [15:20:25] [DEBUG] [QUICKAPP920]: URL:/lights/3/state
    [12.11.2020] [15:20:28] [DEBUG] [SCENE121]: Toggle, should turn on
    [12.11.2020] [15:20:28] [DEBUG] [QUICKAPP920]: onAction: {"actionName":"toggle","args":[],"deviceId":923}
    [12.11.2020] [15:20:28] [DEBUG] [QUICKAPP920]: URL:/lights/3/state
    [12.11.2020] [15:20:31] [ERROR] [SCENE121]: (load):1: bad argument #2 to 'format' (no value)

     

    Edited by ChristianSogaard
    Link to comment
    Share on other sites

  • Topic Author
  • 2 hours ago, jgab said:

     

    Ok, lets debug.

     

    Create a scene with this code. Uncomment one test at the time and note the debug out and how the lamps behaves.

     

    Please login or register to see this code.

     

    You could maybe trigger the scene with some button so you can be in the room where the bulb is located?
     

    Edit: update with you new bulb IDs

     

    3 minutes ago, ChristianSogaard said:

     

    I started testing - Are this error expected ` because the test stops here on fist Bulb

    Will fill in results in a MAtrix - just want to be sure that "bad argument" is ok?

     

    [12.11.2020] [15:20:24] [DEBUG] [SCENE121]: Testing device 923
    [12.11.2020] [15:20:24] [DEBUG] [SCENE121]: Turning off device
    [12.11.2020] [15:20:25] [DEBUG] [QUICKAPP920]: onAction: {"actionName":"turnOff","args":[],"deviceId":923}
    [12.11.2020] [15:20:25] [DEBUG] [QUICKAPP920]: URL:/lights/3/state
    [12.11.2020] [15:20:28] [DEBUG] [SCENE121]: Toggle, should turn on
    [12.11.2020] [15:20:28] [DEBUG] [QUICKAPP920]: onAction: {"actionName":"toggle","args":[],"deviceId":923}
    [12.11.2020] [15:20:28] [DEBUG] [QUICKAPP920]: URL:/lights/3/state
    [12.11.2020] [15:20:31] [ERROR] [SCENE121]: (load):1: bad argument #2 to 'format' (no value)

     

     

    Sorry, into the  printf statements there are some strings with like "...... 50%". It needs to be ".... 50%%"

    I will edit the code example...

    Link to comment
    Share on other sites

    16 minutes ago, jgab said:

     

     

    Sorry, into the  printf statements there are some strings with like "...... 50%". It needs to be ".... 50%%"

    I will edit the code example...

    Please login or register to see this image.

    /monthly_2020_11/image.png.3d9af3d3a5b669e0e0f20c393a1670aa.png" />

    Link to comment
    Share on other sites

  • Topic Author
  • 8 minutes ago, ChristianSogaard said:

    Please login or register to see this link.

     

    I'm not so good at scenes..., there is a "bug" in scenes which prevents table from being sent as arguments in fibaro.call...

    Can you change the last fibaro.call to use json.encode on it's table argument. Like:

    Please login or register to see this code.

    I changed the original code too.

    I believe that the dimming should work too.

    So, the problematic child is the Skrivebord. 

    Link to comment
    Share on other sites

  • Topic Author
  • That "Skrivebord" doesn't even turn on is mighty strange as it is a basic command that's been around since the first Hue was invented... You say "Stay in 25%" for "SKrivebord" but you mean that it doesn't change I guess?

    So, I suspect that there is something with the connection to the bulb.

     

    Edited by jgab
    Link to comment
    Share on other sites

    8 minutes ago, jgab said:

     

    I'm not so good at scenes..., there is a "bug" in scenes which prevents table from being sent as arguments in fibaro.call...

    Can you change the last fibaro.call to use json.encode on it's table argument. Like:

    Please login or register to see this code.

    I changed the original code too.

    I believe that the dimming should work too.

    So, the problematic child is the Skrivebord. 

    Wuhoooo :-)   Just tried on the last Bulb - and now its start dimming

     

    Just now, ChristianSogaard said:

    Wuhoooo :-)   Just tried on the last Bulb - and now its start dimming

     

     
    I guess the last call need to change ;-)
     

    Please login or register to see this code.

     

    6 minutes ago, jgab said:

    That "Skrivebord" doesn't even turn on is mighty strange as it is a basic command that's been around since the first Hue was invented... You say "Stay in 25%" for "SKrivebord" but you mean that it doesn't change I guess?

    So, I suspect that there is something with the connection to the bulb.

     

    I have seen Skrivebord work with toggle - but today its a mess. I only have two of those bulbs  - and an lot of spare, so I can replace them 

    Link to comment
    Share on other sites

  • Topic Author
  • 2 minutes ago, ChristianSogaard said:

    Wuhoooo :-)   Just tried on the last Bulb - and now its start dimming

     

     
    I guess the last call need to change ;-)
     

    Please login or register to see this code.

     

    No the last call's argument is not a table. 

    table.unpack takes a table (array) of arguments and "unpacks" them as arguments to the call. So it's still correct.

    From the scene we don't send any tables.

    but Skrivebord still doesn't respond?

     

    However, that the lamps doesn't start to dim when used from the scene and the Matrix, is probably an issue with the scene then...

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