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
  • 7 hours ago, Rover said:

    If I want to add devices to alarm zone in HC3: "no devices of this type" ???

    I have only HC2 devices of type sensor.

    Well, I made some tests and it seems like a two things need to fulfilled for a device to be included in an alarmzone

     

    First it seems to need to have the interface "fibaroBreach".

    Secondly, it seems to have to be a valid device type, like com.fibaro.motionSensor etc. Does anyone know the complete list? Ex. com.fibaro.binarySensor does not seem to work

     

    I have made a new version of the HC2Proxy that allows you to add a list of interfaces to the device being created.

    v1.4 

    Please login or register to see this attachment.

    You can also add "batter" and "power" and "energy".

    On the HC2 if you trigger on %% property <id> battery the HC3 proxy should be updated.

    Link to comment
    Share on other sites

    4 minutes ago, jgab said:

    Ex. com.fibaro.binarySensor does not seem to work

    So I cannot use all my HC2 door/window sensors for alarm scene in HC3?

    Link to comment
    Share on other sites

  • Topic Author
  • 27 minutes ago, Rover said:

    So I cannot use all my HC2 door/window sensors for alarm scene in HC3?

    Yes, but you have to set the type to com.fibaro.doorSensor or com.fibaro.windowSensor (and add the interface "fibaroBreach")

    Link to comment
    Share on other sites

    23 minutes ago, jgab said:

    Yes, but you have to set the type to com.fibaro.doorSensor or com.fibaro.windowSensor (and add the interface "fibaroBreach")

    That's a relief ?

    What do you mean with "add the interface "fibaroBreach" ". What do I have to do?

     

    What type of device is a remote controller?

    Link to comment
    Share on other sites

    Hi Jan @jgab,

     

    I don't know what am I doing wrong, but there is no power consumption shown:

        [83] = {name='TV Switch', class="binarySwitch",     type="com.fibaro.FGWP102",interfaces={"fibaroBreach","power"}},
       [242] = {name='Switch',    class="binarySwitch",     type="com.fibaro.FGWP102",interfaces={"fibaroBreach","power"}},
        [75] = {name='Koelkast',  class="binarySwitch",     type="com.fibaro.FGWP102",interfaces={"fibaroBreach","power"}},
       [138] = {name='Vrieskast', class="binarySwitch",     type="com.fibaro.FGWP102",interfaces={"fibaroBreach","power"}},
        [79] = {name='Vaatwasser',class="binarySwitch",     type="com.fibaro.FGWP102",interfaces={"fibaroBreach","power"}},
     
    Link to comment
    Share on other sites

  • Topic Author
  • Just now, Rover said:

    That's a relief ?

    What do you mean with "add the interface "fibaroBreach" ". What do I have to do?

     

    What type of device is a remote controller?

    In the new HC2Proxy I attached there is the possibility to add interfaces in the table defining the devices that should be created.

    If you look at a device structure (using the swagger UI or api.get("/devices/"..myDeviceId) you see that it has an 'interfaces' property that list certain properties a device can have. Ex. a device run on battery has the "battery" interface property. (that's what makes it show a battery icon in the UI for the device)

     

    A remote controller I don't know if you can include it in a alarm zone... anyone else tried that?

    2 minutes ago, Bodyart said:

    Hi Jan @jgab,

     

    I don't know what am I doing wrong, but there is no power consumption shown:

        [83] = {name='TV Switch', class="binarySwitch",     type="com.fibaro.FGWP102",interfaces={"fibaroBreach","power"}},
       [242] = {name='Switch',    class="binarySwitch",     type="com.fibaro.FGWP102",interfaces={"fibaroBreach","power"}},
        [75] = {name='Koelkast',  class="binarySwitch",     type="com.fibaro.FGWP102",interfaces={"fibaroBreach","power"}},
       [138] = {name='Vrieskast', class="binarySwitch",     type="com.fibaro.FGWP102",interfaces={"fibaroBreach","power"}},
        [79] = {name='Vaatwasser',class="binarySwitch",     type="com.fibaro.FGWP102",interfaces={"fibaroBreach","power"}},
     

     

    Have you included 

    Please login or register to see this code.

    etc. in the HC2 scene?

    • Thanks 1
    Link to comment
    Share on other sites

    7 minutes ago, jgab said:

    Have you included 

    Please login or register to see this code.

    etc. in the HC2 scene?

    Yes, but i'm still doing something wrong..

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

  • Topic Author
  • 2 minutes ago, Bodyart said:

    Yes, but i'm still doing something wrong..

    Please login or register to see this code.

     

    So, you need both

    83 value

    83 power

    if you want the value to reflect too.

    • Thanks 1
    Link to comment
    Share on other sites

    1 hour ago, jgab said:

    A remote controller I don't know if you can include it in a alarm zone... anyone else tried that?

    No, there is no intention to include a HC2 remote controller in an alarm zone, only just make it usable in HC3.

     [210] = {name='VoordeurSwitch', class="binarySensor", type="com.fibaro.binarySensor"},

    does not work for a remote controller, so which class and type should I use?

    Link to comment
    Share on other sites

  • Topic Author
  • 19 minutes ago, Rover said:

    No, there is no intention to include a HC2 remote controller in an alarm zone, only just make it usable in HC3.

     [210] = {name='VoordeurSwitch', class="binarySensor", type="com.fibaro.binarySensor"},

    does not work for a remote controller, so which class and type should I use?

    How do you trigger it on the HC2 side.

    CentralSceneEvent?

    Link to comment
    Share on other sites

    4 minutes ago, jgab said:

    How do you trigger it on the HC2 side.

    CentralSceneEvent?

    %% properties
    210 sceneActivation

    MySceneId = tonumber(fibaro:getValue(SwitchID, "sceneActivation"))

    Link to comment
    Share on other sites

    3 hours ago, jgab said:

    Yes, but you have to set the type to com.fibaro.doorSensor or com.fibaro.windowSensor (and add the interface "fibaroBreach")

    I have adapted the class/type declaration:

      [44] = {name='Voordeur', class="binarySensor", type="com.fibaro.doorSensor",interfaces={"fibaroBreach"}},

    but in Edit Alarm Zone still: "no devices of this type".

    Link to comment
    Share on other sites

  • Topic Author
  • 5 minutes ago, Rover said:

    I have adapted the class/type declaration:

      [44] = {name='Voordeur', class="binarySensor", type="com.fibaro.doorSensor",interfaces={"fibaroBreach"}},

    but in Edit Alarm Zone still: "no devices of this type".

    Hmm, if you set the category "Security" in the general tab?

    So, I only tested with com.fibaro.motionSensor and jumped to the conclusion it would work with window and door. I can't seem to get any clue from the system what device types they accept in the UI. Hmm, wonder it it's possible to add with api..?

    Link to comment
    Share on other sites

    20 minutes ago, jgab said:

    Hmm, if you set the category "Security" in the general tab?

    So, I only tested with com.fibaro.motionSensor and jumped to the conclusion it would work with window and door. I can't seem to get any clue from the system what device types they accept in the UI. Hmm, wonder it it's possible to add with api..?

    category "Security" in the general tab??? Nothing to be seen about security in the general tab.

    How to set Alarm Zones with an api?

    Is the use of Alarm Zones in HC3 obliged, or can you live without?

    Link to comment
    Share on other sites

    3 hours ago, Rover said:

    So, I only tested with com.fibaro.motionSensor

    I changed

        [24] = {name='BewegingHal', class="binarySensor", type="com.fibaro.binarySensor"},

    into

        [24] = {name='BewegingHal', class="binarySensor", type="com.fibaro.motionSensor"},

    This is a Fibaro motionsensor,

    but still in Edit Alarm Zone still: "no devices of this type".

    So why is your motionsensor recognized in setting Alarm Zone and mine not?

    Maybe I have to remove the child device first and then add it?

    Link to comment
    Share on other sites

  • Topic Author
  • 15 minutes ago, Rover said:

    I changed

        [24] = {name='BewegingHal', class="binarySensor", type="com.fibaro.binarySensor"},

    into

        [24] = {name='BewegingHal', class="binarySensor", type="com.fibaro.motionSensor"},

    This is a Fibaro motionsensor,

    but still in Edit Alarm Zone still: "no devices of this type".

    So why is your motionsensor recognized in setting Alarm Zone and mine not?

    Maybe I have to remove the child device first and then add it?

    Yes, unfortunately you have to regenerate the children for them to get the right attributes 

    Link to comment
    Share on other sites

    for alarm zones, the device need to be at least com.fibaro.securitySensor (e.g. doorwindow, motion, satel zone, dsc zone, envisa zone are type of com.fibaro.securitySensor) type. The com.fibaro.securitySensor itself is based on com.fibaro.binarySensor, that's why com.fibaro.binarySensor can't be used in Alarm Zones.

     

     

     

    Link to comment
    Share on other sites

    4 minutes ago, tinman said:

    for alarm zones, the device need to be at least com.fibaro.securitySensor (e.g. doorwindow, motion, satel zone, dsc zone, envisa zone are type of com.fibaro.securitySensor) type. The com.fibaro.securitySensor itself is based on com.fibaro.binarySensor, that's why com.fibaro.binarySensor can't be used in Alarm Zones.

     

     

     

    So which type do I have to use for a Fibaro door/window sensor in order to be recognized for Alarm Zone: com.fibaro.doorSensor or com.fibaro.windowSensor or com.fibaro.securitySensor?

    And for Fibaro motion sensor: com.fibaro.motionSensor or com.fibaro.securitySensor?

    Link to comment
    Share on other sites

    10 minutes ago, Rover said:

    So which type do I have to use for a Fibaro door/window sensor in order to be recognized for Alarm Zone: com.fibaro.doorSensor or com.fibaro.windowSensor or com.fibaro.securitySensor?

    And for Fibaro motion sensor: com.fibaro.motionSensor or com.fibaro.securitySensor?

     

    each of them is ok :)  Bold are the easiest:


    com.fibaro.securitySensor is generic, if you wish be more specific (and maybe use the additional property and actions) use more specific, like com.fibaro.doorSensor or com.fibaro.windowSensor (which are both member of com.fibaro.doorWindowSensor, which is member of com.fibaro.securitySensor). For Motion just com.fibaro.motionSensor (more hardware specific - not necessary however for QA is com.fibaro.FGMS001v2 which is member of com.fibaro.FGMS001 which is member of com.fibaro.motionSensor).

     

     

    • Like 1
    • Thanks 1
    Link to comment
    Share on other sites

    jgab

    HC3 <=> HC2

    like

    HC3 <=> HC3

    Is there any way to link two HC3 units?

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