How to disable Motion Mote (switch ?)

Started by Lukapple, December 12, 2018, 09:02:44 AM

Lukapple

Hi,
I've plenty of Motion Mote sensors installed around house. Is there any way to temporary disable them? What I want is to implement some kind of "Home Mode", which will disable motion sensors, so I won't get motion alerts (push notifications) when I'm home. To implement that, I need to find a way to mark motion sensor as "disabled" or "enabled".
Before I dig into gateway source code, I would like to know if there is any way to define custom on/off switch inside each node? That switch should report ON/OFF event, which I'll read latter from database file, so I can know if I should ignore motion event or not.

Thanks!

Felix

I think you mean a "software" ON/OFF switch.
For now you individually have to turn alert events on/off. I think the actual MOTION sensing should not stop entirely, and in turn it's the PiGateway's job (based on your settings and events) to respond to such a MOTION event, or do nothing.

I thought about this problem quite a bit actually. In a future version of the Gateway I plan to make such a mode where you can enable zones or the entire system for motion or other alerts.
I think a dummy "zone" node that contains a combination of referenced metrics/nodes of interest, and then an event on that dummy node can respond to any MOTION.



Lukapple

Actually I forgot to mention that I'm using my moteino motion nodes with Apple HomeKit and I trigger motion notifications by monitoring motion mote event database from HomeKit side. I'm not using "EVENT" functionality of Gateway (SMS event, mail event,etc...).
And I don't want stop motion sensing. All I want is to add custom "ON/OFF" metrics, and somehow set that metrics. On the HomeKit side I'll read that metrics ON/OFF state from database, so I can know if I should ignore that motion event or not.
Sorry for my bad english, I home that you understood what I want to achieve.

Jason

This might not apply, but a quick and built in value you could change is the duplicate value logging parameter.  That way if you are active in the room, it will only log when the activity starts and then stops, if the motion mote notifies when motion has stopped.  I haven't used a motion mote.

Another idea: Since the Apple notification thing is monitoring the gateway database, then if you had say a switch mote, or a switch hooked up to a gateway, could you have the Apple service do an if / then statement like:
If(Switch = On) {
// Do nothing
} Else {
// Run notification function
}


A final idea: create a custome Notify metric for the motion notes. This would mean the motion mote code would need to be updated to support that new metric as well. The Apple system would still need to do the if/then statement.  The only way I can think of to change that metric would be to send some data through the gateway app terminal to the mote to update that new metric.  I haven't played around with this.

Well here are some ideas.  I don't think they are exactly what you want, but maybe a step in the right direction!

Felix

Lukapple,
Sorry for my total ignorance but what is Apple Home kit and how does it interact with PiGateway?

Lukapple

@Jason thanks for the ideas. I think that "custom metrics" is the right way to do it.
The only problem is that custom metrics can be only set from nodes, and not directly from the the gateway interface.
It would be great if you could set custom metric like you can set node settings (example lowVoltageValue).
Something like this:



@Felix:
HomeKit is a platform baked into iOS (Apple iPhone and other iDevices operating system) for controlling your smart home.
Moteino nodes does not support HomeKit, so you have to use "HomeBridge" to implement HomeKit support. With HomeKit you can open for example garage doors which uses GarageMote using voice control (from Apple Watch or iPhone - Siri), it works really well.

However, let's say that HomeKit is a black box, that connects to Moteino Gateway via socket and listens to node events. When specific event happens  - in my case "MOTION", then it updates HomeKit device status(motion sensor), which triggers notification.
Now what I need to do is, when motion event happens, I should also read "enabled" custom metric and if it's set to OFF, I should ignore motion event.
Custom metric should be something like this:


So the problem is that I can only set custom metric from moteino node, is that right or is there any other way to set it?