Initial commit
This commit is contained in:
20
front-porch/shut-off.js
Normal file
20
front-porch/shut-off.js
Normal file
@ -0,0 +1,20 @@
|
||||
const states = global.get('homeassistant.homeAssistant.states')
|
||||
const frontPorchToggle = states['input_boolean.front_porch_light_on'].state
|
||||
const deliveryMode = states['input_boolean.delivery_mode'].state
|
||||
const holidaymode = states['input_boolean.holiday_mode'].state
|
||||
const currentholiday = states['input_select.holiday_animation'].state
|
||||
const holiday = currentholiday.toLowerCase()
|
||||
|
||||
if (frontPorchToggle === 'on' && deliveryMode === 'off') {
|
||||
if (holidaymode === 'on') {
|
||||
node.status({fill:"blue",shape:"dot",text:"Holiday On"})
|
||||
node.send([msg,null])
|
||||
} else {
|
||||
node.status({fill:"green",shape:"dot",text:"Holiday Off"})
|
||||
node.send([null,msg])
|
||||
}
|
||||
} else if (frontPorchToggle === 'off') {
|
||||
node.status({fill:"red",shape:"ring",text:"Blocked (Automation Off"})
|
||||
} else if (deliveryMode === 'on') {
|
||||
node.status({fill:"red",shape:"ring",text:"Blocked (Delivery Mode)"})
|
||||
}
|
Reference in New Issue
Block a user