Announcement

Collapse
No announcement yet.

Linux Script Issue

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

    Linux Script Issue

    I ended up converting a system from Windows to Linux after a hard drive failed and I'm having an issue with one part of a script that I haven't figured out. I've caught on that I need to do conversions on variables since mono doesn't assume the change and I can't have multiple CAPI function calls stacked together: hs.CAPIControlHandler(hs.CAPIGetSingleControl("1010",True,"L ight Yellow",False,False)) always gives an error.

    Anyways, I have:
    Color(1) = 255
    Color(2) = 250
    Color(3) = 200

    Dim ccRed as HomeSeerAPI.CAPI.CAPIControl = hs.CAPIGetSingleControl(lDevice, True, "Red Level (value)", False, False)
    ccRed.ControlValue = Color(1)
    Dim crRed as HomeSeerAPI.CAPI.CAPIControlResponse = hs.CAPIControlHandler(ccRed)

    Dim ccGreen as HomeSeerAPI.CAPI.CAPIControl = hs.CAPIGetSingleControl(lDevice+1, True, "Green Level (value)", False, False)
    ccGreen.ControlValue = CDbl(Color(2))
    Dim crGreen as HomeSeerAPI.CAPI.CAPIControlResponse = hs.CAPIControlHandler(ccGreen)

    Dim ccBlue as HomeSeerAPI.CAPI.CAPIControl = hs.CAPIGetSingleControl(lDevice+2, True, "Blue Level (value)", False, False)
    ccBlue.ControlValue = CDbl(Color(3))
    Dim crBlue as HomeSeerAPI.CAPI.CAPIControlResponse = hs.CAPIControlHandler(ccBlue)

    The lines in different color is giving me:

    Object reference not set to an instance of an object

    Looking through the documentation, it appears the ControlValue is designated as double, and I've tried adding CDbl (as show above) and I get the exact same error.

    Can anyone tell me what I've missed? I don't want to do an event for every color change in every room where I can call a script to handle it and just pass devices to the script.

    I've updated mono and running the latest Ubuntu LTS .

    Steven
Working...
X