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

You haven’t failed. You only found a way that didn’t work ?

 

btw there is a difference between showing the consumption in the label and storing the consumption in a device. 
I hope we get a new energy panel for the HC3, so we can trace the power consumption history that way. 

Link to comment
Share on other sites

ha i am making progress. By defing the quickapp as energymeter and child devices the same we get 2 fields that can be used to store values.  "Value" where i put the instant power and "Energy" where i put the total.  And it works :) 

Now how to show on the instant power in the label like it worked for the multisensor....

 

Link to comment
Share on other sites

  • Topic Author
  • 8 hours ago, Momos said:

    ha i am making progress. By defing the quickapp as energymeter and child devices the same we get 2 fields that can be used to store values.  "Value" where i put the instant power and "Energy" where i put the total.  And it works :) 

    Now how to show on the instant power in the label like it worked for the multisensor....

     

    add interface "power" when you create the child.

    self:updateProperty("power",55) to set the power value - it will show up at the bottom of the device icon as "55W"

    Link to comment
    Share on other sites

    Like so ?

     

    Please login or register to see this code.

    It does not work. I think because there is no power in the device properties.

     

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

  • Topic Author
  • 1 minute ago, Momos said:

    Like so ?

     

    Please login or register to see this code.

    It does not work. I think because there is no power in the device properties.

     

    Please login or register to see this code.

     

    When you create the child you need to add the interface "power"

    Please login or register to see this code.

    Link to comment
    Share on other sites

    and one last question about this QA and i'm done with it :) 

     

    Can i add the same interface "power" to the main QA ?  - to sum up all the instant energy readings from childs.

    As i tried and nothing happens:(  obviously i did not do it correctly ..

     

    Link to comment
    Share on other sites

  • Topic Author
  • 1 hour ago, Momos said:

    and one last question about this QA and i'm done with it :) 

     

    Can i add the same interface "power" to the main QA ?  - to sum up all the instant energy readings from childs.

    As i tried and nothing happens:(  obviously i did not do it correctly ..

     

    How do you add the interface to the main QA?

     

    Try this inside :onInit()
     

    Please login or register to see this code.

    I check if it already has the power interface. Otherwise, when the interface is added (self:addInterfaces) the QA is restarted - and if you do it at every startup you may end up with an infinite loop...

    Edited by jgab
    Link to comment
    Share on other sites

    34 minutes ago, jgab said:

    Try this inside :onInit()
     

    Please login or register to see this code.

    I check if it already has the power interface. Otherwise, when the interface is added (self:addInterfaces) the QA is restarted - and if you do it at every startup you may end up with an infinite loop...

     

    cleaner then what i did obviously :)  I think it misses an "end"  after break end end

    • Thanks 1
    Link to comment
    Share on other sites

    @jgab hi!

    do you know how to re-conect to MQTT after rebooting MQTT server?

    so, when i restart my MQTT server on rpi HC3 lose connection.

     

    thank you!

    Link to comment
    Share on other sites

  • Topic Author
  • 11 minutes ago, 10der said:

    @jgab hi!

    do you know how to re-conect to MQTT after rebooting MQTT server?

    so, when i restart my MQTT server on rpi HC3 lose connection.

     

    thank you!

     

    Don't you get a disconnect message on the HC3?

    Link to comment
    Share on other sites

    Jan,

    Hehehe I was already happy I did something and it worked at once!!!

    Is there a simple way to use HC2 devices in HC3 than I can test also Aeotec?

    I dont want to ex- and included want everything is working smoothley.

    //Sjakie

    Link to comment
    Share on other sites

    1 hour ago, jgab said:

    Don't you get a disconnect message on the HC3?

    no. empty.

    what is event?

    Link to comment
    Share on other sites

    2 hours ago, 10der said:

    do you know how to re-conect to MQTT after rebooting MQTT server?

    so, when i restart my MQTT server on rpi HC3 lose connection.

     

    1 hour ago, jgab said:

    Don't you get a disconnect message on the HC3?

    I've been toying with this but did not keep my notes :(

     

    IIRC you have 2 separate related issues, there is "keep alive" which is a kind of ping between server and client, so it can detect a disconnect after some time and restart the connection.  That's what @jgabmentioned. And when you post a message to a dead connection there has to be some kind of event.

     

    There's a 3rd possible issue but it is the opposite, a client disconnecting ungracefully. To handle that there is a mechanism called "last will".

     

    Please login or register to see this link.

     

    Link to comment
    Share on other sites

    we, (the company i work for) just started Quick Apps web page, with already some QAs available. The page is mainly for customers/developers who speak german, there will be in 1-2 days as well translated QA guide available. 

    Wir, (die firma für die ich arbeite) haben gerade eine Quick Apps-Webseite gestartet, auf der bereits einige QAs verfügbar sind. Die Seite richtet sich hauptsächlich an Kunden / Entwickler, die Deutsch sprechen. In 1-2 Tagen wird auch ein übersetzter Quick Apps Leitfaden verfügbar sein.

     

    Please login or register to see this link.

     

    Not everything is paid content, and we still testing / thinking what is the best way to provide some QA help to customers / installers, to allow us to spend some time on development and on the other hand to not give you guys the feeling "give me your money". 

     

    Nicht alles ist ein kostenpflichtiger Inhalt, und wir testen / überlegen immer noch, wie wir Kunden / Installateuren am besten Quick Apps Hilfe bieten können, damit wir einige Zeit für die Entwicklung investieren können und andererseits nicht das Gefühl geben "gib mir dein Geld ".

     

    As Fibaro Trainer i know how many installers and customer in germany need dedicated support in german language, however support costs money and time. With shared content the TCO drops of course, and i think everybody knows that there is nothing wrong with app stores.

     

    Als Fibaro Trainer weiß ich, wie viele Installateure und Kunden in Deutschland dedizierten Support in deutscher Sprache benötigen, aber Support kostet Geld und Zeit. Bei gemeinsam genutzten Inhalten sinken die Gesamtbetriebskosten natürlich, und ich denke, jeder weiß, dass an App Stores nichts auszusetzen ist.

     

     

    • Like 4
    Link to comment
    Share on other sites

    @petergebruers thank you but I know how work MQTT

     question was how to develop this behavior! How to add option for pinging / reconnection or how to set callback on disconnected evened 

    Link to comment
    Share on other sites

    Transfer string from a QA

    Hello
    I would like to transfer a string or a linked variable from a QA.
    I only get integers with this.
    self: updateProperty ("value", 54)
    How does something get transmitted?

    Example to illustrate what I want
    self: updateProperty ("value", "Hello world")
    self: updateProperty ("value", {"A1", true, 54})
    Edited by FBerges
    Link to comment
    Share on other sites

    just created another one QA, this time for a gate controller ( com.fibaro.baseShutter ). As this one is not (yet) docummented type, i share my observation:

     

    - there is no value for position, however one can still use it for own property (e.g. QuickApp:setValue will work)

    - one need to use "state", with proper formating:

    Please login or register to see this code.

    this give us some nice icons on HC3 UI (and the latest 1.8.0 app!)

     

    Please login or register to see this image.

    /monthly_2020_07/image.png.76ba31a709636a56d5997fccaef9e59d.png" />

     

    image.png.ec166b40f5aa92ac3c4465685fd368ba.png

     

    image.png.6a8f1bcc58f1b08c5f0036b57053008f.png

     

    - Step by Step (the arrow up - stop - arrow down) can be used by catching "step"

    Please login or register to see this code.

    - if your gate controller support "partialopen", one can use it as well

     

    Please login or register to see this code.

     

    - to allow partialopen and/or stepbystef, interface need to be added while init

     

    Please login or register to see this code.

     

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

    That sounds good, but how do I create a QA with the type "com.fibaro.baseShutter"
    If I want to create a new QA, I don't see anything like that.
    The QA types are anything but a "com.fibaro.baseShutter"
    can you send me an empty QA with the type?
    Or better explain how I create it.
    Greetings Frank

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