rmoesbergen / openwrt-ha-device-tracker

OpenWRT device tracker for Home Assistant that actually works
105 stars 18 forks source link

Ethernet interface #6

Closed hyzami closed 3 years ago

hyzami commented 3 years ago

Hello I have connected to my Turris other via ethernet old router that I use as AP. Is there any chance to add other interfaces to scan devices also connected over ethernet? Forward thanks for any information.

Best regards Michael

rmoesbergen commented 3 years ago

Hi @hyzami ,

The presence detector works based on hostapd ubus events. For ethernet connected devices, there's no such event in ubus, since ethernet clients don't really 'connect/disconnect' to the router, but they just happen to be in the same ethernet network. However, there's a solution in home assistant for this type of device: the device_tracker 'ping' platform:

device_tracker:
  - platform: ping
    consider_home: 60
    count: 3
    hosts:
      mydevice: 192.168.10.55

The IP can also be a hostname. Make sure that the device accepts/responds to ICMP echo requests. See also: https://www.home-assistant.io/integrations/ping/#presence-detection

hyzami commented 3 years ago

Hello @rmoesbergen Thanks a lot for your tip! I will use ping kind of tracker. I set up at home mostly static leases for devices so this should work without problems. Best regards Michael