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


  • 0

My QuickApp Gate Controller using rest calls keeps dying on the mobile interface - yubii


Question

Posted (edited)

I made the mistake of buying the wrong model of the Nice Gate controller - it doesnt interface with Fibaro. It only has one input, the rest are coded.

 

To make everything work I have cannibalized one remote and attached it to a raspberry pi with relays.  This is working fine.  But the QA on Yubii seems to crash when being used, and I have to go back and open the QA again.

 

I suspect that I should be creating the HTTPClient class when required instead of creating it at startup.  If so, I don't know how to free it when done.

 

Please login or register to see this code.

 

  1. Lock/Unlock address a separate Fibaro relay that kills power to the Gate Controller. 
  2. The interface has 5 buttons - Open, Close, Pedestrian, Lock and Unlock.
  3. And there is only one variable Address  which is the ipaddress of the Pi.

 

What have I stuffed up ?

Edited by RohitNz

2 answers to this question

Recommended Posts

  • 0
Posted (edited)

Bug in

function QuickApp.Show_Gate_Status (Msg) 
  self:updateView ('lblStatus', 'text', Msg) 
end

should be QuickApp:Show_Gate_Status or you can't call self. (the colon)

 

In the post function you send

data='text'

which is strange... it should probably be different depending on what remote api you call?

 

In many places you call Show_Gate_Status (...)

should be

self:Show_Gate_Status (...) as it is a QuickApp: defined method

 

Update_Gate_Status(...) and Update(...) are undefined functions

 

In general, Lua bugs affect the QA running on the HC3 - the Yubi app only reflect the "web UI" of the QA

Edited by jgab
  • 0
  • Inquirer
  • Posted
    2 hours ago, jgab said:

    Bug in

    function QuickApp.Show_Gate_Status (Msg) 
      self:updateView ('lblStatus', 'text', Msg) 
    end

    should be QuickApp:Show_Gate_Status or you can't call self. (the colon)

     

    In the post function you send

    data='text'

    which is strange... it should probably be different depending on what remote api you call?

     

    In many places you call Show_Gate_Status (...)

    should be

    self:Show_Gate_Status (...) as it is a QuickApp: defined method

     

    Update_Gate_Status(...) and Update(...) are undefined functions

     

    In general, Lua bugs affect the QA running on the HC3 - the Yubi app only reflect the "web UI" of the QA

    Thanks.  I must remember not to edit in the browser, and use a proper editor. Then search and replace would have fixed most of those errors.  The colon versus the dot is a bugger.  Because I mostly program in Delphi, where the dot is used for both methods and fields.  The biggest issue is that if it crashes inside a function, you normally get nothing in the log.  Can't test it right now, as it's late and the pi can't go by the gate until the 3d printer has finished making a case for it.

     

    The data='text'  is fine as there is no exchange of data as such and there was no point in encapsulating things in json.  I was struggling with the pi programming as it was.

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Answer this question...

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