Announcement

Collapse
No announcement yet.

Create my own virtual device

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Create my own virtual device

    Is it possible to create my own virtual device in RFXCOM? I need to know the amount of rainfall in the last xx hours (e.g., last 24 or 48 hours) in order to decide whether or not to allow the sprinkler system to run. The readings from my OS PCR800 do not give that information, but they do give me the readings I would need to calculate it. Is it possible to create my own?

    #2
    I guess I don't understand why the device would need to be created in RFXCOM. Wouldn't a HomeSeer virtual device work?
    HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

    Comment


      #3
      I hadn't used Homeseer virtual devices before and am checking into it. I may be able to do what I want but I guess I will have to use scripting because I can't see a way to store two values that are different in time and subtract them to get a result.

      Thanks for the help though.

      Comment


        #4
        Here's a script I use to maintain the last 7 days of rainfall from the RFXCom plugin. I run the script every night at 23:59. Device 525 is my RFXCom device for today's rainfall and the others are virtual devices that maintain the values for the previous days that I use to determine whether to enable/disable my sprinklers. You may be able to do something similar and add a virtual device that hast the total rain fall over the last few days.

        Cheers
        Al

        Code:
        Sub Main(ByVal inputparms as String)
        
        	dim sourceDevString as String
        	dim sourceDevValue as Double
        
        '1243, 1244
        	'store current value & string
        	sourceDevValue = hs.DeviceValueEx(1243)
        	sourceDevString = hs.DeviceString(1243)
        	hs.SetDeviceString ( 1244, sourceDevString, True )
        	hs.SetDeviceValueByRef( 1244, sourceDevValue, True) 
        '1242, 1243
        	'store current value & string
        	sourceDevValue = hs.DeviceValueEx(1242)
        	sourceDevString = hs.DeviceString(1242)
        	hs.SetDeviceString ( 1243, sourceDevString, True )
        	hs.SetDeviceValueByRef( 1243, sourceDevValue, True) 
        '1241, 1242
        	'store current value & string
        	sourceDevValue = hs.DeviceValueEx(1241)
        	sourceDevString = hs.DeviceString(1241)
        	hs.SetDeviceString ( 1242, sourceDevString, True )
        	hs.SetDeviceValueByRef( 1242, sourceDevValue, True) 
        '1240, 1241
        	'store current value & string
        	sourceDevValue = hs.DeviceValueEx(1240)
        	sourceDevString = hs.DeviceString(1240)
        	hs.SetDeviceString ( 1241, sourceDevString, True )
        	hs.SetDeviceValueByRef( 1241, sourceDevValue, True) 
        '1239, 1240
        	'store current value & string
        	sourceDevValue = hs.DeviceValueEx(1239)
        	sourceDevString = hs.DeviceString(1239)
        	hs.SetDeviceString ( 1240, sourceDevString, True )
        	hs.SetDeviceValueByRef( 1240, sourceDevValue, True) 
        '1238, 1239
        	'store current value & string
        	sourceDevValue = hs.DeviceValueEx(1238)
        	sourceDevString = hs.DeviceString(1238)
        	hs.SetDeviceString ( 1239, sourceDevString, True )
        	hs.SetDeviceValueByRef( 1239, sourceDevValue, True) 
        ' 525, 1238
        	'store current value & string
        	sourceDevValue = hs.DeviceValueEx(525)
        	sourceDevString = hs.DeviceString(525)
        	hs.SetDeviceString ( 1238, sourceDevString, True )
        	hs.SetDeviceValueByRef( 1238, sourceDevValue, True) 
        
        end Sub
        Attached Files
        HS 4.2.8.0: 2134 Devices 1252 Events
        Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

        Comment

        Working...
        X