Presence connector

Hello, I'm a new C-8 user. This thing is really cool. How did I not know about all this long ago? :wink:

Platform version: 2.4.1.167

I deep dived into it this weekend and got all my bits and pieces working very nicely. 3000 sq foot mesh. Smart plugs, bulbs, door/window sensors, alarm lights and sirens, etc.

There were a few odd little UI bugs in the Hubitat web UI, but no significant showstoppers.

I'm almost done, and I was testing my logic for arrival/departure state changes (which worked very well in my initial real world test (leaving my geofence area and coming back) once I got past a tricky bug relating to setting up the geofence area, but then I found this Virtual device in Devices > Virtual > System > "Connector Presence Sensor". Based on some of what I've read, I presume it's a virtual switch that is intended to expose the "presence" state of my iPhone and allow me to switch the state?

But when I add this Presence Sensor Connector and then go to Device Details > Commands and send it a Departed or Arrived command, I get this in this logs:

dev:242025-05-04 08:49:43.853 PMerrorjava.lang.NullPointerException: Cannot invoke method setGlobalV() on null object on line 39 (method arrived)
dev:242025-05-04 08:49:43.842 PMinfoPresenceConnector arrived
dev:242025-05-04 08:47:51.737 PMerrorjava.lang.NullPointerException: Cannot invoke method setGlobalV() on null object on line 46 (method departed)
dev:242025-05-04 08:47:51.674 PMinfoPresenceConnector departed

The Presence Connector 'presence' state seems to change successfully when I send the commands - it's logged as such, but...nothing happens. My Rule Machine triggers don't fire, and I'm quite certain the logic in the rule is sound...so it doesn't actually seem to be working. But I'm not really sure if this is the correct device type for this use case?

My Rule Machine rule for toggling the state of things is as per the screenshot (leveraging a 'haveArrived' global to compare the current presence state to the phone's state).

Is the java error a known issue?

Is there a way to do what I'm trying to do? (simulate the iPhone departing/arriving)

Thank you,
Bryan

(oops - the forum won't let me upload a screenshot :sob:)

Here's a hideous text copy of the rule information I was hoping to trigger via the 'presence connector':

### **Departed - set NOT haveArrived**: Define Required Expression
### The Expression defined here must be TRUE for the Triggers to run Actions

Variable haveArrived(true) is = true(T) [TRUE]

### **Departed - set NOT haveArrived**: Select Trigger Events (ANY will trigger)

|Trigger Event|Stays|Disabled||
| --- | --- | --- | --- |
|iPhone11ProMax reports departs|0:00:30|||

### **Departed - set NOT haveArrived**: Actions

||Actions for **Departed - set NOT haveArrived** *Disabled Action*||||+||*clear*|*βœ‚*||
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
||Set haveArrived to false||||**οΌ‹**|||*βœ‚*||
||*Delay 0:00:05*||||**οΌ‹**|||*βœ‚*||
||On: Alarm Status||||**οΌ‹**|||*βœ‚*||
||Notify iPhone11ProMax: 'Alarm Enabled'||||**οΌ‹**|||*βœ‚*||
||On: Motion Notify||||**οΌ‹**|||*βœ‚*||
||Notify iPhone11ProMax: 'Motion Notify Enabled'|

Just to confirm, you manually created a virtual device and assigned this driver to it? That won’t work for using your phone as a presence sensor.

You can use the Hubitat mobile app on your phone for this purpose though. See this documentation article on how to set that up.

Once configured, a virtual device representing your iPhone will be created for you.

you manually created a virtual device and assigned this driver to it?

I didn't assign a driver. I manually created the device, and in Device Info it says "Type: Connector Pesence Sensor"

Is that incorrect? Do I need to assign a different driver?

I'll check out that doc also. Thanks! :blush:

Ok I read that article, but it doesn't really cover my question. I already got geofencing working and tested the iPhone by physically departing the geofence area and coming back/arriving. That's all working. Then later I added logic for things to auto-occur when I depart (enable alarm, enable motion notification) or arrive (disable alarm, disable motion notification), and I didn't want to have to keep leaving the house to test the rules. Was hoping the connector would allow me to just click a button to simulate the phone departing/arriving?

I see. I changed the "type" to Virtual Presence and now it's not logging that java error. So I guess I just need to substitute this control for the iPhone to test the rules? I was thinking the 'presence connector' would be like an override on whatever the iPhone was reporting.... :thinking: ...I'm probably wrong to think that...

If you are trying to create devices to manually manipulate, you normally want the built-in "Virtual..." drivers or some other, perhaps custom, driver built for a similar purpose.

The "connector" drivers are not intended for use with manually created devices but rather hub variable connectors, which the platform will assign to these devices if you create such a device in the UI (also not normally the best idea anymore but still there if you really have a use case for a connector). That is why you were getting errors.

Got it. I realize now I was obviously overthinking it. I could just make a virtual switch to stand in as an alternate trigger for the iPhone presence state. Everything worked. Just needed somebody to talk me down from a mental cliff. Thank you! :sweat_smile:

1 Like