Hi,
I've got a timer (2383) that increments when the boiler is running to show me a running total of the time it's been on today. I'd like to copy this total value at midnight before it resets to a new device (2398) so I can compare today with yesterday but I'm struggling with the simplest of scripts......
Sub Main(ByVal Params As Object)
Dim dteLast = hs.DeviceValue(2383)
hs.SetDeviceString(2398, dteLast.ToString("hh:mm"), True)
End Sub
This gives me an error "Running script: Exception has been thrown by the target of an invocation."
and if I use this script:
Sub Main(ByVal Params As Object)
Dim dteLast = hs.DeviceValue(2383)
hs.SetDeviceString(2398, dteLast, True)
End Sub
I just get the numeric, non-formatted value of the time into the 2398 device, this currently being "16720"
What am I doing wrong please ??
I've got a timer (2383) that increments when the boiler is running to show me a running total of the time it's been on today. I'd like to copy this total value at midnight before it resets to a new device (2398) so I can compare today with yesterday but I'm struggling with the simplest of scripts......
Sub Main(ByVal Params As Object)
Dim dteLast = hs.DeviceValue(2383)
hs.SetDeviceString(2398, dteLast.ToString("hh:mm"), True)
End Sub
This gives me an error "Running script: Exception has been thrown by the target of an invocation."
and if I use this script:
Sub Main(ByVal Params As Object)
Dim dteLast = hs.DeviceValue(2383)
hs.SetDeviceString(2398, dteLast, True)
End Sub
I just get the numeric, non-formatted value of the time into the 2398 device, this currently being "16720"
What am I doing wrong please ??
Comment