Announcement

Collapse
No announcement yet.

Help for simple (!!!) conversion

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

  • renevk
    replied
    The command works well in HS2. It send a "all units off' command to all devices in the range "D" . And all X10 devices which are programmed to react on this commands will reponse with a "go to off " status. Also " all lights off " is possible, but in the past i've made a decision (to send a "all units off" command. The Marmitek lamp module doesn't react on "all lights off command"

    Leave a comment:


  • mrhappy
    replied
    Originally posted by renevk View Post
    And what will be the a simple way to do this?

    hs.ExecX10 "D2" , "all units off",0,0

    I tried
    hs.CAPIControlHandler(hs.CAPIGetSingleControl("D2",true ,"all units off",false,true)) but that will turn off only 1 lamp
    I've not yet messed with HS X10 in practice (just have the plugin enabled but nothing connected), is the all units off command to the house code not a device, as such there is not going to be an 'all units off' command on a device. As Al says this is something you appear to be able to use an event for but for doing it by script I would guess you would need to call into it using hs.pluginfunction if those functions are publicly available however there appears to be no documentation about it that I can see.

    Leave a comment:


  • sparkman
    replied
    Originally posted by renevk View Post
    And what will be the a simple way to do this?

    hs.ExecX10 "D2" , "all units off",0,0

    I tried
    hs.CAPIControlHandler(hs.CAPIGetSingleControl("D2",true ,"all units off",false,true)) but that will turn off only 1 lamp
    You're welcome.

    That's probably much easier with an event... If you need to access it from a script, call the event from a script.

    Leave a comment:


  • renevk
    replied
    And what will be the a simple way to do this?

    hs.ExecX10 "D2" , "all units off",0,0

    I tried
    hs.CAPIControlHandler(hs.CAPIGetSingleControl("D2",true ,"all units off",false,true)) but that will turn off only 1 lamp

    Leave a comment:


  • sparkman
    replied
    Originally posted by renevk View Post
    Just being in the migration fase and I would like to also see a simple conversion. Did you get it yet?
    Here's one way to do it:

    Code:
    Sub Main(ByVal theDevice As String)
    	''Toggle the Specified Device ON/OFF
    	' DIM is considered ON
    	' Specify the Device ID as the Parameter
    	Dim devValue As Double
    
    	' Get the Device Status
    	devValue = hs.DeviceValue(theDevice)
    	' Toggle it
    	Select Case devValue
    		Case Is > 0
    		' Device ON or DIM, turn it OFF
    		hs.CAPIControlHandler(hs.CAPIGetSingleControl(theDevice,true ,"off",false,true))
    		Case 0
    		' Device OFF, turn it ON
    		hs.CAPIControlHandler(hs.CAPIGetSingleControl(theDevice,true ,"on",false,true))
    	End Select
    End Sub
    Cheers
    Al

    Leave a comment:


  • renevk
    replied
    Just being in the migration fase and I would like to also see a simple conversion. Did you get it yet?

    Leave a comment:


  • khriss75
    started a topic Help for simple (!!!) conversion

    Help for simple (!!!) conversion

    My HS2 simple script:

    Code:
    Sub Main
    if hs.ison("A13") then
    hs.execx10 "A13","off",0
    Else
    hs.execx10 "A13","on",0
    end if
    End Sub
    How can I convert it to HS3 script?

    I have read about the CAPI function but I did not understand. Sorry, I'm not a programmer...
Working...
X