Announcement

Collapse
No announcement yet.

Aspx & Controlling Device

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

  • Aspx & Controlling Device

    I am trying to start really simple but even then fail. My starting point is the test.aspx file that is included with HS3. I do see the site and it reports the HomeSeer version and the name of the z-wave plugin. So clearly it was able to establish a connection. What I did next is modify the Button1_Click function by simply executing the following:
    hs.SetDeviceValueByRef(22, 99, True)
    22 it the reference ID of my device. The value 99 represents ON. I also tried SetDeviceValue and SetDeviceValueByName. However, whenever I click on the button nothing happens. Any pointers how to get this to work?

    Edit: Btw, is there a way to debug this? On the client side the button is rendered with type='submit' so I can't really do anything on the client side and I don't know how to intercept calls on the 'server side'.
    Last edited by mulu; August 9th, 2018, 12:44 AM.

  • #2
    Rather than setting the device value which only normally sets a value to that device, you need to use the Homeseer CAPI interface: http://help.homeseer.com/help/HS3/st...ce_control_api


    Try the following to turn your device on:

    Code:
    hs.CAPIControlHandler(hs.CAPIGetSingleControl(22, True, "On", False, False))
    Last edited by jon00; August 10th, 2018, 01:13 AM.
    Jon

    Comment


    • #3
      Ah, that was it. With SetDeviceValueByRef I could see the status change on the device management page. However, the device didn't actually change its state. After using the CAPI functions it started to work. Thank you!!!

      Comment


      • #4
        From
        hs.SetDeviceValueByRef(22, 99, True)
        to
        hs.CAPIControlHandler(hs.CAPIGetSingleControl(22, True, "On", False, False)) is called progress ???!?.
        Things should get easier, not more complicated.
        Whoever dreamed up this nightmare took programming decades back.

        (Sorry for the ramble)

        jon00 Thanks for sharing this info. It will go in my personal notes to remember this.

        Comment


        • #5
          Originally posted by AshaiRey View Post
          From
          hs.SetDeviceValueByRef(22, 99, True)
          to



          hs.CAPIControlHandler(hs.CAPIGetSingleControl(22, True, "On", False, False)) is called progress ???!?.
          Things should get easier, not more complicated.
          Whoever dreamed up this nightmare took programming decades back.

          (Sorry for the ramble)

          jon00 Thanks for sharing this info. It will go in my personal notes to remember this.
          Hah...you can read all about it here: https://oldforums.homeseer.com/showthread.php?t=167405

          The reason given in that thread is IMO not valid as HST implemented a single command when JSON control came along...
          Jon

          Comment


          • #6
            Wow - I had forgotten that thread. I just spent 10mins reliving the past
            HS3Pro Running on a Raspberry Pi3
            64 Z-Wave Nodes, 168 Events, 280 Devices
            UPB modules via OMNI plugin/panel
            Plugins: Z-Wave, BLRF, OMNI, HSTouch, weatherXML, EasyTrigger
            HSTouch Clients: 3 Android, 1 Joggler

            Comment


            • #7
              Just relived the thread too.
              4 years further and no one is annoyed enough from all the extra work to do what was a simple syntax before and write a wrapper around the CapiControl.

              Comment

              Working...
              X