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

Help! Problem to obtain the list interfaces ethernet/WLAN connectios witch api.get command


Question

Posted

I'm having trouble getting the list of network connections from my HC3. I use the api.get("/settings/network/connections") command, but it doesn't return the list in table format. I should mention that I'm connecting remotely to the HC3. I think that the URL is not well but i am not sure. Could anyone help me? Any help would be appreciated. Thanks in advance!

 

Please login or register to see this attachment.

6 answers to this question

Recommended Posts

  • 0
Posted (edited)

Please login or register to see this code.

 

in quickapp you can use:
 

Please login or register to see this code.

 

Edited by lux
  • Like 1
  • 0
Posted

Hi @Herni,

 

I use this code to check existing gateway connections and get IP address:

Please login or register to see this code.

Note that above code works on both HC3, HC3L and Yubii home.

To check connection to the internet:

Please login or register to see this code.

Above code is simplified. My is a bit more complex because it stores time when internet went offline and time when internet get back online etc.

  • Like 2
  • 0
Posted

@Sankotronic Yours is more easy:
 

Please login or register to see this code.

 

  • Like 1
  • 0
Posted

/settings/network/connectivity works well, but can be a bit slow to update. If you are in a hurry try to connect yourself to a known endpoint.
The problem with ip address is that we in theory can have more than one. I usually use something like this
 

Please login or register to see this code.

It returns the ip and true if found I/F matching and otherwise returns a I/F enabled and false.

Usually one wants the (lowest) wlan enabled, but some user may have eth.

 

@Sankotronic, your version seems a bit strange, the first if branch is always true (if net.networkConfig.eth0~=nil) and will then give wlan0 if eth0 not enabled. The other branches are dead code.
In theory a wlan/eth I/F could be enabled but not have an address if something went wrong with dhcp...

  • Like 2
  • 0
  • Inquirer
  • Posted

                  Hi guys,

     

                 Thank you so much for yours responses. I really appreciate it very much. The problem was the sintax of the URL of api.get() command. Thanks guys!! :) 

    • 0
    Posted
    On 10/5/2025 at 9:34 AM, jgab said:

    Please login or register to see this code.

    Hello @jgab

    Would you allow me to use your code for getting the Box IP in my next QA ?

    I will credit you of course.

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