Announcement

Collapse
No announcement yet.

When are "virtual devices" generally needed?

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

    When are "virtual devices" generally needed?

    Hello all,

    I understand the concept behind needing "virtual devices" if you're doing things like overriding the "off", or configuring a device to remain on for a period of time, or whatever...

    But if I'm making devices in HomeSeer that don't really exist, and I just want an action to be taken when there's an "on" status or an "off" status, do I need the virtual devices then?

    Case in point, for example, I have some flood mitigation pumps. They're controlled by an 8051-based microcontroller, and I open a COM port and send ASCII mnemonics to turn them on and off. If I create a "Flood Submersible Pump" device in Homeseer, and use UDMCs to execute scripting code to emit the ASCII mnemonics when the "Flood Submersible Pump" device is turned on and off, should I still bother with the virtual devices?

    Thanks,
    Chris

    #2
    Virtual devices are used in the plugin so that the plugin does not manipulate the original devices as they may be owned by another plugin or script
    If you created a virtual device you want to use then you likely will not need another virtual device in the plugin
    Cheers,
    Bob
    Web site | Help Desk | Feature Requests | Message Board

    Comment


      #3
      Ok, that's what it seemed like, thanks.

      Do I have too high of expectations for this plug-in? It seems like if I just keep adding "motion sensors" for every device (virtual or otherwise) I care about, I wouldn't even need to bother with "if this device turns on or off, call this script with these arguments" events anymore?

      Thanks,
      Chris

      Comment


        #4
        You can have BLRadar do everything for you by using the UDMC where you have a lot of control over what you want to do

        For example, I have a natural gas heater in my garage that I control using the opening and closing of the garage door since I do not want the heater running while the door is open

        When the garage opens I call this code:

        Code:
        hs.CAPIControlHandler(hs.CAPIGetSingleControl(3617,True,"Off",False,False))
        If hs.PluginFunction("BLRadar", "", "DelayedEventExists", New Object(){"Garage Heater Delay On Control"}) = True Then
            hs.PluginFunction("BLRadar", "", "RemoveDelayedEvent", New Object(){"Garage Heater Delay On Control"})
        End If
        This code turns off the garage heater and deletes the delayed event (Garage Heater Delay On Control) that was set up in BLRadar to turn the heater back on (if it exists)

        When the garage door closes I call this code:

        Code:
        hs.PluginFunction("BLRadar", "", "NewDelayedEventForNoEcho", new Object(){"Garage Heater Delay On Control", "Garage Heater Switch:on", 2, ""})
        This code creates a delayed event (Garage Heater Delay On Control) in BLRadar to turn on the garage heater in 2 minutes


        Hope this example helps
        Cheers,
        Bob
        Web site | Help Desk | Feature Requests | Message Board

        Comment


          #5
          Sounds good, thanks for that update. I'll probably end up with a few dozen BLRadar devices when I'm done. It'll be interesting to be able to just modify the device directly when I want to change the scripting code, instead of modifying script files. Definitely a paradigm shift from MCSMovement, with just a bit of a learning curve.

          Thanks,
          Chris

          Comment

          Working...
          X