snOOrz / homebridge-aqara

HomeBridge plugin for Aqara gateway and devices
536 stars 74 forks source link

Sensor Trigger Notifications not shown outside of local network #68

Open magichew opened 7 years ago

magichew commented 7 years ago

Thanks for the plug-in. You've made outfitting the whole house with sensors much more affordable by being able to use these inexpensive sensors but I have an issue which I've searched for in the Open and Closed issues but no one seems to have seen this before.

When I'm on my home WIFI network I receive notifications via the Home app that sensors have been triggered i.e. "Front Door was Opened", "Front Door was Closed" but when I leave my home WIFI network I no longer receive notifications from HomeKit. Mi app does send them.

I still have a connection to my Home via Apple TV and I have tested by using my data connection on my phone rather than my WIFI connection and I am able to turn lights on and off.

I believe that not only do I not receive notifications, Automations that I have set to react to the sensors are also not executed.

Has anyone else seen this behaviour before?

Interesting, just as I'm typing this I opened the Home app and a notification from Home app slid down from the top of the screen to say "Front Door was Closed" with a time stamp of "Now". This isn't true, it was more like 10 mins ago that I last closed the front door.

magichew commented 7 years ago

I believe that not only do I not receive notifications, Automations that I have set to react to the sensors are also not executed.

This isn't correct. The automations happen just as they should whether I be on local or remote network with my device so that part is fine.

The issue then is the lack of notifications from HomeKit when on a remote network.

uqc commented 7 years ago

Hello, you might need a home hub at home when you outside. Regards.

magichew commented 7 years ago

Are you referring to setting up Home on Apple TV or iPad. If so I have that set up and like I say all functions for controlling lights and such work remotely, just not notifications...

astrojetson8 commented 7 years ago

@magichew can you try this, turn off iphone wifi and see if you can control your devices? see if it works all the time, and of you experience any latency. also, what version of homebridge are you using? and other plugins?

i've similar issue so i'm trying to isolate whats causing this.

magichew commented 7 years ago

@astrojetson8 Yes I've tried this already as mentioned above.

All other HomeKit/Home app features work as expected on a remote network, I can turn lights on and off and the automations work (lights come on when front door opens) I just don't get the notifications that the door has been opened or closed. I have a body sensor too and same applies.

It's exactly the same performance as on WIFI (very little latency) when turning bulbs on and off or automations kicking in.

The issue is that notifications do not come through when on a remote network.

Interestingly, this morning I opened and closed my front door to leave the house (still on WIFI network) and I got two pairs of notifications for this.

I believe this morning's notifications on the WIFI network pushed through one pair of open and close notifications from last night when I came through the door and didn't receive notification as I hadn't joined the home WIFI network.

astrojetson8 commented 7 years ago

@magichew for me, at times there is latency when i'm not on my wi-fi network from few seconds to up to a minute.

for example, i just tested this for you, i got door open notification instantaneously and i got door closed notification almost a minute later. Maybe someone can provide how polling for aqara works.

I think, it would be best if you also post your question in homebridge forum as they can explain how it all works because multiple platforms are involved

fyi, I use mi app for automation and notification which has been 100% reliable for me. More over mi app has lot more advanced automation but it lacks few things and some interactions are still in Chinese.

astrojetson8 commented 7 years ago

@magichew i see what you mean now. i got multiple notifications for door and sometimes it was delayed by up to 10minutes.

magichew commented 7 years ago

I've been getting them early hours of the morning. I have my router reboot at 0400 and it seems some notifications get sent through at this time.

magichew commented 7 years ago

The homebridge-mijia plugin sends notifications both on remote and local networks. Currently away from home and I'm getting notifications from both door and motion sensors via Home app with notifications enabled.