Initial commit
This commit is contained in:
12
front-porch/if-motion.js
Normal file
12
front-porch/if-motion.js
Normal file
@ -0,0 +1,12 @@
|
||||
const states = global.get('homeassistant.homeAssistant.states')
|
||||
const deliveryMode = states['input_boolean.delivery_mode'].state
|
||||
const detect = msg.detect
|
||||
|
||||
node.send([null,msg])
|
||||
|
||||
if (detect === 'motion' && deliveryMode === 'on') {
|
||||
node.status({fill:"green",shape:"dot",text:"Motion/Delivery"})
|
||||
node.send([msg,null])
|
||||
} else {
|
||||
node.status({fill:"green",shape:"dot",text:"Not Motion"})
|
||||
}
|
Reference in New Issue
Block a user