This is not necessary the HE Nodes will keep state for you. In the config under advanced you can also set it to rebuild cache on Hubitat systemStart event. Much better than trying to manage it yourself.
Edit: might want to take this over to the NR thread..