Rule based on magnet presence (in a car)

I put a Samsung multi purpose sensor zigbee sensor into my car and this magnet is detected because my car is outside, near my garage where zigbee repeaters are placed.
That means I can see the temperature (...) inside my car.

But the main purpose is set a rule: IF my car is parked at home THEN...

The tile is displaying the last update attribute and the temperature but I don't know how to define a rule that trigger something if the car is parked or gone.

Poll the device and compare the time ? (if the poll time is equal to the actual time => car parked)
I'm short of ideas.
Any clue ?

What are you actually using to detect "presence"? Just whether the multisensor is reporting some attribute (any attribute)? Or do you somehow have the multipurpose sensor able to respond to a magnet and open/closed based on whether you're there? I'm not sure what you mean with your polling idea. It sounds like you want the multisensor to have a clock that can be checked, will sync with the hub, and drift if it doesn't communicate for a while, but it doesn't.

Before I start, I'm not sure this is the best use of that sensor if it's on battery power, as it will probably freak out and go into "panic mode" every time you leave as it tries to find a new repeater or route back to the hub. I'm not sure what effect this actually has in that regard but imagine it's worse than not.

Anyway, if you're just trying to guess presence based on the reporting of other attributes, Rule Machine doesn't have any generic "last activity" kind of trigger, but you could pick a few sacrificial attributes and use them as proxies. Maybe something like:

Trigger Events: Multisensor temperature *changes* OR Multisensor acceleration *changes* OR Mutlisensor battery *changes*


Cancel Delayed Actions
Run Custom Action: Virtual Presence Sensor.arrive()
Delay 2:00:00 (cancelable)
Run Custom Action: Virtual Presence Sensor.depart()

I'm making it wait two hours, which unless your garage is climate-controlled should probably be often enough for the sensor to have reported in at least some value once. This is obviously not the fastest way to determine presence, but with a sensor that doesn't send time-based checkins, it's a safer option. With a custom driver, you might be able to configure a specific reporting interval and use a custom app to check for last activity (something like Device Watchdog, which actually does--I'm cheating with RM by looking at whatever attributes I can think of instead), but I haven't seen anyone try that, and there's no native way with Hubitat (or SmartThings) to configure that exactly at the moment, though most Zigbee devices can be customized in such a manner.

1 Like

Yep. I was fooled by the "last update attribute on the tile. The battery was not a problem but the sync time is. I need to update faster than that: almost every 15 minutes.

I think I'll put an old android phone hooked on my battery, registered to HE and see if the car is away with the geofencing enabled. Sounds far easier in the second thought !

Look at a SmartThings Arrival sensor. The update time on mine is around 2 minutes.

1 Like

Does HE recognize it ?

Yup. Other than the battery being fiddly when swapping it out, it's been reliable for me. One of the nifty mods people have been doing for cars is pulling the module out, buying a 4 AA battery case, pulling 2 of the sets of AA contacts out of it, and fitting the module inside the battery case. 2 AA batteries run the module a lot longer than the CR2032 coin cell battery. One example:


Yeah, it makes the sensor package larger. But in the car does it really matter?

Absolutely. I have some enclosures with 6 or 8 18650 batteries on them. will last for months...

I've gotten 6+ months out of good coin cells. No idea what mine would do with bigger batteries.

1 Like

This was originally my version of the mod on SmartThings (ha! You even used one of my pictures - that’s one of my soldering boards :slight_smile: )
I have just replaced the batteries in my cars after one of them failed..
I did this mod on my sensors in May 2017 and they have only just failed.
Actually two of my three cars were still ok.. I just changed the batteries to be sure




Is there a way to determine if the vehicle is in the garage or in the driveway?

Not using the presence sensors.
Pressure mat?
Break beam sensor?

The presence sensors just tell you that the car is within range

Yes, absolutely and the rule is obvious in Quebec: cars are never in garage but always in the driveway.
Garage are made to store high value items like lawnmowers, leaf blowers, cans of paint, fridges, etc. Low value items like cars are always stored outside. In the winter, we put "abris tempo" to protect our cars against snow.
Don't ask further questions about this, I'm an immigrant :sunglasses:


1 Like

Nice mod Andy. I may end up doing the same thing to my SmartThings Arrival sensor as it's currently chewing up the last lot of 2032 Energizer batteries I bought. I just replaced the battery Oct 30th. Just checking the battery out of curiosity (from reading this thread), the battery level is at 50%. No idea why unless this is a crappy lot of batteries. I need to get my multimeter out and test the rest of the "new" batteries.

I just got in 2 Iris keyfobs that also work as presence sensors. I'm currently evaluating them to see how well they perform and may end up replacing the the SmartThings Arrival sensor on my keyring with one of those.

I just did this very thing and have it working within 5 minutes of setup (after getting custom driver):

Don't cut the green wire! :bomb: :grin:

I wonder sometimes what would happen if someone didn't know that people like us like to tinker, and they look at our car or homes. I have stuff like this all over the place, and it truly could be mistaken for something it is not.