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 9, 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 10, 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.
        - Bram

        Send from my Commodore VIC-20

        Ashai_Rey____________________________________________________________ ________________
        HS3 Pro 3.0.0.534
        PIugins: ZMC audio | ZMC VR | ZMC IR | ZMC NDS | RFXcom | AZ scripts | Jon00 Scripts | BLBackup | FritzBox | Z-Wave | mcsMQTT | AK Ikea

        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
            HS4Pro Running on a Raspberry Pi4
            67 Z-Wave Nodes, 111 Events, 422 Devices
            Z-Wave, UPB, WiFi
            Plugins: EasyTrigger, weatherXML, OMNI, Z-Wave, Tuya, Device History
            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.
              - Bram

              Send from my Commodore VIC-20

              Ashai_Rey____________________________________________________________ ________________
              HS3 Pro 3.0.0.534
              PIugins: ZMC audio | ZMC VR | ZMC IR | ZMC NDS | RFXcom | AZ scripts | Jon00 Scripts | BLBackup | FritzBox | Z-Wave | mcsMQTT | AK Ikea

              Comment

              Working...
              X