Is it not possible to create a RULES API that works when the device is offline?

Since my family lives outside with mobile data turned off, I can’t track their location, so I can’t create related automations. Is there a way to create automations that work when the smartphone is offline?

Hi, @blueprint
Do you mean if it’s possible for automations that use members’ location as a condition to work even when their mobile device is offline?

I mean the one highlighted here:

Currently, the only routines that would run locally are those with Hub-Connected devices.
In the case of the location service, it requires Internet access to update its geolocation, otherwise, the location will have the info of the last position of the device before it went offline.

Local routine execution has a new feature that is in beta testing now. The new hub firmware should be released soon. Check out the conversation at:

The feature can run routines when the hub and some devices are offline. But it may not address your specific question. Your phone is currently not a device that the hub can manage (i.e. add ‘phone’ device to hub) to get the current state (online, offline). However, that’s an interesting idea and will ask about it as a future enhancement.

A community member has created a project that can identify when a specific phone has connected to your local Wi-Fi. It can only work with some Wi-Fi routers, however. but it should be able to work even if you don’t have an active Internet connection.

You would need to have another laptop or raspberry pi running as a server on your local network, so it is definitely more complicated than just another presence device. But there are quite a few community members using it.

Start here for information:

[ST Edge] LAN Device Monitor - #47 by TAustin



It has long puzzled me why the mobile devices are limited to being presence sensors. They used to also be occupancy sensors but, although it seemed to be related to wi-fi connectivity, it was never clear exactly what the occupancy represented and regardless of what it was the integrations tried to rather unnecessarily do the users’ thinking for them and combine the two.

It seems to me that between the phone and the backend it should be possible to know the current connection status of the device. It should be possible to report its battery level. It should be possible for the phone to report that it is connected to nominated wifi networks or bluetooth devices (it doesn’t even need to communicate which ones they are, it can use an anonymous binary attribute like occupancy). It should be able to communicate its precise geolocation too - I’ve never understood why this is considered to be a privacy issue when showing its location on a map, however crap, isn’t.

I am sure much of the above can be handled using things like Tasker on Android if that floats your boat, but it just seems that it shouldn’t need to be.

1 Like