Motion State Stuck due to battery failure. Can I manually change state

Hi, my batteries have lost power in 2 smartthings motion sensors. Their state is stuck in the motion active position which is technically incorrect. At the moment I don't have any spare batteries and can't find a way or manually altering the state to motion inactive. Some of my automations require the sensors to rest in the inactive position. Is there a way to manually reset the state within Hubitat. I can't find a way at this stage. NB I've had similar problems with Xiaomi door contacts but they can manually be changed to show open/closed.

Wrote this some time back to deal with similar situations:

https://raw.githubusercontent.com/thebearmay/hubitat/refs/heads/main/apps/forceClose.groovy

Import the code under the Apps Code tab, create the app under the Apps tab, and then add the devices you want to set to the app.

5 Likes

I think you could also just change the driver to the virtual motion sensor driver, change the state from there, then change it back to the driver it was on before.

5 Likes

That works perfectly.
I was fooling around with a motion sensor.
All I could come up with was changing it to Device, but all that could do was clear the states.
I've never used the virtual sensors, really.
Excellent.
(Even though I'm not the original poster, lol)

This is brilliant and thank you for your help. Works a treat! Appreciated

1 Like

An app for everything, Swiss army dev. :wink:

2 Likes

Should mash a bunch of these little utility apps together into one app, or have a parent app that gives you a list you can pick from and install them as child apps below it. Now that would be cool.

3 Likes

That would be very cool!

Hi, @thebearmay, I have a similar problem with some bulbs which are showing the wrong state. I'm on holiday away from home and this is messing up some of my routines. In short, my lamps were in the on state and my wife has unplugged them. Ultimately they are now off but the state won't update to off. Is there any way to remotely force the state of the lamp similar to doing it with contact sensors?

Same concept, let me see if I have something laying around. If not it's a quick update.

That would be extremely helpful. Appreciated :+1:

Added an off command for switches/bulbs:

https://raw.githubusercontent.com/thebearmay/hubitat/refs/heads/main/apps/forceClose.groovy

2 Likes

This is working exceptionally well. Many thanks for your continual help @thebearmay

2 Likes