No announcement yet.

passing analog data to the arduino - setdevicevalue doesn't appear to work

  • Filter
  • Time
  • Show
Clear All
new posts

    passing analog data to the arduino - setdevicevalue doesn't appear to work

    I'm trying to send a temperature setpoint value to the arduino. The device string of the Arduino output isn't apparently used and I'll be darned if nothing I use will change the value - and I'm not quite sure how I ended up with a 66 in there. I'm being stupid I'm sure but can anyone point me to the correct function to change the value for an API output please.

    **My Update** - it appears that eventhough I renamed the device, I still have to use its 'technology address'. Writing to the device by its reference (1024) doesn't work, but using 'Arduino, Board:1, API Output:0' works in setdevicevalue.
    Attached Files

    Since the Arduino plug-in sets those values by calculating, you cannot change them. The value is based upon the formula you enter as compared to the DC value applied to a pin. Here I want a value from 1-1023 to represent 1-100% based upon a DC voltage from 0-5V.

    Click image for larger version  Name:	051DDF15-7B7C-409A-B8F6-4DD3FB91EBC5.jpg Views:	0 Size:	48.8 KB ID:	1559377
    HS4 Pro, Windows 10 pro, Supermicro LP Xeon


      Those are inputs coming back from the Arduino. I'm talking about sending data to the Arduino via the FromHS array. This is what I've figured out I need to do - setdevicevalue needs to use the original device name and setdevicestring needs to go with the changed name - or I just need to never change the device name

      hs.setdevicevalue ("Arduino, Board:1, API Output:0",value)
      devref=hs.getdevicerefbyname ("Hot Water Set Point")
      hs.setdevicestring (devref, value, TRUE)


        I don't understand why you would want to set a new device value to a device owned by the plug-in. The analog device in HomeSeer is updated with the values calculated by the DC voltage applied to the linked Arduino analog pin. The value of that device would normally reflect the last read DC voltage applied to the pin. If that voltage were to change it would overwrite any value you set it to. Any value to which you were to set the HS device would not send anything back to the board.

        I may not be clear as to what you're trying to accomplish. If you want to create a device to store a reference setpoint a Virtual Device would be more appropriate.
        HS4 Pro, Windows 10 pro, Supermicro LP Xeon


          Apologies for not looking at this before now.
          I think you need to do this.
          hs.setdevicestring (1024, "", true)
          hs.SetDeviceValueByRef(1024, Value, True)

          If this is not working then you may need to use Capi.

          randy This is an API output and not an Analogue input so I kind of get the user's request.
          Zwave = Z-Stick, 3xHSM100� 7xACT ZDM230, 1xEverspring SM103, 2xACT HomePro ZRP210.
          X10 = CM12U, 2xAM12, 1xAW10, 1 x TM13U, 1xMS13, 2xHR10, 2xSS13
          Other Hardware = ADI Ocelot + secu16, Global Cache GC100, RFXtrx433, 3 x Foscams.
          Plugings = RFXcom, ActiveBackup, Applied Digital Ocelot, BLDeviceMatrix, BLGarbage, BLLAN, Current Cost, Global Cache GC100,HSTouch Android, HSTouch Server, HSTouch Server Unlimited, NetCAM, PowerTrigger, SageWebcamXP, SqueezeBox, X10 CM11A/CM12U.
          Scripts =