Add wife's presence processing node for tracking

This commit is contained in:
2024-01-10 22:00:15 -05:00
parent c7ee7292f7
commit e099fddb02

View File

@ -0,0 +1,14 @@
const states = global.get('homeassistant.homeAssistant.states')
const workEndZone = states['binary_sensor.tina_work_end_zone'].state
const tinawork = msg.tinawork
if (tinawork === 'on' && workEndZone === 'on') {
node.status({fill:"green",shape:"dot",text:"Activated"});
return[msg,null]
} else if (tinawork === 'off') {
node.status({fill:"yellow",shape:"dot",text:"No Work Today"});
return null
} else {
node.status({fill:"red",shape:"ring",text:"We fucked up"});
return[null,msg]
}