saving valve state code although not working (node-red bug?)