I've checked your changes, but the only change I've found is in the CreateRoot sub. The other changes are all because of search/replace. In the CreateDevice subs, you've replaced it with the same code:
Dim dvref = dv.Ref(hs)
I've tested the script in my environments by deleting the root device, but was not able to reproduce your issue. My HS version is the same, 18.104.22.168. I've also checked the helpfiles (http://homeseer.com/support/homeseer/HS ... class1.htm), the property Ref should exists and hold the reference to the root device.
I've also compared my current version with the first version. There is a bug in that version: The LastUpdate value was constantly changing. You should remove the "hs.SetDeviceValue.." line in Sub UpdateDeviceValue to fix this bug.
Sub UpdateDeviceValue(DeviceAddress as String, DeviceType as String, Value as Double) Dim dvRef = hs.GetDeviceRef(DeviceAddress) ' hs.SetDeviceValueByRef(dvRef, Value, True) <== Remove this line Select Case DeviceType
Hope that helps!