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

8 minutes ago, jgab said:

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.

 

[09.11.2020] [18:05:13] [ERROR] [QUICKAPP719]: QuickApp crashed
[09.11.2020] [18:05:13] [ERROR] [QUICKAPP719]: main.lua:35: attempt to index a nil value (global 'hc3_emulator')
[09.11.2020] [18:05:58] [ERROR] [QUICKAPP719]: QuickApp crashed

1 minute ago, ChristianSogaard said:

[09.11.2020] [18:05:13] [ERROR] [QUICKAPP719]: QuickApp crashed
[09.11.2020] [18:05:13] [ERROR] [QUICKAPP719]: main.lua:35: attempt to index a nil value (global 'hc3_emulator')
[09.11.2020] [18:05:58] [ERROR] [QUICKAPP719]: QuickApp crashed

I just deleted everything with emulator - and that works

Link to comment
Share on other sites

  • Topic Author
  • 3 minutes ago, ChristianSogaard said:

    [09.11.2020] [18:05:13] [ERROR] [QUICKAPP719]: QuickApp crashed
    [09.11.2020] [18:05:13] [ERROR] [QUICKAPP719]: main.lua:35: attempt to index a nil value (global 'hc3_emulator')
    [09.11.2020] [18:05:58] [ERROR] [QUICKAPP719]: QuickApp crashed

    I just deleted everything with emulator - and that works

    Sorry,  just realised that I uploaded the code and not the actual QA.I updated the post with the QA - but you managed anyway :-) 

     

    Link to comment
    Share on other sites

    4 minutes ago, jgab said:

    Sorry,  just realised that I uploaded the code and not the actual QA.I updated the post with the QA - but you managed anyway :-) 

     

    It seems that “Multilevel switch" Hue is still causing issues. Now the toggle arent working - and it can only dimm down - not up. Other bulb is working fine

    Link to comment
    Share on other sites

    1 hour ago, ChristianSogaard said:

    It seems that “Multilevel switch" Hue is still causing issues. Now the toggle arent working - and it can only dimm down - not up. Other bulb is working fine

    [09.11.2020] [19:40:56] [DEBUG] [QUICKAPP719]: onAction: {"args":[],"actionName":"stopLevelChange","deviceId":745}
    [09.11.2020] [19:41:07] [DEBUG] [QUICKAPP719]: onAction: {"args":[99],"actionName":"setValue","deviceId":745}
    [09.11.2020] [19:41:07] [DEBUG] [QUICKAPP719]: URL:/lights/10/state
    [09.11.2020] [19:41:24] [DEBUG] [QUICKAPP719]: onAction: {"args":[],"actionName":"turnOff","deviceId":745}
    [09.11.2020] [19:41:29] [DEBUG] [QUICKAPP719]: onAction: {"args":[],"actionName":"turnOff","deviceId":745}
    [09.11.2020] [19:41:32] [DEBUG] [QUICKAPP719]: onAction: {"args":[],"actionName":"turnOff","deviceId":745}
    [09.11.2020] [19:41:34] [DEBUG] [QUICKAPP719]: onAction: {"args":[],"actionName":"turnOff","deviceId":745}

     

    Somehow turnOff dont work for my “Multilevel switch"

    Link to comment
    Share on other sites

  • Topic Author
  • Updated to v1.4 - I think it should behave better. I tried it both on multilevel (white dimmable light) and extended color light.

    (turnOn/off works for me)

    Dimming speed can be affected by setting quickVar dimstep to a value. Default is 14. Higher will dim faster.

     

    Edited by jgab
    Link to comment
    Share on other sites

  • Topic Author
  • The Lua compiler is included in the QA Toolbox now.

    It's based on the Lua compiler I posted previously 

     

    It makes it easy to do "loadstring" or evaluate Lua expressions in QAs.

    Please login or register to see this code.

     

    Edited by jgab
    Link to comment
    Share on other sites

    12 hours ago, ChristianSogaard said:

    [09.11.2020] [19:40:56] [DEBUG] [QUICKAPP719]: onAction: {"args":[],"actionName":"stopLevelChange","deviceId":745}
    [09.11.2020] [19:41:07] [DEBUG] [QUICKAPP719]: onAction: {"args":[99],"actionName":"setValue","deviceId":745}
    [09.11.2020] [19:41:07] [DEBUG] [QUICKAPP719]: URL:/lights/10/state
    [09.11.2020] [19:41:24] [DEBUG] [QUICKAPP719]: onAction: {"args":[],"actionName":"turnOff","deviceId":745}
    [09.11.2020] [19:41:29] [DEBUG] [QUICKAPP719]: onAction: {"args":[],"actionName":"turnOff","deviceId":745}
    [09.11.2020] [19:41:32] [DEBUG] [QUICKAPP719]: onAction: {"args":[],"actionName":"turnOff","deviceId":745}
    [09.11.2020] [19:41:34] [DEBUG] [QUICKAPP719]: onAction: {"args":[],"actionName":"turnOff","deviceId":745}

     

    Somehow turnOff dont work for my “Multilevel switch"

    I tried follow the "Turn Off" error. Diving into a CoH  Bulb device - it like the device dont have connection to the HUE Bridge

    Please login or register to see this image.

    /monthly_2020_11/image.png.fd0879f12db261129fcbe454b6f95e10.png" />

     

    If i manual press "off" and "on" a couple of times the light starts to react. And afterwards my "turnOff Scene" also work.

    Waiting some more time, and the CoH  Bulb device seems out of state with the HUE Bridge

     

     

    Link to comment
    Share on other sites

  • Topic Author
  • 22 minutes ago, ChristianSogaard said:

    I tried follow the "Turn Off" error. Diving into a CoH  Bulb device - it like the device dont have connection to the HUE Bridge

    Please login or register to see this link.

     

    If i manual press "off" and "on" a couple of times the light starts to react. And afterwards my "turnOff Scene" also work.

    Waiting some more time, and the CoH  Bulb device seems out of state with the HUE Bridge

     

     

    What Hue type is that device?

    'Color light' or 'Color temperature light' ?

    You can see the type with the 'list' button.

     

    I have been focusing on the "White dimmable light" and "Extended color light" as these are the lights that I have. 

    Link to comment
    Share on other sites

  • Topic Author
  • 6 minutes ago, jgab said:

    What Hue type is that device?

    'Color light' or 'Color temperature light' ?

    You can see the type with the 'list' button.

     

    I have been focusing on the "White dimmable light" and "Extended color light" as these are the lights that I have. 

    Of course there was a bug in Color light. Fix 1.5

     

    Link to comment
    Share on other sites

  • Topic Author
  • 1 minute ago, ChristianSogaard said:

    I have issues for both Color controller and Multilevel switch

    What is the multilevelSwitch? Is it a Hue group/room ?

    Link to comment
    Share on other sites

    3 minutes ago, jgab said:

    What is the multilevelSwitch? Is it a Hue group/room ?

    No its a HUE Bulb

    Please login or register to see this image.

    /monthly_2020_11/image.png.fbe415643d9c68047ce9551a76085f7c.png" />

     

    image.png.cbe6fdd83b7afe1e96ba3cea5632804c.png

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

  • Topic Author
  • ...and you tried the last v1.5 I just linked?

    Link to comment
    Share on other sites

    2 hours ago, jgab said:

    Updated to v1.4 - I think it should behave better. I tried it both on multilevel (white dimmable light) and extended color light.

    (turnOn/off works for me)

    Dimming speed can be affected by setting quickVar dimstep to a value. Default is 14. Higher will dim faster.

     

     

    How would the Scene look like when implementing quickVar dimstep?

    Or should i just create a Variable dimstep?

     

    Please login or register to see this code.

    Dimming speed can be affected by setting quickVar dimstep to a value. Default is 14. Higher will dim faster.

     

     

    1 hour ago, ChristianSogaard said:

    Sorry no - is at work. So cant press any physical buttons. But I can upload the 1.5 version

    I uploaded 1.5 version - but cant tell if it changed anything (is not home)- Bulb is still Multilevel Switch

    Please login or register to see this image.

    /monthly_2020_11/image.png.6d92425591bd384987a3817f603cf882.png" />

     

    Link to comment
    Share on other sites

  • Topic Author
  • 8 minutes ago, ChristianSogaard said:

     

    How would the Scene look like when implementing quickVar dimstep?

    Or should i just create a Variable dimstep?

     

    Please login or register to see this code.

    Dimming speed can be affected by setting quickVar dimstep to a value. Default is 14. Higher will dim faster.

     

    I uploaded v1.7.

    The dim mechanism is changed - I leverage the Hue transition time mechanism now so It should be smoother.

    The default time is to dim 1-254 in 10s.

    It can be changed by setting the quickAppVariable (in the UI panel) 'dim time' to the seconds wanted.

    Link to comment
    Share on other sites

    9 minutes ago, jgab said:

     

    I uploaded v1.7.

    The dim mechanism is changed - I leverage the Hue transition time mechanism now so It should be smoother.

    The default time is to dim 1-254 in 10s.

    It can be changed by setting the quickAppVariable (in the UI panel) 'dim time' to the seconds wanted.

    Did you pre populate the dim time in the (in the UI panel)?  i installed V1.7 and i UI is the same as 1.5

    Please login or register to see this image.

    /monthly_2020_11/image.png.10c1835f5e862c8393d3d1d6d3dbc63d.png" />

    Link to comment
    Share on other sites

  • Topic Author
  • 1 minute ago, ChristianSogaard said:

    Did you pre populate the dim time in the (in the UI panel)?  i installed V1.7 and i UI is the same as 1.5

    Please login or register to see this link.

    No, if there is no dimtime variable it defaults to 10s, if you provide one I will use it instead.

    Just now, jgab said:

    No, if there is no dimtime variable it defaults to 10s, if you provide one I will use it instead.

    and the time is to dim the whole interval. If the light is already at 50% it will dim the rest in 5s.

    • Like 1
    Link to comment
    Share on other sites

    5 hours ago, jgab said:

    No, if there is no dimtime variable it defaults to 10s, if you provide one I will use it instead.

    and the time is to dim the whole interval. If the light is already at 50% it will dim the rest in 5s.

    Trying ver 1.7

    I cant turn on or turn off light, and QuickApp crashed when trying to Dimm

     

    [10.11.2020] [16:30:03] [TRACE] [QUICKAPP812]: Color_light inited, hueId:33, deviceId:851
    [10.11.2020] [16:30:03] [DEBUG] [QUICKAPP812]: 39 children
    [10.11.2020] [16:30:04] [TRACE] [QUICKAPP812]: Hue connected to 192.168.201.3
    [10.11.2020] [16:30:24] [DEBUG] [SCENE119]: KeyId: 1 KeyAttr: Pressed
    [10.11.2020] [16:30:24] [DEBUG] [SCENE119]: Calling 814 Params: ["toggle"]
    [10.11.2020] [16:30:24] [DEBUG] [QUICKAPP812]: onAction: {"args":[],"deviceId":814,"actionName":"turnOn"}
    [10.11.2020] [16:30:24] [DEBUG] [QUICKAPP812]: URL:/lights/10/state
    [10.11.2020] [16:30:27] [DEBUG] [SCENE119]: KeyId: 1 KeyAttr: Pressed
    [10.11.2020] [16:30:27] [DEBUG] [SCENE119]: Calling 814 Params: ["toggle"]
    [10.11.2020] [16:30:27] [DEBUG] [QUICKAPP812]: onAction: {"args":[],"deviceId":814,"actionName":"turnOn"}
    [10.11.2020] [16:30:54] [DEBUG] [SCENE119]: KeyId: 1 KeyAttr: Pressed
    [10.11.2020] [16:30:54] [DEBUG] [SCENE119]: Calling 814 Params: ["toggle"]
    [10.11.2020] [16:30:54] [DEBUG] [QUICKAPP812]: onAction: {"args":[],"deviceId":814,"actionName":"turnOn"}
    [10.11.2020] [16:30:57] [DEBUG] [SCENE119]: KeyId: 1 KeyAttr: HeldDown
    [10.11.2020] [16:30:57] [DEBUG] [SCENE119]: Calling 814 Params: ["startLevelIncrease"]
    [10.11.2020] [16:30:57] [DEBUG] [QUICKAPP812]: onAction: {"args":[],"deviceId":814,"actionName":"startLevelIncrease"}
    [10.11.2020] [16:30:57] [DEBUG] [QUICKAPP812]: DU
    [10.11.2020] [16:30:57] [DEBUG] [QUICKAPP812]: ./include/main.lua:622: attempt to perform arithmetic on a string value (field 'bri')
    [10.11.2020] [16:30:57] [ERROR] [QUICKAPP812]: QuickApp crashed
    [10.11.2020] [16:30:57] [ERROR] [QUICKAPP812]: Unknown error occurred: handleJsonRpc
    [10.11.2020] [16:30:58] [DEBUG] [SCENE119]: KeyId: 1 KeyAttr: Released
    [10.11.2020] [16:30:58] [DEBUG] [SCENE119]: Calling 814 Params: ["stopLevelChange"]

    Link to comment
    Share on other sites

    4 minutes ago, ChristianSogaard said:

    Trying ver 1.7

    I cant turn on or turn off light, and QuickApp crashed when trying to Dimm 

     

    [10.11.2020] [16:30:03] [TRACE] [QUICKAPP812]: Color_light inited, hueId:33, deviceId:851
    [10.11.2020] [16:30:03] [DEBUG] [QUICKAPP812]: 39 children
    [10.11.2020] [16:30:04] [TRACE] [QUICKAPP812]: Hue connected to 192.168.201.3
    [10.11.2020] [16:30:24] [DEBUG] [SCENE119]: KeyId: 1 KeyAttr: Pressed
    [10.11.2020] [16:30:24] [DEBUG] [SCENE119]: Calling 814 Params: ["toggle"]
    [10.11.2020] [16:30:24] [DEBUG] [QUICKAPP812]: onAction: {"args":[],"deviceId":814,"actionName":"turnOn"}
    [10.11.2020] [16:30:24] [DEBUG] [QUICKAPP812]: URL:/lights/10/state
    [10.11.2020] [16:30:27] [DEBUG] [SCENE119]: KeyId: 1 KeyAttr: Pressed
    [10.11.2020] [16:30:27] [DEBUG] [SCENE119]: Calling 814 Params: ["toggle"]
    [10.11.2020] [16:30:27] [DEBUG] [QUICKAPP812]: onAction: {"args":[],"deviceId":814,"actionName":"turnOn"}
    [10.11.2020] [16:30:54] [DEBUG] [SCENE119]: KeyId: 1 KeyAttr: Pressed
    [10.11.2020] [16:30:54] [DEBUG] [SCENE119]: Calling 814 Params: ["toggle"]
    [10.11.2020] [16:30:54] [DEBUG] [QUICKAPP812]: onAction: {"args":[],"deviceId":814,"actionName":"turnOn"}
    [10.11.2020] [16:30:57] [DEBUG] [SCENE119]: KeyId: 1 KeyAttr: HeldDown
    [10.11.2020] [16:30:57] [DEBUG] [SCENE119]: Calling 814 Params: ["startLevelIncrease"]
    [10.11.2020] [16:30:57] [DEBUG] [QUICKAPP812]: onAction: {"args":[],"deviceId":814,"actionName":"startLevelIncrease"}
    [10.11.2020] [16:30:57] [DEBUG] [QUICKAPP812]: DU
    [10.11.2020] [16:30:57] [DEBUG] [QUICKAPP812]: ./include/main.lua:622: attempt to perform arithmetic on a string value (field 'bri')
    [10.11.2020] [16:30:57] [ERROR] [QUICKAPP812]: QuickApp crashed
    [10.11.2020] [16:30:57] [ERROR] [QUICKAPP812]: Unknown error occurred: handleJsonRpc
    [10.11.2020] [16:30:58] [DEBUG] [SCENE119]: KeyId: 1 KeyAttr: Released
    [10.11.2020] [16:30:58] [DEBUG] [SCENE119]: Calling 814 Params: ["stopLevelChange"]

    another thing - Only bulbs i switch on/off manually is showing the right state.

    LIke here - 839 i turned on manually from COH device - and then device are showed. 

    former versions have same issue

     

    Please login or register to see this image.

    /monthly_2020_11/image.png.76a0d1d04efb9f95bfcdf9200f6a1f8f.png" />

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