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

4 minuty temu, jgab napisał:

 

Ok, here is v1.9 with the fix

Please login or register to see this attachment.

 Awesome :) Now works :)

Link to comment
Share on other sites

20 minutes ago, jgab said:

Could it be that the property value arrives as a string? 

Stupid of me, that i didn't think of that...?

Link to comment
Share on other sites

  • Topic Author
  • 8 minutes ago, Bodyart said:

    Stupid of me, that i didn't think of that...?

    Well, fibaro.call(....) is really funky in how it sometimes changes the type of the arguments. 

    Link to comment
    Share on other sites

  • Topic Author
  • Here is a version of HC2Proxy that supports rollerShutter better - the buttons on the childDevice sends the right commands back to the HC2 device.

    v.1.10

    Please login or register to see this attachment.

     

    Link to comment
    Share on other sites

    I added a HC2 Remotec ZRC90 Scenemaster to HC3 by HC2Proxyv1.10.

    Please login or register to see this spoiler.

    But no reaction, no trigger in HC2.

    Link to comment
    Share on other sites

  • Topic Author
  • 3 minutes ago, Rover said:

    I added a HC2 Remotec ZRC90 Scenemaster to HC3 by HC2Proxyv1.10.

    Please login or register to see this spoiler.

    Did you add the trigger to the header in the scene running on the HC2?

    Link to comment
    Share on other sites

    19 minutes ago, jgab said:

    Did you add the trigger to the header in the scene running on the HC2?

    Yes, I did.

    Please login or register to see this spoiler.

     

    Link to comment
    Share on other sites

  • Topic Author
  • 3 minutes ago, Rover said:

    Yes, I did.

    Please login or register to see this spoiler.

    I meant in the header of the HC2  scene

    Please login or register to see this code.

     

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

    51 minutes ago, jgab said:

    I meant in the header of the HC2  scene

    Please login or register to see this code.

     

    Hoeray! That works!

    I had used 263 value.

    TNX jgab ?

    Please login or register to see this spoiler.

     

    Link to comment
    Share on other sites

    And now the ZWAVE.ME WALLC-S wall switch.

    It delivers in HC2 one SceneID:  MySceneId = tonumber(fibaro:getValue(SwitchID, "sceneActivation")), f.i. 11 for button1 pressed.

    It has 4 buttons.

    In a HC3 testscene I see 6 buttons with divided keyID and keyAttribute, so this does not work.

    Link to comment
    Share on other sites

  • Topic Author
  • 43 minutes ago, Rover said:

    And now the ZWAVE.ME WALLC-S wall switch.

    It delivers in HC2 one SceneID:  MySceneId = tonumber(fibaro:getValue(SwitchID, "sceneActivation")), f.i. 11 for button1 pressed.

    It has 4 buttons.

    In a HC3 testscene I see 6 buttons with divided keyID and keyAttribute, so this does not work.

    You have set the class to 'sceneActivationDevice' right?

    The HC3 childDevice you create (ex remoteController) may or may not have buttons, but they won't work. Every sceneActivation device, like your ZWAVE.ME WALLC-S, have different key layouts and I can't add buttons to the child device.

    However, if you press a button on the remote connected to the HC2, the child device on the HC3 will post a sceneActivation event with the same sceneId on the HC3 so your block scenes should be able to trigger on it. Ex. in the block scene set "scene activation event" == 11

    Link to comment
    Share on other sites

    3 hours ago, jgab said:

    You have set the class to 'sceneActivationDevice' right?

    The HC3 childDevice you create (ex remoteController) may or may not have buttons, but they won't work. Every sceneActivation device, like your ZWAVE.ME WALLC-S, have different key layouts and I can't add buttons to the child device.

    However, if you press a button on the remote connected to the HC2, the child device on the HC3 will post a sceneActivation event with the same sceneId on the HC3 so your block scenes should be able to trigger on it. Ex. in the block scene set "scene activation event" == 11

    Yes, I have set the class to 'sceneActivationDevice' .

    In the block scene not "scene activation event" is to be seen, but:

    Please login or register to see this spoiler.

     

    Link to comment
    Share on other sites

  • Topic Author
  • 4 hours ago, Rover said:

    Yes, I have set the class to 'sceneActivationDevice' .

    In the block scene not "scene activation event" is to be seen, but:

    Please login or register to see this spoiler.

    Can you show me the table mapping you do on the HC3 for the device? [<id>] = {....

    Link to comment
    Share on other sites

    5 hours ago, jgab said:

    Can you show me the table mapping you do on the HC3 for the device? [<id>] = {....

    Please login or register to see this spoiler.

    but in the API no difference to be seen for centralSceneDevice and the other: sceneActivationDevice.

    Link to comment
    Share on other sites

  • Topic Author
  • Your device 306/81 is of wrong type. It has interface zwaveCentralScene and a centralSceneSupport property.

    It should be of interface zwaveSceneActivationEvent and have no centralSceneSupport.

    Did you change the type/mapping without regenerating the child?

     

    For 263, go into the code, around line ~263. and add two lines with button 7 and 8.

    In table

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

    32 minutes ago, jgab said:

    Your device 306/81 is of wrong type. It has interface zwaveCentralScene and a centralSceneSupport property.

    It should be of interface zwaveSceneActivationEvent and have no centralSceneSupport.

    Did you change the type/mapping without regenerating the child?

    type/mapping was and is:

    Please login or register to see this spoiler.

    I did an Install on HC2Proxy and also remapped HC2, but no change in API.

    Link to comment
    Share on other sites

  • Topic Author
  • 22 minutes ago, Rover said:

    type/mapping was and is:

    Please login or register to see this spoiler.

    306/81 also has the wrong classname - in your device struct log it says "centralSceneDevice" - it should be sceneActivationDevice

    ...so it seems like an old child hanging around

    My remoteController looks like below. Note the interfaces "zwaveSceneActivationEvent", and the quickAppVariable

            "name": "className",
            "value": "sceneActivationDevice"

     

    I would recommend to delete the child device and install it again (I think you can just delete the child device and then press "install")

    Please login or register to see this code.

     

    Edited by jgab
    Link to comment
    Share on other sites

    54 minutes ago, jgab said:

    I would recommend to delete the child device and install it again (I think you can just delete the child device and then press "install")

    You are right (as always):

       
    id 88
    name "OverloopSwitch (HC2)"
    roomID 219
    view []
    type "com.fibaro.remoteSceneController"
    baseType "com.fibaro.remoteController"
    enabled true
    visible true
    isPlugin true
    parentId 73
    viewXml false
    configXml false
    interfaces  
    0 "quickAppChild"
    1 "zwaveSceneActivationEvent"
    properties  
    availableScenes []
    categories  
    0 "remotes"
    dead false
    deadReason ""
    deviceControlType 0
    deviceIcon 103
    emailNotificationID 0
    emailNotificationType 0
    log ""
    logTemp ""
    manufacturer ""
    model ""
    pushNotificationID 0
    pushNotificationType 0
    quickAppVariables  
    0  
    name "className"
    value "sceneActivationDevice"
    1  
    name "id"
    value 306
    2  
    name "HC2PROXY"
    value "306:com.fibaro.remoteSceneController"
    saveLogs true
    smsNotificationID 0
    smsNotificationType 0
    useEmbeddedView true
    userDescription ""
    actions {}
    created 1600082539
    modified 1600082539
    sortOrder 55
    Link to comment
    Share on other sites

    2 hours ago, jgab said:

    For 263, go into the code, around line ~263. and add two lines with button 7 and 8.

    In table

    Please login or register to see this code.

    I did and also changed Released with Pressed2.

    Again it was necessary to delete the child and install again (with another deviceID ?).

    Link to comment
    Share on other sites

  • Topic Author
  • 16 minutes ago, Rover said:

    I did and also changed Released with Pressed2.

    Again it was necessary to delete the child and install again (with another deviceID ?).

    Yes, now you were right :-) You need to reinstall the child for it to get provisioned with the additional buttons. I will add 78 as default for the next version.

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