Device connected to wifi vera

I would like to get devices connected to vera security wifi trough LUA code. I need know how many devices are connected to understand if someone is at home. Has anyone already tried to access vera’s wifi? Could you help me? Thanks, Martina

Hello @CoatOnlus
There are some useful ways to retrieve the network information from your Vera’s access point via SSH. One of them is by discovering all the online devices in the network with:

for ip in $(seq 100 254); do ping -c 1 10.10.1.$ip; done

And then list them with

cat /tmp/dhcp.leases

Another option is listing arp table and DHCP-leases:

for ip in $(arp | grep -v IP | awk '{print $1}'); do 
    grep $ip /tmp/dhcp.leases; 
done

We’ll remain available in case you have additional questions.

Thank you very much Elisa, it works!
After print the data get from this command in a file, there is the possibility to read them with LUA code in order to insert in a scripting routine?

Hello @CoatOnlus

Based on what you initially described wanting to do, I believe you should download the plugin “Network Monitor ( NetMon )

You can install it by accessing the controller from home.getvera.com → Apps → Install apps → Type Network Monitor on the search bar.

After installation, you will notice that there will be a new device under your Device List.

image

Hit on the ‘Arrow Icon’ pointing to the right to access its settings.
Click on ‘Settings’ on the top → and start adding the IP addresses of the devices connected to your local network.

After saving that information you will see them all under your Device List as virtual motion sensors.

image

You can also check their current status under the Status page.

The idea is to find out the availability of your networking devices by pinging them.
I think you could use those virtual motion sensors in your scenes as well.

Note:

If the ping test is okay, the virtual motion sensor will appear “not tripped”.
but if the ping test is not okay, the virtual motion sensor will appear as “tripped”.

You can invert that behavior under the Settings of the plugin if it makes more sense to you that way.

Now, if you specifically need Lua code to get done what the plugin does… I believe you can go to GitHub here and write your own Lua code based on the code source for this plugin.

I hope this helps.

3 Likes

Hello @Mayker
This is very interesting app I didn’t see it.
I solve the issue,
Thank you

1 Like

Best Home Automation shopping experience. Shop at getvera!

© 2021 Ezlo Innovation, All Rights Reserved. Terms of Use | Privacy Policy | Forum Rules