This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.

The Homey Community has been moved to https://community.athom.com.

This forum is now read-only for archive purposes.
Closed

Status of IP device as input

Hi all,

Are there any thoughts on creating something like the status for a IP device as input?

This would allow me to check if for example the WoL command was successful and with the boolean statement execute a set number of retries. A simple version could be based on the result of a simple ping command.

A more advanced version would be able to trigger a flow if a device just went up or down.

Cheers!

Comments

  • I would like something like that also. 
    That way you don't need to have the app installed on a phone to know someone is home. The app is ok for a family but I don't want to force 'visitors' to create an account and install an app... 
  • IP is OK until it's static. basic ping could be enough (using net-ping npm package) or more advanced action trying to connect to tcp port.

    for visitors you don't know what IP they'll receive. So it would be better to check MAC.

    so you would have multiple 
    triggers
    - device comes online
    - device goes offline
    conditions
    - is online

    because there are multiple options how to detect presence, I suggest create each card for each option
    - IP (ip address argument); uses ping
    - MAC (mac address arg.); uses arp scan (not that accurate)
    - Service (ip, port); tcp connect

    so there are 6 triggers and 3 conditions. Thoughts?
  • Would love this to be able to tell who's home!
  • Fiddling around with determine presence in the past I advice to include a 'is offline for x minutes' trigger. Lots of devices goes to sleep from time to time. I learned from this little blog article back then:
    article 'How-to: Presence detection based on Wi-Fi' 
  • I am planning to start working on this. Is anybody else already working on this?
    For starters I'll just create a simple ping method (due Homey limitations for native extensions).
    Later I am planning to add connection with external service which does arpscan+discover.

    Thoughts?
  • MatjaLipu said:
    I am planning to start working on this. Is anybody else already working on this?
    For starters I'll just create a simple ping method (due Homey limitations for native extensions).
    Later I am planning to add connection with external service which does arpscan+discover.

    Thoughts?
    I think that just the fact that someone will be working on it will be a great start!!! There's always room for improvement!
  • Great idea! Personal flows could be triggered. Using the MAC adress could also work the other way around? If Homey knows the mac adress it should be able to get the IP? Perhaps adding them instantly to some sort cloud inside a home? Or am i getting ahead of myself :blush: 
  • yeah.. getting IP from mac is possible. usually arp is used, but haven't found pure js library for arp scan. That's why idea of external service (like raspberry pi with arp-scan).
  • After started working on this I discovered pinging hosts from Homey is not possible due two limitations
    - node native extensions are not allowed
    - sending ICMP/ping requires root privileges (ping binary has setuid flag)

    After this discovery there are two posibilities.
    - moving ping/arpscan to external service/device such as raspberry pi
    - detect presence with TCP connect (can detect only devices with open ports/services)

    I will continue with first option, since second can not detect phones.
  • MatjaLipu said:
    After started working on this I discovered pinging hosts from Homey is not possible due two limitations
    - node native extensions are not allowed
    - sending ICMP/ping requires root privileges (ping binary has setuid flag)

    After this discovery there are two posibilities.
    - moving ping/arpscan to external service/device such as raspberry pi
    - detect presence with TCP connect (can detect only devices with open ports/services)

    I will continue with first option, since second can not detect phones.


    you are doing this because you dont agree with the way homey is checking for presence ?
  • Presence is currently limited only to android devices with Homey app. I want to detect presence for other devices.
    Maybe later including BLE.
  • I've just pushed initial version of presence tracking app. It's standalone node app meant for supporting limiting Homey environmnet.
    Currently it support ARP ping presence detection with REST API & pluggable architecture (eg. iBeacon).
    Next I am creating Homey app which will consume this presence tracker.

    https://github.com/matjaz/presence-tracker

    Feedback welcome!
  • MatjaLipuMatjaLipu Member
    edited March 2016
    I've released Better Presence app.
This discussion has been closed.