Announcement

Collapse
No announcement yet.

Sharing a plugin across HSPro and HomeTroller

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

    Sharing a plugin across HSPro and HomeTroller

    I've got a Hometroller on order, and I've got a script that _almost_ does what I want. What I want is to slave a set of dimmers to a set of controller (i.e with two lamps in the room, use the wall switch to control both when the switch doesn't support it natively).

    Yet I feel that a plugin could do this better, offer a configuration screen instead of hard coded constants, etc.

    If I go through the bother of learning .net, can I write an assembly that will work both with HSPro on Windows7 and on HomeTroller (on an Atom processor)?

    Suggestions welcome.

    #2
    I think an automatic event would help to trigger this function.
    Monitor status change of switch, then create an action to turn on /off other lights as well.
    is this what you need?

    Comment


      #3
      umpcfans,
      yes, that's what I've got right now. I trigger an event on:

      Device Den 1st Floor Den Lamp value changes to any

      and from that, I invoke a script (shown below). It mostly works, but if I want to extend it to another device, I either need to poll every pair of slaved devices when run or clone the script. I don't like either solution.

      With a plugin, I could have a device button to connect them and store preferences, hook the change events, etc. It's probably not worth it, though.

      Anyway, in case anyone else is interested, here's the script I've been using:

      ---------------------

      sub SlaveFollowsMaster(master_device, slave_device)
      master_status = hs.DeviceStatus(master_device)
      slave_status = hs.DeviceStatus(slave_device)
      master_value = hs.DeviceValue(master_device)
      slave_value = hs.DeviceValue(slave_device)

      if master_status = slave_status Then
      if master_status = 4 Then
      if master_value = slave_value Then
      Else
      hs.Transmit slave_device, "Dim", master_value
      end if
      End if
      Else
      if master_status = 2 Then
      hs.Transmit slave_device, "on"
      elseif master_status = 3 Then
      hs.Transmit slave_device, "off"
      elseif master_status = 4 Then
      hs.Transmit slave_device, "dim", master_value
      End if
      End if
      end sub

      sub main()
      SlaveFollowsMaster "Q19", "Q18"
      end sub

      Comment

      Working...
      X