Presence sensor with independant switch

Hi,
I just realized that the virtual presence sensor with switch toggle switch and presence together. I would like to use those capability independently. I know I could use separate switch but I would like to have the capability inside the same device.
Is anyone aware about a driver like this ? Nor maybe something to add to built in drivers?

Thanks!

You could use a Virtual Omnisensor, which has both of these capabilities -- plus likely many more you don't want -- but are all independent. Otherwise, what's the use case? The intent of this driver is to keep them together (for apps that can work with switches but not the custom presence commands), so otherwise two separate devices would normally be the best idea.

2 Likes

Has a really specific reasoning for syncing the two. Presence is a Sensor, while a switch is an Actuator. Sensors tell us what they sense, we can tell Actuators how to act. The example I have used before is a Door and Window Contact Sensor. It senses the state of the door or window it's attached to but cannot be told to open or close the door/window.

For those of us that use an external Presence detection, Apple in my case, it will not attempt to set a sensor. I can't tell Apple Automations to set a Presence on/off. It will, of course, set a switch. So when Apple detects I'm present in some geofence I've set up, I have it turn on a switch, and turn that switch off when I leave the geofenced area. But on Hubitat, I want that to appear as a Presence Sensor.

The virtual presence sensor with switch is functional on the Apple side only for it's switch actuator, but is only a Presence Sensor on the Hubitat side. Obviously both are 'visible' to both sides, but it's the functionality that matters.

If you were to split the driver code to not be synchronized. I don't know how you'd set Presence since, as mentioned before, you can't set a Sensor. By that I mean, in an Apple Automation, the presence sensor side of the virtual driver will not appear in the Select Accessories and Scenes list only the switch side will.

But if you need a starting point for creating your own driver, you might want to start here:

2 Likes

Thanks for reply! I understand why it s built like this but I try to built a kind of heating/clim system based on presence... If I leave home (and all others) the switch get off so in economic mode but as soon as someone is on its way back to home, let say 10 minutes before arrival, it turns the switch on to start heating the house... Everything is working but I would like to have less devices so I was asking... Actually, I use Locative on each members phone and I use the webhook function to trig a piston in webcore with argument, so if leave or enter a zone the argument change. By using 2 crossing zones I can tell which direction the members is going... But it uses 2 devices per members so I was asking..

I think the omnisensor could be good and I ll give it a try!

Thanks again!