I have 4 virtual devices, which add up times of my AC being on and other devices being on (I am using Jon00's uptime monitor for this). This is stored or displayed as days, hours, minutes and seconds in a virtual device. I would like to automatically grab all these values and store them somewhere, at the end of the month at midnight. It could be stored in another virtual device, or a variable, its not that important. I only want to be able to grab these values some time after the end of month to put them into a Excel spread sheet. (I can do this manually, unless there is a way of automating that too)
Announcement
Collapse
No announcement yet.
How can I store month end values of a virtual device ?
Collapse
X
-
I use a virtual device as a condition for my "last day of the month" events. I set the value of the virtual device using this script which runs per day shortly after midnight:
Code:Sub Main(ByVal Parms As String) Dim Debug As Boolean = True Dim logType As String = "Last Day" Dim myDate As Date = Now.Date Dim myNewDate As Date = Now.Date myNewDate = DateAdd("d",1,myDate) If myDate.Month <> myNewDate.Month Then 'last day of the month hs.setDeviceValue(6064, 100) hs.CAPIControlHandler(hs.CAPIGetSingleControl(6064,true ,"Yes",true,false)) Else 'not the last day of the month hs.setDeviceValue(6064, 0) hs.CAPIControlHandler(hs.CAPIGetSingleControl(6064,true ,"No",true,false)) End If end sub
Cheers
AlHS 4.2.8.0: 2134 Devices 1252 Events
Z-Wave 3.0.10.0: 133 Nodes on one Z-Net
-
Originally posted by mrhappy View PostI thought HS already had a trigger that could do this, I've not tried it in practice though this is just a test to show (I appreciate you don't have the action, that is for a plugin I wrote).
Cheers
AlHS 4.2.8.0: 2134 Devices 1252 Events
Z-Wave 3.0.10.0: 133 Nodes on one Z-Net
Comment
-
Originally posted by mikee123 View PostI will probably run both of your suggestions in parallel, that gives me best of both worlds. Haven't had a chance yet to install Jon00's plugin but it looks good so will get on it as soon as I have a chance.
Comment
Comment