Code needs to be in the 'On Start' tab of the node. This separates out the defaults/variables
Javascript for node red appliance monitoring & completion notification based on power usage/monitoring
https://zorruno.com/2021/nodered-appliance-completion-notification/