apwelsh / hubitat

MIT License
26 stars 12 forks source link

Can the Motion sensor status attribute be changed? #25

Closed xxKeoxx closed 1 year ago

xxKeoxx commented 1 year ago

I haven’t found a way to do this in hubitat so I assume the status attribute of the hue motion sensor is read only.

What I’d like to do is create a rule that disables a motion sensor. If this is not possible, can it be added?

apwelsh commented 1 year ago

Motion sensors are sensor devices, so their attributes are read-only. Actuator devices are read-write. Generally, when someone wants to write to a sensor device, it is an indication that the sensor is being used incorrectly. Virtual sensors are equipped with commands to enable automations to command a virtual sensor to change state, that is because the automation is manipulating the device for automation purposes so much as they are using automation to emulate a state change trigger event -- these are real sensors, so the state is representative of what is reported by the sensor.

The same limitations are in place for all hardware sensors, not just hue motion sensors. And if you think about it, it makes sense. Again a motion sensor with a 1 minute delay before motion stop. The sensor sends a motion state event, then after 1 minute of no motion it sends the no motion event. If you programmatically change the sensor to no motion 5 seconds after motion was detected, then 20 seconds later there is motion, the motion sensor would not trigger again, because as far as it knows, it is still in the motion state.

Have you considered using the motion lighting app to create motion rules that work the way you want, without changing the motion sensor's state?

apwelsh commented 1 year ago

What I’d like to do is create a rule that disables a motion sensor. If this is not possible, can it be added?

The motion lighting does this using a button controller or switch.

xxKeoxx commented 1 year ago

the motion lighting app requires you to configure your automation in hubitat. I want my lighting automation to be independent from hubitat so I can take hubitat out of the setup at any time and still have my lights working.

The hue app allows you to disable a motion sensor and I was able to do this using an api call to hue in the past. I thought it would make sense to have it as part of this app as I could see others wanting to do it.

Basically I had all of my lighting controls in the hue app and use certain hubitat devices to disable the motion sensors as needed. The hue app is much more user friendly for motion triggers and scene creation.

apwelsh commented 1 year ago

Interest. I will see if there is an api call I can make for this. As long as the feature is an api capable feature, and the changes are stored on the hue, I don't see why this shouldn't be added.