From e099fddb02f9749e96436eae600093549e2039bd Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Wed, 10 Jan 2024 22:00:15 -0500 Subject: [PATCH] Add wife's presence processing node for tracking --- presence/tina-processing.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 presence/tina-processing.js diff --git a/presence/tina-processing.js b/presence/tina-processing.js new file mode 100644 index 0000000..803cfa2 --- /dev/null +++ b/presence/tina-processing.js @@ -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] +} \ No newline at end of file