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

Get IP Address from MAC Address


Question

Posted

Hi,

 

Say that I know the MAC address of a specific device I have and I want to retreive the IP Address. How can I retreive it using LUA? 

  • Answers 46
  • Created
  • Last Reply

Top Posters For This Question

Recommended Posts

  • 0
Posted
15 minutes ago, AutoFrank said:

@samuel

you could also take a look at the vd code for the network device monitor here 

 

 

It uses labels to display online/ offline status although it is derived a different way....

 

 

i do have this one, but not all devices do have a port, so by arp table is another way to do so.

that's why i was asking

 

 

  • 0
Posted
24 minutes ago, samuel said:

i do have this one, but not all devices do have a port, so by arp table is another way to do so.

that's why i was asking

 

I agree... The ARP approach looks promising for devices that have a permanent IP address (any IP address). It also works if you use DHCP, because devices almost always use the same MAC address. But it still does not work with all phones...

  • 0
Posted
47 minutes ago, samuel said:

i do have this one, but not all devices do have a port, so by arp table is another way to do so.

that's why i was asking

 

sorry for confusing the issue @samuel, I wasn't suggesting that you use the solution but you could possibly look through the code to see how VD lables are updated

  • 0
Posted

ok understand, will take a look at it.

  • 0
Posted

how do i update a table tuble from a json?

 

jN.lastseen = jN.lastseen + 1 

is not working

  • 0
Posted

I guess you did not initialize the field. So your sum would be: nil + 1 and you cannot add to nil. Try this (the if tests. whether the field was initialized) :

 

if jN.lastseen then

  jN.lastseen = jN.lastseen + 1

else

  jN.lastseen = 1

end

 

If that does not help, please post a bit of code that demonstrates the issue.

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