nitaybz / homebridge-network-presence

Homebridge plugin that provides occupancy sensor for devices presence in your network
MIT License
41 stars 6 forks source link

Network Presence not working on macOS #8

Open bobybob69 opened 3 years ago

bobybob69 commented 3 years ago

Hi everyone

Hope you're well. I heard about your plugin long time ago, and I tried to install it and set it today :)

I'm running HomeBridge instance with Homebridge UI . I've install your plugin by taping the plugin name in the plugin tab of the UI . I've install it , everything goes well. Running on macOS Catalina 10.15.7 on a Mac mini.

However, the sensor aren't triggered . I've try to set IP tracking or even MAC ADRESS, nothing works.

I've try to set Airplane mode to trigger the accessories, but nothing happen.

Do you know what could be the problem ?

I've attache some picture to help you understand what could happen.

Thanks

Config module

    {
        "platform": "NetworkPresence",
        "debug": false,
        "interval": 10,
        "threshold": 10,
        "anyoneSensor": true,
        "devices": [
            {
                "name": "Loris",
                "mac": "XXXXXX",
                "threshold": 10
            },
            {
                "name": "Vanessa",
                "mac": "XXXXXX",
                "threshold": 10
            }

Home sensor showing

homebridge accessories
nitaybz commented 3 years ago

This plugin should run well on Mac OS... if you're using iPhone I suggest making sure you're using the correct mac address because iPhone settings can change mac addresses to prevent tracking... when connected to your home wifi, please refer to your home wifi settings in the iPhone and make sure "Private Address" is not checked.

Also I've released v1.2.0 that includes some optimization in the network scanner so it might solve the issue... but no promises here.

bobybob69 commented 3 years ago

Hi @nitaybz

Thanks for your answer, I've anticipate this point and disable the "Private Address" under network setting on iOS.

I'll try to update the module and let you know if anything has changed.

Thanks for your help

bobybob69 commented 3 years ago

@nitaybz do you think their is a difference between

BT:55: etc.. and bt:55: etc .. ?

On iOS Wi-Fi Address is marked in capital, on your model, you mark the Mac Address in minus.

I'll try to troubleshoot differently and let you know if anything change

Thanks !

nitaybz commented 3 years ago

Use lowercase to test it... but I'm lowering the case in the plugin if it's not... anyway it's worth testing both ways

bobybob69 commented 3 years ago

it didn't change anything even with lowercase ..

Bellow is the log from homebridge when it launch the module.

Compare to other log I've seen on the web, it look like the module didn't found anyone..

[12/29/2020, 7:03:06 PM] Loading 7 platforms... [12/29/2020, 7:03:06 PM] [Config] Initializing config platform... [12/29/2020, 7:03:06 PM] [Config] Running in Service Mode [12/29/2020, 7:03:06 PM] [eDomoticz] Initializing eDomoticz platform... [12/29/2020, 7:03:06 PM] [Melcloud] Initializing Melcloud platform... [12/29/2020, 7:03:06 PM] [Melcloud] Fetching Melcloud devices... [12/29/2020, 7:03:06 PM] [Nest] Initializing Nest platform... [12/29/2020, 7:03:06 PM] [NeatoVacuumRobot] Initializing NeatoVacuumRobot platform... [12/29/2020, 7:03:06 PM] [NeatoVacuumRobot] Refresh is set to: auto [12/29/2020, 7:03:06 PM] [Harmony Hub] Initializing HarmonyHubWebSocket platform... [12/29/2020, 7:03:06 PM] [Harmony Hub] HarmonyPlatform Init [12/29/2020, 7:03:06 PM] [NetworkPresence] Initializing NetworkPresence platform... [12/29/2020, 7:03:06 PM] [eDomoticz] synchronizeAccessories in progress... [12/29/2020, 7:03:06 PM] [Nest] Fetching Nest devices. [12/29/2020, 7:03:06 PM] [Harmony Hub] DidFinishLaunching [12/29/2020, 7:03:06 PM] [Harmony Hub] (Harmony Hub)INFO - Loading activities... [12/29/2020, 7:03:06 PM] [NetworkPresence] Initiating Network Scanner... [12/29/2020, 7:03:06 PM] [Melcloud] ContextKey: XXXXX [12/29/2020, 7:03:06 PM] [Melcloud] Found device: Chambre [12/29/2020, 7:03:06 PM] [Melcloud] Found device: Salon

bobybob69 commented 3 years ago

What can I do to help you check if the module is launching properly and if it try to reach the network to scan it ?

nitaybz commented 3 years ago

Set debug logs to true in the plugin settings and send me the logs of the initialization of homebridge

nitaybz commented 3 years ago

also please try and run this command in the terminal and see if it works and gives you a list of IPs and their mac addresses: arp -a

bobybob69 commented 3 years ago

Hi @nitaybz Thanks for your answer

Bellow are the logs from the debug mode :

[12/30/2020, 7:04:24 PM] [Homebridge UI] Changes to config.json saved. [12/30/2020, 7:04:27 PM] [Homebridge UI] Homebridge restart request received [12/30/2020, 7:04:27 PM] [Homebridge UI] UI / Bridge settings have not changed; only restarting Homebridge process [12/30/2020, 7:04:27 PM] [HB Supervisor] Sending SIGTERM to Homebridge [12/30/2020, 7:04:27 PM] Got SIGTERM, shutting down Homebridge... [12/30/2020, 7:04:27 PM] [Harmony Hub] INFO - shutdown [12/30/2020, 7:04:32 PM] [HB Supervisor] Homebridge Process Ended. Code: XX, Signal: null [12/30/2020, 7:04:37 PM] [HB Supervisor] Restarting Homebridge... [12/30/2020, 7:04:37 PM] [HB Supervisor] Starting Homebridge with extra flags: -I [12/30/2020, 7:04:37 PM] [HB Supervisor] Started Homebridge v1.2.5 with PID: XX [12/30/2020, 7:04:37 PM] Loaded config.json with 0 accessories and 7 platforms. [12/30/2020, 7:04:37 PM] --- [12/30/2020, 7:04:37 PM] Loaded plugin: homebridge-config-ui-x@4.36.0 [12/30/2020, 7:04:37 PM] Registering platform 'homebridge-config-ui-x.config' [12/30/2020, 7:04:37 PM] --- [12/30/2020, 7:04:38 PM] Loaded plugin: homebridge-edomoticz@2.1.38 [12/30/2020, 7:04:38 PM] Registering platform 'homebridge-edomoticz.eDomoticz' [12/30/2020, 7:04:38 PM] --- [12/30/2020, 7:04:38 PM] Loaded plugin: homebridge-harmony@1.4.1 [12/30/2020, 7:04:38 PM] Registering platform 'homebridge-harmony.HarmonyHubWebSocket' [12/30/2020, 7:04:38 PM] --- [12/30/2020, 7:04:38 PM] Loaded plugin: homebridge-melcloud@0.3.4 [12/30/2020, 7:04:38 PM] Registering platform 'homebridge-melcloud.Melcloud' [12/30/2020, 7:04:38 PM] --- [12/30/2020, 7:04:38 PM] Loaded plugin: homebridge-neato@0.7.2 [12/30/2020, 7:04:38 PM] Registering platform 'homebridge-neato.NeatoVacuumRobot' [12/30/2020, 7:04:38 PM] --- [12/30/2020, 7:04:38 PM] Loaded plugin: homebridge-nest@4.5.1 [12/30/2020, 7:04:38 PM] Registering platform 'homebridge-nest.Nest' [12/30/2020, 7:04:38 PM] --- [12/30/2020, 7:04:38 PM] Loaded plugin: homebridge-network-presence@1.2.1 [12/30/2020, 7:04:38 PM] Registering platform 'homebridge-network-presence.NetworkPresence' [12/30/2020, 7:04:38 PM] --- [12/30/2020, 7:04:38 PM] Loading 7 platforms... [12/30/2020, 7:04:38 PM] [Config] Initializing config platform... [12/30/2020, 7:04:38 PM] [Config] Running in Service Mode [12/30/2020, 7:04:38 PM] [eDomoticz] Initializing eDomoticz platform... [12/30/2020, 7:04:38 PM] [Melcloud] Initializing Melcloud platform... [12/30/2020, 7:04:38 PM] [Melcloud] Fetching Melcloud devices... [12/30/2020, 7:04:38 PM] [Nest] Initializing Nest platform... [12/30/2020, 7:04:38 PM] [NeatoVacuumRobot] Initializing NeatoVacuumRobot platform... [12/30/2020, 7:04:38 PM] [NeatoVacuumRobot] Refresh is set to: auto [12/30/2020, 7:04:38 PM] [Harmony Hub] Initializing HarmonyHubWebSocket platform... [12/30/2020, 7:04:38 PM] [Harmony Hub] HarmonyPlatform Init [12/30/2020, 7:04:38 PM] [NetworkPresence] Initializing NetworkPresence platform... [12/30/2020, 7:04:38 PM] [NetworkPresence] Found Cached Accessory: Vanessa (XXX) [12/30/2020, 7:04:38 PM] [NetworkPresence] Found Cached Accessory: Anyone (12:34:56:78:9a:bc) [12/30/2020, 7:04:38 PM] [NetworkPresence] Found Cached Accessory: Loris (XXX) [12/30/2020, 7:04:38 PM] [eDomoticz] synchronizeAccessories in progress... [12/30/2020, 7:04:38 PM] [Nest] Fetching Nest devices. [12/30/2020, 7:04:38 PM] [Harmony Hub] DidFinishLaunching [12/30/2020, 7:04:38 PM] [Harmony Hub] (Harmony Hub)INFO - Loading activities... [12/30/2020, 7:04:38 PM] [NetworkPresence] Initiating Network Scanner... [12/30/2020, 7:04:38 PM] [NetworkPresence] Adding "Loris" Occupancy Sensor Service [12/30/2020, 7:04:38 PM] [NetworkPresence] [Loris] - Listening to Mac: XXX [12/30/2020, 7:04:38 PM] [NetworkPresence] Adding "Vanessa" Occupancy Sensor Service [12/30/2020, 7:04:38 PM] [NetworkPresence] [Vanessa] - Listening to Mac: XXX [12/30/2020, 7:04:38 PM] [NetworkPresence] Adding "Anyone" Occupancy Sensor Service [12/30/2020, 7:04:38 PM] [Melcloud] ContextKey: [12/30/2020, 7:04:38 PM] [Melcloud] Found device: Chambre [12/30/2020, 7:04:38 PM] [Melcloud] Found device: Salon [12/30/2020, 7:04:38 PM] Initializing platform accessory 'Chambre'... [12/30/2020, 7:04:38 PM] Initializing platform accessory 'Salon'... [12/30/2020, 7:04:39 PM] [Harmony Hub] (Harmony Hub)INFO - Adding Accessory : Harmony Hub-TV [12/30/2020, 7:04:39 PM] [Harmony Hub] (Harmony Hub)INFO - configuring Main TV Service [12/30/2020, 7:04:39 PM] [Harmony Hub] (Harmony Hub)INFO - Creating TV Service [12/30/2020, 7:04:39 PM] [Harmony Hub] (Harmony Hub)INFO - Configuring Main Activity Regarder Apple TV [12/30/2020, 7:04:39 PM] [Harmony Hub] (Harmony Hub)INFO - Creating TV Speaker Service [12/30/2020, 7:04:39 PM] [Harmony Hub] (Harmony Hub)INFO - Creating Input Service - Regarder Apple TV [12/30/2020, 7:04:39 PM] [Harmony Hub] (Harmony Hub)INFO - Creating Input Service - PlayStation 5 [12/30/2020, 7:04:39 PM] [Harmony Hub] (Harmony Hub)INFO - Creating Input Service - Xbox Serie X [12/30/2020, 7:04:39 PM] [Harmony Hub] (Harmony Hub)INFO - setupFoundAccessories - TV accessory added as external accessory [12/30/2020, 7:04:39 PM] Harmony Hub-TV is running on port. [12/30/2020, 7:04:39 PM] Please add [Harmony Hub-TV 18C2] manually in Home app. Setup Code: [12/30/2020, 7:04:40 PM] [NeatoVacuumRobot] Found robot #1 named "Aspiro" with serial "GPC30619-XXXXXXXXXXXX" [12/30/2020, 7:04:40 PM] [NeatoVacuumRobot] Added cleaning device named: Aspiro [12/30/2020, 7:04:40 PM] Initializing platform accessory 'Aspiro'...

nitaybz commented 3 years ago

Can you try what I suggested recently?

bobybob69 commented 3 years ago

I can see their is something that try to listen to something, however, status in HomeKit didn't change

When taping the terminal command, I got a list of product from my network. I can see both iPhone I would like to track

What are you looking for ?

bobybob69 commented 3 years ago

? (IP Address) at dc:52:XX:XX:XX:XX on en1 ifscope [ethernet] ? (IP Address) at dc:52:XX:XX:XX:XX on en0 ifscope [ethernet]

? (IP Address) at 74:b5:XX:XX:X:XX on en1 ifscope [ethernet] ? (IP Address) at 74:b5:XX:XX:X:XX on en0 ifscope [ethernet]

bobybob69 commented 3 years ago

@nitaybz

Just in case as I didn't mention those version

Node v12.18.0 NPM v6.14.7

nitaybz commented 3 years ago

So arp is working on your Mac and detecting the address you need... I really wonder why it's not working...

I'll have to put in some more logs so we will be able to see what's going on inside.

Will get back to you for further testings

bobybob69 commented 3 years ago

ok mate thanks ! 🙏

Waiting for your further instructions

Thanks for your help

bobybob69 commented 3 years ago

hey @nitaybz

First of all wish you a great 2021 ! hope it will be better than 2020 .. not too difficult 😆 . Health as a priority for everyone :)

Just wanted to let you know that I've notice my Mac mini was connected both over ethernet and WiFi. I remove the wifi connection , so now the Mac is only connected over ethernet.

I've re-set the plugin but it didn't work .

also I've update Xcode and install extra package. It didn't change anything.

I've install your plugin throughout the Plugin interface, not by terminal. Maybe it change something regarding the right for the installation ?

Don't know.. thanks for your time !

bobybob69 commented 3 years ago

@nitaybz Hey mate how are you ? Any updates regarding this issue on macOS ?

Thanks for your help :-)

bobybob69 commented 3 years ago

Hi @nitaybz hope you're well Anything to do regarding this issue ? Thanks mate for your support

bobybob69 commented 3 years ago

Hi @nitaybz , hope you're well since our last exchange. Do you have updates regarding the issue related to your plugin not working on macOS ? you told me some enhancement were on the way to increase the reliability of the module. Thanks for your support mate !