Announcement

Collapse
No announcement yet.

Sample code for device control

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

  • tenholde
    replied
    Originally posted by jimbell View Post
    I am a big fan of Ed Tenholder's Tenscripting tool. I use it for all my vb development. Makes the effort so much easier.

    I was not aware of the TenScriptAid tool. Looks like another great tool from Ed for Homeseer vb development.

    Thanks
    Jim,

    The support request you sent me had a bad return email address. Let me know if you got my response.

    tenholde

    Leave a comment:


  • jimbell
    replied
    Thank for the info

    Originally posted by Uncle Michael View Post
    You may also find that tenScriptAid is a useful tool.
    I am a big fan of Ed Tenholder's Tenscripting tool. I use it for all my vb development. Makes the effort so much easier.

    I was not aware of the TenScriptAid tool. Looks like another great tool from Ed for Homeseer vb development.

    Thanks

    Leave a comment:


  • bdraper
    replied
    Originally posted by jimbell View Post
    I got it working using the sample. The script attachment was exactly what I was talking about in the original post. I will put that in a safe place for future reference.
    Good deal, glad you got it working.

    Leave a comment:


  • jimbell
    replied
    I got it working

    Originally posted by bdraper View Post
    Are you using the CAPIControl.vb script that Rich posted some time back?

    If so you can use it to turn lights on/off/dim. Posted below is a screen shot of 3 test events using the script.

    The example on event turns on the device named "Button A - Table Light (MS)".
    The example off event turns off the device named "Button A - Table Light (MS)".
    The example dim event dims the device named "Button A - Table Light (MS)" to 33%.

    I also attached the VB script as a text file (remove the .txt extension)

    [ATTACH]56722[/ATTACH]

    Hope this helps.
    I got it working using the sample. The script attachment was exactly what I was talking about in the original post. I will put that in a safe place for future reference.

    Leave a comment:


  • Uncle Michael
    replied
    You may also find that tenScriptAid is a useful tool.

    Leave a comment:


  • sparkman
    replied
    Here's an example of a small script that sets a dim value using CAPI:

    Code:
    Sub Main(ByVal Parms as String)
    
    	Dim ParmArray() as String
    	ParmArray = Parms.tostring.split(",")
    	dim targetDev as Double = CDbl(ParmArray(0))		'reference ID of the device to use for existing value
    	dim targetDim as Double = CDbl(ParmArray(1))		'reference ID of the device to set based on value of targetDev1 
    	hs.CAPIControlHandler(hs.CAPIGetSingleControl(targetDev,false,targetDim,false,true))
    	hs.writelog("Dim Script","Set New Dim: " & targetDim)
    
    End Sub

    Leave a comment:


  • bdraper
    replied
    Are you using the CAPIControl.vb script that Rich posted some time back?

    If so you can use it to turn lights on/off/dim. Posted below is a screen shot of 3 test events using the script.

    The example on event turns on the device named "Button A - Table Light (MS)".
    The example off event turns off the device named "Button A - Table Light (MS)".
    The example dim event dims the device named "Button A - Table Light (MS)" to 33%.

    I also attached the VB script as a text file (remove the .txt extension)

    Click image for larger version

Name:	event.jpg
Views:	1
Size:	108.0 KB
ID:	1187178

    Hope this helps.

    Leave a comment:


  • jimbell
    started a topic Sample code for device control

    Sample code for device control

    I had downloaded some sample code about a year or so from somewhere on homeseer showing how to control device with CAPI. I have been using CAPI to turn devices on and off for quite a while. Now I want to control a device that dims and set it to a specific dim value. I cannot get this to work with my current code. I can't find the code that I downloaded previously. Does anyone remember where this sample code is located? I believe that it was in some kind of article written my Rich. Or, some other sample code would work as well.
Working...
X